This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[committed] Don't sort parisc unwind data in a relocatable link
- From: "John David Anglin" <dave at hiauly1 dot hia dot nrc dot ca>
- To: binutils at sourceware dot org
- Date: Sun, 8 Nov 2009 15:54:52 -0500 (EST)
- Subject: [committed] Don't sort parisc unwind data in a relocatable link
This patch fixes a problem noticed in the unwind data generated for
the linux kernel. Sorting the unwind data when doing a ld -r link
scrambles the data.
Tested on hppa-unknown-linux-gnu and with a hppa64-unknown-linux-gnu
cross. Applied to trunk.
Dave
--
J. David Anglin dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6602)
2009-11-08 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
* elf32-hppa.c (elf32_hppa_final_link): Don't sort unwind information
in a relocatable link.
* elf64-hppa.c (elf_hppa_final_link): Likewise.
Index: elf32-hppa.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-hppa.c,v
retrieving revision 1.168
diff -u -3 -p -r1.168 elf32-hppa.c
--- elf32-hppa.c 18 Jun 2009 14:18:28 -0000 1.168
+++ elf32-hppa.c 2 Nov 2009 02:32:05 -0000
@@ -3238,6 +3238,9 @@ elf32_hppa_final_link (bfd *abfd, struct
/* If we're producing a final executable, sort the contents of the
unwind section. */
+ if (info->relocatable)
+ return TRUE;
+
return elf_hppa_sort_unwind (abfd);
}
Index: elf64-hppa.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-hppa.c,v
retrieving revision 1.92
diff -u -3 -p -r1.92 elf64-hppa.c
--- elf64-hppa.c 21 May 2009 14:15:49 -0000 1.92
+++ elf64-hppa.c 2 Nov 2009 02:32:05 -0000
@@ -3033,7 +3033,7 @@ elf_hppa_final_link (bfd *abfd, struct b
/* If we're producing a final executable, sort the contents of the
unwind section. */
- if (retval)
+ if (retval && !info->relocatable)
retval = elf_hppa_sort_unwind (abfd);
return retval;