From Bugzilla Helper: User-Agent: Mozilla/5.0 (compatible; Konqueror/3.3; Linux) (KHTML, like Gecko) Description of problem: While trying to link klibc-0.181: ld -m elf64ppc -o tests/environ.shared -e main interp.o tests/environ.o -R libc.so /usr/lib/gcc/ppc64-redhat-linux/3.4.2/64/libgcc.a ld: BFD 2.15.92.0.2 20040927 assertion fail ../../bfd/elf64-ppc.c:4703 make[1]: *** [tests/environ.shared] Segmentation fault (core dumped) make[1]: *** Deleting file `tests/environ.shared' Version-Release number of selected component (if applicable): binutils-2.15.92.0.2-2 How reproducible: Always Steps to Reproduce: 1. Try to build klibc-0.181 for ppc64 on rawhide Fedora/ppc. 2. 3. Additional info:
What klibc is doing, if it ever worked, worked by pure luck. ld certainly isn't prepared for linking against ET_EXEC objects as if they were shared libraries. I guess the best solution would be immediately error out when trying to link against an executable. The alternative would be to audit hundreds of abfd->flags & DYNAMIC checks to see whether EXEC_P bit should also be relevant or not.
I presume you're talking about the -R libc.so bit. What klibc does is the documented behaviour of ld -R; it imports *only* a symbol table. Anyway, that is not the problem at hand. Alan Modra has confirmed it is an "old ABI/new ABI" thing, and it also affects the kernel. Specifying -mcall-aixdesc to gcc makes it work by using the "old ABI".
Oops, I have missed the -R there, sorry about that. Alan Modra's patch is in binutils-2.15.92.0.2-5.