gdb/
[deliverable/binutils-gdb.git] / gold / target-reloc.h
index 4cb331536fe132ba53ba273ed107ef4eed52be0a..04854d2d60eeb4d7f0ad480e54f53d6ece4f28eb 100644 (file)
@@ -83,7 +83,8 @@ scan_relocs(
          shndx = object->adjust_sym_shndx(r_sym, shndx, &is_ordinary);
          if (is_ordinary
              && shndx != elfcpp::SHN_UNDEF
-             && !object->is_section_included(shndx))
+             && !object->is_section_included(shndx)
+              && !symtab->is_section_folded(object, shndx))
            {
              // RELOC is a relocation against a local symbol in a
              // section we are discarding.  We can ignore this
@@ -102,7 +103,6 @@ scan_relocs(
 
              continue;
            }
-
          scan.local(symtab, layout, target, object, data_shndx,
                     output_section, reloc, r_type, lsym);
        }
@@ -279,7 +279,7 @@ relocate_section(
            }
 
          sym = static_cast<const Sized_symbol<size>*>(gsym);
-         if (sym->has_symtab_index())
+         if (sym->has_symtab_index() && sym->symtab_index() != -1U)
            symval.set_output_symtab_index(sym->symtab_index());
          else
            symval.set_no_output_symtab_entry();
@@ -491,6 +491,9 @@ scan_relocatable_relocs(
                  if (strategy != Relocatable_relocs::RELOC_DISCARD)
                     object->output_section(shndx)->set_needs_symtab_index();
                }
+
+             if (strategy == Relocatable_relocs::RELOC_COPY)
+               object->set_must_have_output_symtab_entry(r_sym);
            }
        }
 
This page took 0.023386 seconds and 4 git commands to generate.