diff options
author | Nick Clifton <nickc@redhat.com> | 2022-03-01 09:51:59 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2022-03-01 09:51:59 +0000 |
commit | 81c9e0f6c48748f4b66fc3b13e12eb68735cf1f9 (patch) | |
tree | 89ce36891551616a96c358b5b5014466549e739c /bfd/elf32-arm.c | |
parent | 1dbf27133db434d1fb3e8e8bf9c3e402cc23a293 (diff) | |
download | gdb-81c9e0f6c48748f4b66fc3b13e12eb68735cf1f9.zip gdb-81c9e0f6c48748f4b66fc3b13e12eb68735cf1f9.tar.gz gdb-81c9e0f6c48748f4b66fc3b13e12eb68735cf1f9.tar.bz2 |
Prevent an assertion from being triggered when linking an ARM object file with incorrectly set build attributes.
PR 28848
PR 28859
* elf32-arm.c (elf32_arm_merge_eabi_attributes): If the first
input bfd has a Tag_ABI_HardFP_use set to 3 but does not also have
TAG_FP_arch set then reset the TAG_ABI_HardFP_use.
Diffstat (limited to 'bfd/elf32-arm.c')
-rw-r--r-- | bfd/elf32-arm.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c index 86da60e..616efe6 100644 --- a/bfd/elf32-arm.c +++ b/bfd/elf32-arm.c @@ -14523,6 +14523,14 @@ elf32_arm_merge_eabi_attributes (bfd *ibfd, struct bfd_link_info *info) out_attr[Tag_MPextension_use_legacy].i = 0; } + /* PR 28859 and 28848: Handle the case where the first input file, + eg crti.o, has a Tag_ABI_HardFP_use of 3 but no Tag_FP_arch set. + Using Tag_ABI_HardFP_use in this way is deprecated, so reset the + attribute to zero. + FIXME: Should we handle other non-zero values of Tag_ABI_HardFO_use ? */ + if (out_attr[Tag_ABI_HardFP_use].i == 3 && out_attr[Tag_FP_arch].i == 0) + out_attr[Tag_ABI_HardFP_use].i = 0; + return result; } |