aboutsummaryrefslogtreecommitdiff
path: root/gold/target-reloc.h
diff options
context:
space:
mode:
Diffstat (limited to 'gold/target-reloc.h')
-rw-r--r--gold/target-reloc.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/gold/target-reloc.h b/gold/target-reloc.h
index bc4d1ba..25b3ac4 100644
--- a/gold/target-reloc.h
+++ b/gold/target-reloc.h
@@ -503,8 +503,13 @@ relocate_for_relocatable(
switch (strategy)
{
case Relocatable_relocs::RELOC_COPY:
- new_symndx = object->symtab_index(r_sym);
- gold_assert(new_symndx != -1U);
+ if (r_sym == 0)
+ new_symndx = 0;
+ else
+ {
+ new_symndx = object->symtab_index(r_sym);
+ gold_assert(new_symndx != -1U);
+ }
break;
case Relocatable_relocs::RELOC_ADJUST_FOR_SECTION_RELA: