aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-cr16.c
diff options
context:
space:
mode:
authorM R Swami Reddy <MR.Swami.Reddy@nsc.com>2009-09-09 04:49:09 +0000
committerM R Swami Reddy <MR.Swami.Reddy@nsc.com>2009-09-09 04:49:09 +0000
commit1004c3e14acc32a219f141bca170b12174e57ab3 (patch)
tree4af38736225552af4c0f57d0cf941d7b8a044181 /bfd/elf32-cr16.c
parent498199fc743408eb0e6bf6ad326409c5b3fd64a3 (diff)
downloadgdb-1004c3e14acc32a219f141bca170b12174e57ab3.zip
gdb-1004c3e14acc32a219f141bca170b12174e57ab3.tar.gz
gdb-1004c3e14acc32a219f141bca170b12174e57ab3.tar.bz2
2009-09-09 M R Swami Reddy <MR.Swami.Reddy@nsc.com>
* elf32-cr16.c (elf32_cr16_relocate_section): Add code to discard the linkonce or linker script discarded section.
Diffstat (limited to 'bfd/elf32-cr16.c')
-rw-r--r--bfd/elf32-cr16.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/bfd/elf32-cr16.c b/bfd/elf32-cr16.c
index f5e561e..17be1ff 100644
--- a/bfd/elf32-cr16.c
+++ b/bfd/elf32-cr16.c
@@ -1473,6 +1473,20 @@ elf32_cr16_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
unresolved_reloc, warned);
}
+ if (sec != NULL && elf_discarded_section (sec))
+ {
+ /* For relocs against symbols from removed linkonce sections,
+ or sections discarded by a linker script, we just want the
+ section contents zeroed. Avoid any special processing. */
+ _bfd_clear_contents (howto, input_bfd, contents + rel->r_offset);
+ rel->r_info = 0;
+ rel->r_addend = 0;
+ continue;
+ }
+
+ if (info->relocatable)
+ continue;
+
r = cr16_elf_final_link_relocate (howto, input_bfd, output_bfd,
input_section,
contents, rel->r_offset,