aboutsummaryrefslogtreecommitdiff
path: root/gold/target-reloc.h
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2009-12-30 20:35:52 +0000
committerIan Lance Taylor <ian@airs.com>2009-12-30 20:35:52 +0000
commit818bf354a7114bb7116f07c0d187fbe6c9c15c31 (patch)
treea4ce04c39146c1ce5f8ad72e0dbe50e864706beb /gold/target-reloc.h
parentebcc83046fa1227ac895ae9a2d715b547d62ad08 (diff)
downloadgdb-818bf354a7114bb7116f07c0d187fbe6c9c15c31.zip
gdb-818bf354a7114bb7116f07c0d187fbe6c9c15c31.tar.gz
gdb-818bf354a7114bb7116f07c0d187fbe6c9c15c31.tar.bz2
PR 10843
* target-reloc.h (relocate_for_relocatable): When copying a reloc, if the input symbol index is 0, make the output symbol index 0.
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: