daily update
[deliverable/binutils-gdb.git] / bfd / elf-eh-frame.c
index 7151a397635c583d7830959238184e8205d9c334..3567c240684b968e1f71f737fc122f07a761f19d 100644 (file)
@@ -766,9 +766,14 @@ _bfd_elf_parse_eh_frame (bfd *abfd, struct bfd_link_info *info,
 
          /* Chain together the FDEs for each section.  */
          rsec = _bfd_elf_gc_mark_rsec (info, sec, gc_mark_hook, cookie);
-         REQUIRE (rsec && rsec->owner == abfd);
-         this_inf->u.fde.next_for_section = elf_fde_list (rsec);
-         elf_fde_list (rsec) = this_inf;
+         /* RSEC will be NULL if FDE was cleared out as it was belonging to
+            a discarded SHT_GROUP.  */
+         if (rsec)
+           {
+             REQUIRE (rsec->owner == abfd);
+             this_inf->u.fde.next_for_section = elf_fde_list (rsec);
+             elf_fde_list (rsec) = this_inf;
+           }
 
          /* Skip the initial location and address range.  */
          start = buf;
@@ -801,6 +806,16 @@ _bfd_elf_parse_eh_frame (bfd *abfd, struct bfd_link_info *info,
          insns = buf;
 
          buf = last_fde + 4 + hdr_length;
+
+         /* For NULL RSEC (cleared FDE belonging to a discarded section)
+            the relocations are commonly cleared.  We do not sanity check if
+            all these relocations are cleared as (1) relocations to
+            .gcc_except_table will remain uncleared (they will get dropped
+            with the drop of this unused FDE) and (2) BFD already safely drops
+            relocations of any type to .eh_frame by
+            elf_section_ignore_discarded_relocs.
+            TODO: The .gcc_except_table entries should be also filtered as
+            .eh_frame entries; or GCC could rather use COMDAT for them.  */
          SKIP_RELOCS (buf);
        }
 
This page took 0.023571 seconds and 4 git commands to generate.