Bug 135498 - ld asserts trying to link ppc64 klibc
ld asserts trying to link ppc64 klibc
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: binutils (Show other bugs)
rawhide
powerpc Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-10-12 23:22 EDT by H. Peter Anvin
Modified: 2007-11-30 17:10 EST (History)
2 users (show)

See Also:
Fixed In Version: 2.15.92.0.2-5
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-10-20 08:35:42 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description H. Peter Anvin 2004-10-12 23:22:46 EDT
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 10:14:17 EDT
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-19 20:57:59 EDT
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 08:35:42 EDT
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.