[PATCH] D38053: [AArch64] Implement R_AARCH64_ LD_PREL_LO19

Davide Italiano via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 20 16:52:30 PDT 2017


On Wed, Sep 20, 2017 at 2:26 AM, Peter Smith via Phabricator
<reviews at reviews.llvm.org> wrote:
> peter.smith added a comment.
>
> Only thing I can spot is that I think that we are missing an alignment check on the result, otherwise looks good to me as well. The address of the value to be loaded must be at least 4-byte aligned. BFD has implemented this check, for example if I change the test case a little:
>
>   ldr x8, patatino
>
>           .data
>           .zero 5
>   patatino:
>
> BFD will give me t.o:(.text+0x0): relocation truncated to fit: R_AARCH64_LD_PREL_LO19 against `.data', which is BFD's rather obtuse way of reporting alignment faults. The target of the conditional branch (R_AARCH64_CONDBR19) must be an instruction, which must be 4 byte aligned for AArch64, so I think it is safe to add a check for that as well. It is harder to write a realistic test case for that one though.
>
> You can find the details of the instruction ldr (literal) in the architecture reference manual https://developer.arm.com/products/architecture/a-profile/docs/ddi0487/latest/arm-architecture-reference-manual-armv8-for-armv8-a-architecture-profile
>
Thanks, I'll handle this in a follow up commit.


More information about the llvm-commits mailing list