aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-cris.c
diff options
context:
space:
mode:
authorHans-Peter Nilsson <hp@axis.com>2003-06-18 04:14:14 +0000
committerHans-Peter Nilsson <hp@axis.com>2003-06-18 04:14:14 +0000
commit3dab95d3244ea1c94115fb3a5bad35453fe41f59 (patch)
tree245dddd49a9fb6ff8dbdcadf82417209a2ec6c22 /bfd/elf32-cris.c
parentc1f1974625af0ad7b16ff92590a2665eb1b0e69d (diff)
downloadgdb-3dab95d3244ea1c94115fb3a5bad35453fe41f59.zip
gdb-3dab95d3244ea1c94115fb3a5bad35453fe41f59.tar.gz
gdb-3dab95d3244ea1c94115fb3a5bad35453fe41f59.tar.bz2
* elf32-cris.c (cris_elf_relocate_section) <case
R_CRIS_32_GOTREL>: When linking a program, don't complain about a symbol from a normal object or an undefined weak symbol.
Diffstat (limited to 'bfd/elf32-cris.c')
-rw-r--r--bfd/elf32-cris.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/bfd/elf32-cris.c b/bfd/elf32-cris.c
index 40327b6..1d278a0 100644
--- a/bfd/elf32-cris.c
+++ b/bfd/elf32-cris.c
@@ -1129,8 +1129,15 @@ cris_elf_relocate_section (output_bfd, info, input_bfd, input_section,
break;
case R_CRIS_32_GOTREL:
- /* This relocation must only be performed against local symbols. */
- if (h != NULL && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
+ /* This relocation must only be performed against local symbols.
+ It's also ok when we link a program and the symbol is either
+ defined in an ordinary (non-DSO) object or is undefined weak. */
+ if (h != NULL
+ && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
+ && !(!info->shared
+ && ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0
+ || ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0
+ && h->root.type == bfd_link_hash_undefweak))))
{
(*_bfd_error_handler)
(_("%s: relocation %s is not allowed for global symbol: `%s' from %s section"),