diff options
author | Alan Modra <amodra@gmail.com> | 2024-04-19 16:35:30 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2024-04-19 16:48:03 +0930 |
commit | 9cf3c87e166b2f3728ae5c50c501f64f385e349e (patch) | |
tree | 03d08e8144610c82a2b86d6a8ba6ee352e68899b /bfd | |
parent | eebad48efeeee858be83d754a6b1326133e51d36 (diff) | |
download | gdb-9cf3c87e166b2f3728ae5c50c501f64f385e349e.zip gdb-9cf3c87e166b2f3728ae5c50c501f64f385e349e.tar.gz gdb-9cf3c87e166b2f3728ae5c50c501f64f385e349e.tar.bz2 |
Re: elf: Strip unreferenced weak undefined symbols
PR ld/31652
* elflink.c (_bfd_elf_link_output_relocs): Don't segfault
on NULL rel_hash.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/elflink.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/bfd/elflink.c b/bfd/elflink.c index 4f72d1b..6db6a9c 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -2985,12 +2985,13 @@ _bfd_elf_link_output_relocs (bfd *output_bfd, * bed->s->int_rels_per_ext_rel); while (irela < irelaend) { - if (*rel_hash) + if (rel_hash && *rel_hash) (*rel_hash)->has_reloc = 1; (*swap_out) (output_bfd, irela, erel); irela += bed->s->int_rels_per_ext_rel; erel += input_rel_hdr->sh_entsize; - rel_hash++; + if (rel_hash) + rel_hash++; } /* Bump the counter, so that we know where to add the next set of |