From: Alan Modra Date: Wed, 26 Aug 2020 10:50:11 +0000 (+0930) Subject: PR26506 UBSAN: elf32-xtensa.c:3203 null pointer memcpy X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=252e57fdd41118855f67ada7785b4ce3d5e61ad3;p=binutils-gdb.git PR26506 UBSAN: elf32-xtensa.c:3203 null pointer memcpy PR 26506 * elf32-xtensa.c (elf_xtensa_combine_prop_entries): Return early when section is empty. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 1cd7943abc3..765188d303c 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,9 @@ +2020-08-26 Alan Modra + + PR 26506 + * elf32-xtensa.c (elf_xtensa_combine_prop_entries): Return early + when section is empty. + 2020-08-26 Alan Modra PR 26498 diff --git a/bfd/elf32-xtensa.c b/bfd/elf32-xtensa.c index 65c6ceb3794..5184fbf1be7 100644 --- a/bfd/elf32-xtensa.c +++ b/bfd/elf32-xtensa.c @@ -3117,6 +3117,9 @@ elf_xtensa_combine_prop_entries (bfd *output_bfd, int n, m, num; section_size = sxtlit->size; + if (section_size == 0) + return 0; + BFD_ASSERT (section_size % 8 == 0); num = section_size / 8;