Thread View: gnu.gcc.bug
1 messages
1 total messages
Started by Helmut Kaufmann
Fri, 30 Oct 1992 15:31
Bug in gnu-ld using gcc, g++ and gas
Author: Helmut Kaufmann
Date: Fri, 30 Oct 1992 15:31
Date: Fri, 30 Oct 1992 15:31
23 lines
1318 bytes
1318 bytes
We're using Sparc stations running SunOs4.1.1.
We've compiled gcc2.2.2 with the -with-gnu-as and -with-gnu-ld options
We've compiled glibc1.05 and libg++2.2.
We tried to link a program containing c and c++ object files and found
out the following:
If u use only c u can have an object file containing only global variables
with their initializations (int i=0, j=12; ). j will be initilized
correctly at the beginning of the main program.
If u link c++ code and c code together, j won't be initialized but set to
zero. U have to include a dummy function (void dummy(void) {}; ) in the
module containing the global vars and call it BEFORE accessing j. Then,
j will be set correctly.
This looks like a bug to us. Probably the linker doesnt't work correctly.
Can u give us a helping hand?
Thanks a lot
Helmut Kaufmann & Martin Wunderli
{kaufmann,wunderli}@inf.ethz.ch
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