llvm.org GIT mirror llvm / 2d0a1dd
RuntimeDyldELF: implement R_AARCH64_PREL64 reloc Differential revision: https://reviews.llvm.org/D28122 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291558 91177308-0d34-0410-b5e6-96231b3b80d8 Eugene Leviant 3 years ago
3 changed file(s) with 12 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
373373 write(isBE, TargetPtr, static_cast(Result & 0xffffffffU));
374374 break;
375375 }
376 case ELF::R_AARCH64_PREL64:
377 write(isBE, TargetPtr, Value + Addend - FinalAddress);
378 break;
376379 case ELF::R_AARCH64_CALL26: // fallthrough
377380 case ELF::R_AARCH64_JUMP26: {
378381 // Operation: S+A-P. Set Call or B immediate value to bits fff_fffc of the
3232 r:
3333 # R_AARCH64_PREL32: use Q instead of f to fit in 32 bits.
3434 .word Q - .
35 # R_AARCH64_PREL64
36 .p2align 3
37 .xword f - .
3538
3639 # LE instructions read as BE
3740 # rtdyld-check: *{4}(g) = 0x6024e0d2
4043 # rtdyld-check: *{4}(g + 12) = 0xe0bd99f2
4144 # rtdyld-check: *{8}k = f
4245 # rtdyld-check: *{4}r = (Q - r)[31:0]
46 # rtdyld-check: *{8}(r + 8) = f - r - 8
4646 .size k, 16
4747 r:
4848 # R_AARCH64_PREL32: use Q instead of f to fit in 32 bits.
49 .word Q - .
49 .word Q - .
50 # R_AARCH64_PREL64
51 .p2align 3
52 .xword f - .
5053
5154 # rtdyld-check: *{4}(g) = 0xd2e02460
5255 # rtdyld-check: *{4}(g + 4) = 0xf2c8ace0
6467
6568 # rtdyld-check: *{8}k = f
6669 # rtdyld-check: *{4}r = (Q - r)[31:0]
70 # rtdyld-check: *{8}(r + 8) = f - r - 8
6771
6872 ## f & 0xFFF = 0xdef (bits 11:0 of f)
6973 ## 0xdef << 10 = 0x37bc00