summaryrefslogtreecommitdiff
path: root/bfd/elf32-cris.c
diff options
context:
space:
mode:
authorHans-Peter Nilsson <hp@axis.com>2009-01-27 06:07:54 +0000
committerHans-Peter Nilsson <hp@axis.com>2009-01-27 06:07:54 +0000
commit09a2991c77a4a51448e71d8bf8e598e71d89aed3 (patch)
treeb9ac85bc5688b2ba849e8626cd1d68fde8101627 /bfd/elf32-cris.c
parent6a9df4a207942236ff16afde9175031c298dc2e6 (diff)
downloadbinutils-redhat-09a2991c77a4a51448e71d8bf8e598e71d89aed3.tar.gz
* elf32-cris.c (cris_elf_relocate_section) <case R_CRIS_8>
<R_CRIS_16, R_CRIS_32>: Don't call BFD_ASSERT for weak undefined symbols with non-default visibility.
Diffstat (limited to 'bfd/elf32-cris.c')
-rw-r--r--bfd/elf32-cris.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/bfd/elf32-cris.c b/bfd/elf32-cris.c
index 4b59d33e03..6b71ee47b9 100644
--- a/bfd/elf32-cris.c
+++ b/bfd/elf32-cris.c
@@ -1528,7 +1528,16 @@ cris_elf_relocate_section (output_bfd, info, input_bfd, input_section,
rel->r_offset);
if (outrel.r_offset == (bfd_vma) -1)
skip = TRUE;
- else if (outrel.r_offset == (bfd_vma) -2)
+ else if (outrel.r_offset == (bfd_vma) -2
+ /* For now, undefined weak symbols with non-default
+ visibility (yielding 0), like exception info for
+ discarded sections, will get a R_CRIS_NONE
+ relocation rather than no relocation, because we
+ notice too late that the symbol doesn't need a
+ relocation. */
+ || (h != NULL
+ && h->root.type == bfd_link_hash_undefweak
+ && ELF_ST_VISIBILITY (h->other) != STV_DEFAULT))
skip = TRUE, relocate = TRUE;
outrel.r_offset += (input_section->output_section->vma
+ input_section->output_offset);