tag 628685 + patch
thanks
On Sun, Jun 05, 2011 at 05:40:15PM +0200, Aurelien Jarno wrote:
> On Tue, May 31, 2011 at 12:13:45PM +0200, Marco d'Itri wrote:
> > Package: binutils
> > Version: 2.21.51.20110421-3
> > Severity: critical
> >
> > ld reliably segfaults when building udev on mips/mipsel:
> >
> > https://buildd.debian.org/status/fetch.php?pkg=udev&arch=mips&ver=170-1&stamp=1306799134
> > https://buildd.debian.org/status/fetch.php?pkg=udev&arch=mipsel&ver=170-1&stamp=1306799800
> >
> > Reverting this commit fixes it:
> >
> > http://git.kernel.org/?p=linux/hotplug/udev.git;a=commitdiff;h=f0ed90b7678045759ffa2a44d2b4cac96968b077
> >
>
> A smaller workaround is to remove the -Wl,--gc-sections
>
This is the patch proposed by upstream, but it is not yet committed. It
looks reasonable, and I confirm it fixes the issue.
Index: ld/emultempl/mipself.em
===================================================================
RCS file: /cvs/src/src/ld/emultempl/mipself.em,v
retrieving revision 1.12
diff -u -3 -p -r1.12 mipself.em
--- ld/emultempl/mipself.em 4 Feb 2010 09:16:43 -0000 1.12
+++ ld/emultempl/mipself.em 8 Jun 2011 16:51:16 -0000
@@ -138,6 +138,11 @@ mips_add_stub_section (const char *stub_
lang_output_section_statement_type *os;
struct hook_stub_info info;
+ /* PR 12845: If the input section has been garbage collected it will
+ not have its output section set to *ABS*. */
+ if (bfd_is_abs_section (output_section))
+ return NULL;
+
/* Create the stub file, if we haven't already. */
if (stub_file == NULL)
{
Index: bfd/elf.c
===================================================================
RCS file: /cvs/src/src/bfd/elf.c,v
retrieving revision 1.538
diff -u -3 -p -r1.538 elf.c
--- bfd/elf.c 23 May 2011 05:41:00 -0000 1.538
+++ bfd/elf.c 8 Jun 2011 16:51:17 -0000
@@ -6272,6 +6272,8 @@ _bfd_elf_init_private_section_data (bfd
|| obfd->xvec->flavour != bfd_target_elf_flavour)
return TRUE;
+ BFD_ASSERT (elf_section_data (osec) != NULL);
+
/* For objcopy and relocatable link, don't copy the output ELF
section type from input if the output BFD section flags have been
set to something different. For a final link allow some flags
Index: bfd/elfxx-mips.c
===================================================================
RCS file: /cvs/src/src/bfd/elfxx-mips.c,v
retrieving revision 1.285
diff -u -3 -p -r1.285 elfxx-mips.c
--- bfd/elfxx-mips.c 3 Jun 2011 10:11:06 -0000 1.285
+++ bfd/elfxx-mips.c 8 Jun 2011 16:51:18 -0000
@@ -1727,6 +1727,11 @@ mips_elf_check_symbols (struct mips_elf_
if (mips_elf_local_pic_function_p (h))
{
+ /* PR 12845: If H is in a section that has been garbage
+ collected it will have its output section set to *ABS*. */
+ if (bfd_is_abs_section (h->root.root.u.def.section->output_section))
+ return TRUE;
+
/* H is a function that might need $25 to be valid on entry.
If we're creating a non-PIC relocatable object, mark H as
being PIC. If we're creating a non-relocatable object with
--
Aurelien Jarno GPG: 1024D/F1BCDB73
[email protected] http://www.aurel32.net
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]