LoongArch: Fix immediate overflow check bug
authormengqinggang <mengqinggang@loongson.cn>
Sat, 15 Jul 2023 09:56:07 +0000 (17:56 +0800)
committerliuzhensong <liuzhensong@loongson.cn>
Mon, 24 Jul 2023 03:22:42 +0000 (11:22 +0800)
commita38b0c05b6e9444d94e8a4dd090584a8dcc313ad
treea55071c4ec79c0a628bcb6cb16ef9354e373e96a
parent378535f277b31e28f74cc65df6876c616beb04b4
LoongArch: Fix immediate overflow check bug

For B16/B21/B26/PCREL20_S2 relocations, if immediate overflow check after
rightshift, and the mask need to include sign bit.

Now, the immediate overflow check before rightshift for easier understand.

bfd/ChangeLog:

* elfxx-loongarch.c (reloc_bits_pcrel20_s2): Delete.
(reloc_bits_b16): Delete.
(reloc_bits_b21): Delete.
(reloc_bits_b26): Delete.
(reloc_sign_bits): New.
bfd/elfxx-loongarch.c