Bug 135498 - ld asserts trying to link ppc64 klibc
Summary: ld asserts trying to link ppc64 klibc
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: binutils
Version: rawhide
Hardware: powerpc
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-10-13 03:22 UTC by H. Peter Anvin
Modified: 2007-11-30 22:10 UTC (History)
2 users (show)

Fixed In Version: 2.15.92.0.2-5
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-10-20 12:35:42 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description H. Peter Anvin 2004-10-13 03:22:46 UTC
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:

Comment 1 Jakub Jelinek 2004-10-13 14:14:17 UTC
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.

Comment 2 H. Peter Anvin 2004-10-20 00:57:59 UTC
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".

Comment 3 Jakub Jelinek 2004-10-20 12:35:42 UTC
Oops, I have missed the -R there, sorry about that.
Alan Modra's patch is in binutils-2.15.92.0.2-5.


Note You need to log in before you can comment on or make changes to this bug.