Thread View: gnu.g++.bug
1 messages
1 total messages
Started by James Clark
Sun, 12 Mar 1989 11:49
g++ 1.34.0 sparc bug
Author: James Clark
Date: Sun, 12 Mar 1989 11:49
Date: Sun, 12 Mar 1989 11:49
32 lines
1356 bytes
1356 bytes
I have looked further at the bug I reported to you earlier today (with
g++ 1.34.0 on the SPARC). It turns out to be a problem with ld++
If you compile and run the following, you'll see the problem.
static double x;
main()
{
x = 1.0;
}
What happens is that the bss segment ends up being aligned
on a 4-byte boundary, which causes the program to generate
a bus error on execution.
The following diff seems to fix this problem:
*** ld.c.distrib Sat Feb 25 21:41:56 1989
--- ld.c Sun Mar 12 11:37:27 1989
***************
*** 2189,2194 ****
--- 2189,2195 ----
outheader.a_text += N_ADDRADJ (outheader);
#endif
+ data_size = (data_size + sizeof(double) - 1) & ~(sizeof(double)-1);
/* Make the data segment address start in memory on a suitable boundary. */
data_start = N_DATADDR (outheader) + text_start - N_TXTADDR (outheader);
I don't really understand ld too well, so this may not be a
good fix, but it seems to work for me.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads