diff options
author | Nick Clifton <nickc@redhat.com> | 2020-08-21 15:32:20 +0100 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2020-08-21 15:32:20 +0100 |
commit | ccf61261eb8cce869ae4452de547a5f3afb074e4 (patch) | |
tree | 1f084a53751b79a65fb94a37f80ef74084c76c86 /bfd/elfnn-aarch64.c | |
parent | 02391b8be4fcb3366c23ed53e7e9aaeef734f78d (diff) | |
download | gdb-ccf61261eb8cce869ae4452de547a5f3afb074e4.zip gdb-ccf61261eb8cce869ae4452de547a5f3afb074e4.tar.gz gdb-ccf61261eb8cce869ae4452de547a5f3afb074e4.tar.bz2 |
Fix problems with the AArch64 linker exposed by testing it with sanitization enabled.
bfd * elfnn-aarch64.c (_bfd_aarch64_erratum_835769_scan): Only sort
the data map if there are entries in it.
(_bfd_aarch64_erratum_843419_scan): Likewise.
opcodes * aarch64-dis.c (get_sym_code_type): Return FALSE for non-ELF
symbols.
Diffstat (limited to 'bfd/elfnn-aarch64.c')
-rw-r--r-- | bfd/elfnn-aarch64.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/bfd/elfnn-aarch64.c b/bfd/elfnn-aarch64.c index a1c8887..9b0b51b 100644 --- a/bfd/elfnn-aarch64.c +++ b/bfd/elfnn-aarch64.c @@ -3925,8 +3925,9 @@ _bfd_aarch64_erratum_835769_scan (bfd *input_bfd, sec_data = elf_aarch64_section_data (section); - qsort (sec_data->map, sec_data->mapcount, - sizeof (elf_aarch64_section_map), elf_aarch64_compare_mapping); + if (sec_data->mapcount) + qsort (sec_data->map, sec_data->mapcount, + sizeof (elf_aarch64_section_map), elf_aarch64_compare_mapping); for (span = 0; span < sec_data->mapcount; span++) { @@ -4209,8 +4210,9 @@ _bfd_aarch64_erratum_843419_scan (bfd *input_bfd, asection *section, sec_data = elf_aarch64_section_data (section); - qsort (sec_data->map, sec_data->mapcount, - sizeof (elf_aarch64_section_map), elf_aarch64_compare_mapping); + if (sec_data->mapcount) + qsort (sec_data->map, sec_data->mapcount, + sizeof (elf_aarch64_section_map), elf_aarch64_compare_mapping); for (span = 0; span < sec_data->mapcount; span++) { |