[PATCH v2 2/2] LoongArch: ld: Fix other pop relocs overflow check and add tests

Jinyang He hejinyang@loongson.cn
Mon Sep 4 02:24:47 GMT 2023


On 2023-09-04 09:26, liuzhensong wrote:

[...]
>>       bfd_signed_vma mask = ((bfd_signed_vma)0x1 << (howto->bitsize
>> -              + howto->rightshift - 1)) - 1;
>> +              + howto->rightshift - sign)) - 1;
>
>   Is safe to compute  howto->rightshift(unsigned int) and sign(bool)?

That looks confused when I see from stdbool.h that the definition
of bool value is always 0 or 1. Just to be safe, I'll pass "sign" in an
unsigned int type, in the next version.

[...]



More information about the Binutils mailing list