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

Davide Italiano via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 30 12:20:00 PDT 2015


On Mon, Sep 28, 2015 at 5:30 AM, Rafael EspĂ­ndola
<rafael.espindola at gmail.com> wrote:
>> +.globl _start
>> +_start:
>> +  adr x1,msg
>> +msg:  .asciz  "Hello, world\n"
>> +msgend:
>> +
>> +// R_AARCH64_ADR_PREL_LO21
>> +# CHECK: _start:
>> +# CHECK:   11000:       21 00 00 10     adr     x1, #4
>
> Please expand the comment a bit saying why this is the correct value.
>
> A trick being used in other tests is to name the section with the
> relocation name.
>
> Cheers,
> Rafael

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]


-- 
Davide

"There are no solved problems; there are only problems that are more
or less solved" -- Henri Poincare


More information about the llvm-commits mailing list