aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2024-05-08 13:42:22 +0100
committerNick Clifton <nickc@redhat.com>2024-05-08 13:42:22 +0100
commit43bb6c0e087b6fd46c0b347d2b5678acb5c68c85 (patch)
tree485b57b3d632d36d2eb1759444f70a98e3768153 /bfd
parent2236c5e384de20b0dd6b2fbc964a7269027cb2d9 (diff)
downloadgdb-43bb6c0e087b6fd46c0b347d2b5678acb5c68c85.zip
gdb-43bb6c0e087b6fd46c0b347d2b5678acb5c68c85.tar.gz
gdb-43bb6c0e087b6fd46c0b347d2b5678acb5c68c85.tar.bz2
Fix RELOC_FOR_GLOBAL_SYMBOLS macro so that it can cope with user defined symbols that start with __wrap_.
PR 31710
Diffstat (limited to 'bfd')
-rw-r--r--bfd/elf-bfd.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h
index 92a0287..15a7156 100644
--- a/bfd/elf-bfd.h
+++ b/bfd/elf-bfd.h
@@ -3192,8 +3192,14 @@ extern asection _bfd_elf_large_com_section;
\
if (info->wrap_hash != NULL \
&& (input_section->flags & SEC_DEBUGGING) != 0) \
- h = ((struct elf_link_hash_entry *) \
- unwrap_hash_lookup (info, input_bfd, &h->root)); \
+ { \
+ struct bfd_link_hash_entry * new_h; \
+ new_h = unwrap_hash_lookup (info, input_bfd, &h->root); \
+ /* PR 31710: This lookup can fail if the input source has a \
+ symbol that starts with __wrap_. */ \
+ if (new_h != NULL) \
+ h = (struct elf_link_hash_entry *) new_h; \
+ } \
\
while (h->root.type == bfd_link_hash_indirect \
|| h->root.type == bfd_link_hash_warning) \