From: M R Swami Reddy Date: Wed, 9 Sep 2009 04:49:09 +0000 (+0000) Subject: 2009-09-09 M R Swami Reddy X-Git-Tag: gdb_7_0-2009-09-16-branchpoint~97 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1004c3e14acc32a219f141bca170b12174e57ab3;p=platform%2Fupstream%2Fbinutils.git 2009-09-09 M R Swami Reddy * elf32-cr16.c (elf32_cr16_relocate_section): Add code to discard the linkonce or linker script discarded section. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index b012276..9fd34c2 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2009-09-09 M R Swami Reddy + + * elf32-cr16.c (elf32_cr16_relocate_section): Add code to discard the + linkonce or linker script discarded section. + 2009-09-09 Alan Modra * elf32-xtensa.c (elf_xtensa_relax_section): Delete -r check. 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,