From 818bf354a7114bb7116f07c0d187fbe6c9c15c31 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 30 Dec 2009 20:35:52 +0000 Subject: [PATCH] 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. --- gold/ChangeLog | 6 ++++++ gold/target-reloc.h | 9 +++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/gold/ChangeLog b/gold/ChangeLog index ea16c7a0612..3dd3280dab7 100644 --- a/gold/ChangeLog +++ b/gold/ChangeLog @@ -1,3 +1,9 @@ +2009-12-30 Ian Lance Taylor + + 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. + 2009-12-30 Ian Lance Taylor PR 10670 diff --git a/gold/target-reloc.h b/gold/target-reloc.h index bc4d1ba1c10..25b3ac43532 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: -- 2.30.2