'ld' Linker Problems

Tom Larsen tomar@eai.com
Mon Jun 14 16:26:00 GMT 1999


EGCS ML,

I'm unsure if this belongs in this mailing list since it is more
about the linker and the compiler but I'm willing to give it a
shot any way. :-)

I seem to have problems getting the linker to create a shared object.
Here is what I use on the command line....

/usr/bin/g++ -shared $(INCLUDE_PATHS) -D_linux -fPIC -g $(LIBRARY_NAME)
$(OBJS) $(LIBRARY_PATHS) $(CLOSE_LIBS)

$(INCLUDE_PATHS) is a bunch of include paths ("-I/paths/include ...")
$(LIBRARY_NAME) is the name of the library ("-o mylib_linux.so")
$(OBJS) is a collection of objects("first.o second.o third.o ...")
$(LIBRARY_PATHS) is a bunch of paths to other libraries. ("-L/paths/lib
...")
$(CLOSE_LIBS) is the set of libraries to close against("-lm -lpthread
...)

Seems reasonable right?  Unfortunately, the linker reports this....

collect2: ld terminated with signal 11 [Segmentation fault], core dumped
/usr/bin/ld: bfd assertion fail elf32-i386.c:621
/usr/bin/ld: bfd assertion fail elf32-i386.c:621
/usr/bin/ld: bfd assertion fail elf32-i386.c:1414

What does this assertion mean?  It may help figure out what the
problem is.

Before I forget, the platform information. :-) Linux 2.2.5 on
a i686 using version 2.91.66 of the EGCS compilers and 
version 2.9.1 of 'ld'.  If you need more information, please
ask.

Thanks for considering the problem, :-)
Tom Larsen
aka tomar@eai.com

-- 
Tom Larsen(Tomar)  
aka: tomar@eai.com 
      E.A.I        
http://www.eai.com


More information about the Gcc mailing list