PR ld/12845
authorNick Clifton <nickc@redhat.com>
Thu, 9 Jun 2011 10:36:20 +0000 (10:36 +0000)
committerNick Clifton <nickc@redhat.com>
Thu, 9 Jun 2011 10:36:20 +0000 (10:36 +0000)
* elf.c (_bfd_elf_init_private_section_data): Add an assertion
that the output section has an allocated bfd_elf_section_data
structure.
* elfxx-mips.c (mips_elf_check_symbols): Do not create a stub for
symbols in sections that have been removed by garbage collection.

* emultempl/mipself.em (mips_add_stub_section): Do not add stubs
for sections that have been removed by garbage collection.

bfd/ChangeLog
bfd/elf.c
bfd/elfxx-mips.c
ld/ChangeLog
ld/emultempl/mipself.em

index 25fa50bf1defd6546230c0122e8cbe721cf2d22c..40abe45199407e4f5a56763f842b301961ced857 100644 (file)
@@ -1,3 +1,12 @@
+2011-06-09  Nick Clifton  <nickc@redhat.com>
+
+       PR ld/12845
+       * elf.c (_bfd_elf_init_private_section_data): Add an assertion
+       that the output section has an allocated bfd_elf_section_data
+       structure.
+       * elfxx-mips.c (mips_elf_check_symbols): Do not create a stub for
+       symbols in sections that have been removed by garbage collection.
+
 2011-06-08  H.J. Lu  <hongjiu.lu@intel.com>
 
        * elf64-x86-64.c (elf_x86_64_check_relocs): Allow R_X86_64_64
index 3d44ef8d2878d44a37e3ddb33b862c5cb92b4c8f..4664c583b717acfde76d370dcdb785404f6b23a8 100644 (file)
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -6272,6 +6272,8 @@ _bfd_elf_init_private_section_data (bfd *ibfd,
       || 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 5c4636a07b4b874878c8931a33918723edc3f903..d5f677fad5fb0edee592bf986a8fdc8b84eaf020 100644 (file)
@@ -1727,6 +1727,11 @@ mips_elf_check_symbols (struct mips_elf_link_hash_entry *h, void *data)
 
   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
index 6f804b9c6b455ab4e0b93da81d5119cd94276964..d5595c604eb4d24ad2386d7b42e5c329d4967213 100644 (file)
@@ -1,3 +1,9 @@
+2011-06-09  Nick Clifton  <nickc@redhat.com>
+
+       PR ld/12845
+       * emultempl/mipself.em (mips_add_stub_section): Do not add stubs
+       for sections that have been removed by garbage collection.
+
 2011-06-08  Alan Modra  <amodra@gmail.com>
 
        * ldlang.c (lang_one_common): Handle warning symbols.
index 7a13d4da0611065fee44dceb8714b67f4c02355b..ada07863213c7f0865406e88f1834d7199847650 100644 (file)
@@ -138,6 +138,11 @@ mips_add_stub_section (const char *stub_sec_name, asection *input_section,
   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)
     {
This page took 0.037361 seconds and 4 git commands to generate.