diff options
author | Alan Modra <amodra@gmail.com> | 2019-08-29 00:20:46 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2019-08-29 00:33:49 +0930 |
commit | a78fca7b57c5444ac23110c6d0f80abd966f0e90 (patch) | |
tree | a2712e6a0e7279e0c8ef16ddd7e8f729ce45b1bc | |
parent | 8ae0786c30a3a8d846994d0a6e7a00646f0bcd20 (diff) | |
download | gdb-a78fca7b57c5444ac23110c6d0f80abd966f0e90.zip gdb-a78fca7b57c5444ac23110c6d0f80abd966f0e90.tar.gz gdb-a78fca7b57c5444ac23110c6d0f80abd966f0e90.tar.bz2 |
Segfault in ld building SPEC CPU2017 527.cam4_r with -flto
Caused by the PR24406 fix. unwrap_hash_lookup shouldn't be called
with link_info.wrap_hash NULL.
PR ld/24406
* plugin.c (get_symbols): Test link_info.wrap_hash before calling
unwrap_hash_lookup.
-rw-r--r-- | ld/ChangeLog | 6 | ||||
-rw-r--r-- | ld/plugin.c | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index ed646ac..b654eb9 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,9 @@ +2019-08-29 Alan Modra <amodra@gmail.com> + + PR ld/24406 + * plugin.c (get_symbols): Test link_info.wrap_hash before calling + unwrap_hash_lookup. + 2019-08-22 Tamar Christina <tamar.christina@arm.com> PR ld/24601 diff --git a/ld/plugin.c b/ld/plugin.c index 0344da2..47e5cea 100644 --- a/ld/plugin.c +++ b/ld/plugin.c @@ -749,7 +749,7 @@ get_symbols (const void *handle, int nsyms, struct ld_plugin_symbol *syms, if (syms[n].def != LDPK_UNDEF && syms[n].def != LDPK_WEAKUNDEF) { blhe = h; - if (blhe) + if (blhe && link_info.wrap_hash != NULL) { /* Check if a symbol is a wrapper symbol. */ struct bfd_link_hash_entry *unwrap |