summaryrefslogtreecommitdiff
path: root/bfd/elf-m10200.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/elf-m10200.c')
-rw-r--r--bfd/elf-m10200.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/bfd/elf-m10200.c b/bfd/elf-m10200.c
index a39e4389d0..e81db55da2 100644
--- a/bfd/elf-m10200.c
+++ b/bfd/elf-m10200.c
@@ -1,5 +1,5 @@
/* Matsushita 10200 specific support for 32-bit ELF
- Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
+ Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2007
Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -343,9 +343,6 @@ mn10200_elf_relocate_section (output_bfd, info, input_bfd, input_section,
struct elf_link_hash_entry **sym_hashes;
Elf_Internal_Rela *rel, *relend;
- if (info->relocatable)
- return TRUE;
-
symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
sym_hashes = elf_sym_hashes (input_bfd);
@@ -385,6 +382,20 @@ mn10200_elf_relocate_section (output_bfd, info, input_bfd, input_section,
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 = mn10200_elf_final_link_relocate (howto, input_bfd, output_bfd,
input_section,
contents, rel->r_offset,