* elf.c (_bfd_elf_rela_local_sym): New.
[deliverable/binutils-gdb.git] / bfd / elflink.h
index da0021ccefe907932394c0f2d881f5181a8dac0a..26b28f2e53d1fb5a2197232c9083d38af5a37046 100644 (file)
@@ -6317,7 +6317,9 @@ elf_link_input_bfd (finfo, input_bfd)
                           || h->root.type == bfd_link_hash_defweak)
                          && ! bfd_is_abs_section (h->root.u.def.section)
                          && bfd_is_abs_section (h->root.u.def.section
-                                                ->output_section))
+                                                ->output_section)
+                         && elf_section_data (h->root.u.def.section)->merge_info
+                            == NULL)
                        {
 #if BFD_VERSION_DATE < 20031005
                          if ((o->flags & SEC_DEBUGGING) != 0)
@@ -6328,6 +6330,7 @@ elf_link_input_bfd (finfo, input_bfd)
                                 _("warning: relocation against removed section; zeroing"),
                                 NULL, input_bfd, o, rel->r_offset);
 #endif
+                             BFD_ASSERT (r_symndx != 0);
                              memset (rel, 0, sizeof (*rel));
                            }
                          else
@@ -6347,7 +6350,8 @@ elf_link_input_bfd (finfo, input_bfd)
 
                      if (sec != NULL
                          && ! bfd_is_abs_section (sec)
-                         && bfd_is_abs_section (sec->output_section))
+                         && bfd_is_abs_section (sec->output_section)
+                         && elf_section_data (sec)->merge_info == NULL)
                        {
 #if BFD_VERSION_DATE < 20031005
                          if ((o->flags & SEC_DEBUGGING) != 0
@@ -6359,6 +6363,7 @@ elf_link_input_bfd (finfo, input_bfd)
                                 _("warning: relocation against removed section"),
                                 NULL, input_bfd, o, rel->r_offset);
 #endif
+                             BFD_ASSERT (r_symndx != 0);
                              rel->r_info
                                = ELF_R_INFO (0, ELF_R_TYPE (rel->r_info));
                              rel->r_addend = 0;
@@ -7811,7 +7816,7 @@ elf_reloc_symbol_deleted_p (offset, cookie)
       else if (rcookie->locsyms)
        {
          /* It's not a relocation against a global symbol,
-            but it could be a relocation against a section
+            but it could be a relocation against a local
             symbol for a discarded section.  */
          asection *isec;
 
@@ -7820,7 +7825,6 @@ elf_reloc_symbol_deleted_p (offset, cookie)
            {
              isec = section_from_elf_index (rcookie->abfd, isym.st_shndx);
              if (isec != NULL
-                 && ELF_ST_TYPE (isym.st_info) == STT_SECTION
                  && ! bfd_is_abs_section (isec)
                  && bfd_is_abs_section (isec->output_section))
                return true;
This page took 0.027547 seconds and 4 git commands to generate.