diff options
author | Alan Modra <amodra@gmail.com> | 2021-03-30 13:03:30 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2021-03-30 13:47:18 +1030 |
commit | d1cbe0076a4b6442793121413a0d3b52ae19727e (patch) | |
tree | 0667f272160801b631e8adda6e70729acdc0f164 | |
parent | 0af4fcc25dd5e2f98698da03396084258ebfb756 (diff) | |
download | gdb-d1cbe0076a4b6442793121413a0d3b52ae19727e.zip gdb-d1cbe0076a4b6442793121413a0d3b52ae19727e.tar.gz gdb-d1cbe0076a4b6442793121413a0d3b52ae19727e.tar.bz2 |
asan: linker.c:2294:8: runtime error: load of value 253
Seen after converting bfd_boolean to bool.
mmix +FAIL: ld-mmix/zeroehmmo
./ld-new -L/home/alan/src/binutils-gdb/ld/testsuite/ld-mmix -m mmo -Ttext 0xa00 -T /home/alan/src/binutils-gdb/ld/testsuite/ld-mmix/zeroeh.ld -o tmpdir/dump tmpdir/x.o tmpdir/y.o
/home/alan/src/binutils-gdb/bfd/linker.c:2294:8: runtime error: load of value 253, which is not a valid value for type '_Bool'
* elflink.c (elf_link_add_object_symbols): Don't set h->indx
unless is_elf_hash_table.
-rw-r--r-- | bfd/ChangeLog | 5 | ||||
-rw-r--r-- | bfd/elflink.c | 6 |
2 files changed, 8 insertions, 3 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 6d361d5..a94223d 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2021-03-30 Alan Modra <amodra@gmail.com> + + * elflink.c (elf_link_add_object_symbols): Don't set h->indx + unless is_elf_hash_table. + 2021-03-29 Alan Modra <amodra@gmail.com> * aoutx.h (aout_link_write_symbols): Don't cast boolean expression diff --git a/bfd/elflink.c b/bfd/elflink.c index 6be14e7..c7102e6 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -4968,13 +4968,13 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info) || h->root.type == bfd_link_hash_warning) h = (struct elf_link_hash_entry *) h->root.u.i.link; + *sym_hash = h; + /* Setting the index to -3 tells elf_link_output_extsym that this symbol is defined in a discarded section. */ - if (discarded) + if (discarded && is_elf_hash_table (htab)) h->indx = -3; - *sym_hash = h; - new_weak = (flags & BSF_WEAK) != 0; if (dynamic && definition |