aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-crx.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/elf32-crx.c')
-rw-r--r--bfd/elf32-crx.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/bfd/elf32-crx.c b/bfd/elf32-crx.c
index 3d62b74..438c1c2 100644
--- a/bfd/elf32-crx.c
+++ b/bfd/elf32-crx.c
@@ -1,5 +1,5 @@
/* BFD back-end for National Semiconductor's CRX ELF
- Copyright 2004, 2005, 2006 Free Software Foundation, Inc.
+ Copyright 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
Written by Tomer Levi, NSC, Israel.
This file is part of BFD, the Binary File Descriptor library.
@@ -821,9 +821,6 @@ elf32_crx_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
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);
@@ -863,6 +860,20 @@ elf32_crx_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 = crx_elf_final_link_relocate (howto, input_bfd, output_bfd,
input_section,
contents, rel->r_offset,