[lld] r248679 - [ELF2/AArch64] Support for R_AARCH64_ADR_PREL_LO21 relocation.

Rafael EspĂ­ndola via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 30 12:24:58 PDT 2015


> Sorry for the late reply, I didn't have access to my dev machines in
> the past two days.
> What do you think about this (inlined) patch?
>
> Index: test/elf2/aarch64-relocs.s
> ===================================================================
> --- test/elf2/aarch64-relocs.s  (revision 248928)
> +++ test/elf2/aarch64-relocs.s  (working copy)
> @@ -3,6 +3,7 @@
>  # RUN: llvm-objdump -d %t2 | FileCheck %s
>  # REQUIRES: aarch64
>
> +.section .R_AARCH64_ADR_PREL_LO21,"ax", at progbits
>  .globl _start
>  _start:
>    adr x1,msg
> @@ -9,6 +10,8 @@
>  msg:  .asciz  "Hello, world\n"
>  msgend:
>
> -// R_AARCH64_ADR_PREL_LO21
> +# CHECK: Disassembly of section .R_AARCH64_ADR_PREL_LO21:
>  # CHECK: _start:
> -# CHECK:   11000:       21 00 00 10     adr     x1, #4
> +# CHECK:        0:       21 00 00 10     adr     x1, #4
> +# CHECK: msg:
> +# CHECK:        4:       48 65 6c 6c     ldnp    d8, d25, [x10, #-320]
>

Disassembling "Hello, world\n" is not that useful :-)

Just stop after the "4:" and say that you are testing that is the same
value that shows up in the adr.

Cheers,
Rafael


More information about the llvm-commits mailing list