This is the mail archive of the
mailing list for the binutils project.
Re: Can I link a.out .o with ELF?
On Sun, Jun 04, 2000 at 06:38:00PM -0700, H . J . Lu wrote:
> On Mon, Jun 05, 2000 at 11:30:08AM +1000, Alan Modra wrote:
> > On Sun, 4 Jun 2000, H . J . Lu wrote:
> > > I believe I used to be able to link a .o file in a.out on an ELF
> > > system. But now I got
> > >
> > > # gcc -o aout x.o
> > > collect2: ld terminated with signal 11 [Segmentation fault], core dumped
> > gcc -v output? It's not clear to me whether you're using an elf linker to
> > link a.out objects with a.out start-up and libraries, or with elf startup
> > and libraries. I'm guessing it's elf from looking at x.o
> # gcc -v x.o
> Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.95.3/specs
> gcc version 2.95.3 20000503/Linux (prerelease)
> /usr/lib/gcc-lib/i386-redhat-linux/2.95.3/collect2 -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 /usr/lib/crt1.o /usr/lib/crti.o /usr/lib/gcc-lib/i386-redhat-linux/2.95.3/crtbegin.o -L/usr/lib/gcc-lib/i386-redhat-linux/2.95.3 -L/usr/i386-redhat-linux/lib x.o -lgcc -lc -lgcc /usr/lib/gcc-lib/i386-redhat-linux/2.95.3/crtend.o /usr/lib/crtn.o
> collect2: ld terminated with signal 11 [Segmentation fault], core dumped
> It works with glibc 2.0, but not 2.1.
It seems that ELF_LINK_NON_ELF doesn't work too well with symbol
versioning. As the result, when a verioned symbol is referenced
in an a.out .o file, the ELF_LINK_NON_ELF bit on the default symbol
is not set. I am not sure what else is not working right.