[LLD][ELF] Fix --check-dynamic-relocations for 32-bit targets
authorAndrew Ng <andrew.ng@sony.com>
Wed, 26 Apr 2023 09:18:04 +0000 (10:18 +0100)
committerAndrew Ng <andrew.ng@sony.com>
Wed, 3 May 2023 09:50:32 +0000 (10:50 +0100)
commited5dd8e5f0fb6ca4af26adcb6193a9d9106eb36a
treec97b5c5c655cff7d298015358880fd24a87e1ab6
parentc68e92d941723702810093161be4834f3ca68372
[LLD][ELF] Fix --check-dynamic-relocations for 32-bit targets

OutputSection::checkDynRelAddends() incorrectly reports an internal
linker error for large addends on 32-bit targets. This is caused by the
lack of sign extension in DynamicReloc::computeAddend() for 32-bit
addends.

Differential Revision: https://reviews.llvm.org/D149347
lld/ELF/SyntheticSections.cpp
lld/test/ELF/arm-pie-relative.s