aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-xtensa.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/elf32-xtensa.c')
-rw-r--r--bfd/elf32-xtensa.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/bfd/elf32-xtensa.c b/bfd/elf32-xtensa.c
index 34f7f47..59ed4ba 100644
--- a/bfd/elf32-xtensa.c
+++ b/bfd/elf32-xtensa.c
@@ -2270,6 +2270,16 @@ elf_xtensa_relocate_section (bfd *output_bfd,
return FALSE;
}
+ if (r_symndx == 0)
+ {
+ /* r_symndx will be zero only for relocs against symbols from
+ removed linkonce sections, or sections discarded by a linker
+ script. For these relocs, we just want the section contents
+ zeroed. Avoid any special processing. */
+ _bfd_clear_contents (howto, input_bfd, contents + rel->r_offset);
+ continue;
+ }
+
/* There's no point in calling bfd_perform_relocation here.
Just go directly to our "special function". */
r = elf_xtensa_do_reloc (howto, input_bfd, input_section,