]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
PR26422, ASAN: elf32_arm_final_link_relocate elf32-arm.c:10351
authorAlan Modra <amodra@gmail.com>
Tue, 25 Aug 2020 04:35:10 +0000 (14:05 +0930)
committerAlan Modra <amodra@gmail.com>
Tue, 25 Aug 2020 13:37:10 +0000 (23:07 +0930)
commitd2327e47ef26dc88192e07b53cbad0b768cecf2e
tree05701277805400bae3aac9cf640630a277f0df25
parentb8ff233b54d66c5dce5a6d1409fe57e7ea359f43
PR26422, ASAN: elf32_arm_final_link_relocate elf32-arm.c:10351

Always reading 32 bits in order to extract addends from instruction
fields is wrong when the field size is smaller.  It also leads to
reading past the end of the section.  This patch tidies that by
reading the proper field size, which allows some later refetching of
addends to disappear.

PR 26422
* elf32-arm.c (elf32_arm_final_link_relocate): Use the appropriate
bfd_get_x size function to read addends out of fields.  Apply
rightshift adjustment too.  Don't apply the now unnecessary
howto->size shift to branch REL addends.  Don't refetch R_ARM_ABS8
and R_ARM_ABS16 addends.  Don't refetch thumb branch addends.
Correct R_ARM_THM_JUMP6 addend.
bfd/ChangeLog
bfd/elf32-arm.c