Bug 15405 - "ld -r" breaking on IA64
"ld -r" breaking on IA64
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: egcs64 (Show other bugs)
6.2
ia64 Linux
high Severity high
: ---
: ---
Assigned To: Jakub Jelinek
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-08-04 12:12 EDT by Rob Gjertsen
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-08-04 12:12:23 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Rob Gjertsen 2000-08-04 12:12:22 EDT
I hope this is the right category.

This is a bug I've encounterd when running the linkage editor, ld, provided
by the Red Hat tools group (Cygnus). I am currently running TurboLinux on
IA64, but this should work on either TurboLinux or Redhat. I guess you are
probably
going to tell me that I should be running Red Hat instead.

Environment: Linux IA64 SMP, using TurboLinux 0505 environment with gnu
toolchain from 0714 (this breaks with 0505 gnu toolchain)
Running ld built from src: GNU ld version 2.9-ia64-000216-final (with BFD
2.9-ia64-000216-final)

I've grabbed the source for the Cygnus tools set and recompiled ld/bfd with
debugging so I can see where it is breaking, but not sure why yet. I notice
that if I
remove some "extraneous" header includes then "ld -r" will work; of course
this works
fine for toy stuff. I've included full bug report details below.

--------------------------------------------------------
Environment: Linux IA64 SMP, using Turbolinux 0505 environment with gnu
toolchain from
0714
Running ld built from src: GNU ld version 2.9-ia64-000216-final (with BFD
2.9-ia64-000216-final)

Command: ld -r -o mmfslinux gplInit.ko file.ko

Output:
Program received signal SIGSEGV, Segmentation fault.
0x400000000007f571 in bfd_elf64_bfd_final_link ()
          
Gdb info:
(gdb) backtrace
#0  0x400000000007f571 in bfd_elf64_bfd_final_link ()
#1  0x400000000006a850 in elf64_ia64_final_link ()
#2  0x400000000002efe0 in ldwrite () 
#3  0x40000000000275d0 in main ()
#4  0x2000000000078820 in __libc_start_main () from /lib/libc.so.0
#5  0x4000000000002bd0 in _start ()
#6  0x400000000007f570 in bfd_elf64_bfd_final_link ()

Gdb indicates that this is dying in elf_bfd_final_link in elflink.h, line
4108,
where esdo ends up with a null pointer.

              esdo->rel_count += (esdi->rel_hdr.sh_size
                                  / esdi->rel_hdr.sh_entsize);

Not sure how concerned I should be by the comment in elflink.h, line 4259,
about
relocatable linking.

Temporary fix that actually seems to "work" (in sense that ld doesn't blow
up now):
Put in check to make sure (output_section->used_by_bfd != NULL)

[gjertsen@clue5 bfd]$ diff elflink.h.ORG elflink.h
4107a4108,4110
>               /* add in new check */
>               if (output_section->used_by_bfd)
>               {
4112a4116
>               }
Comment 1 Preston Brown 2001-05-21 11:09:58 EDT
this is fixed in current versions.

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