llvm.org GIT mirror llvm / ece7697
RuntimeDyldELF: add LDST8_ABS_LO12_NC and LDST16_ABS_LO12_NC relocs Differential revision: https://reviews.llvm.org/D28863 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292785 91177308-0d34-0410-b5e6-96231b3b80d8 Eugene Leviant 3 years ago
2 changed file(s) with 22 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
417417 // Immediate goes in bits 21:10 of LD/ST instruction, taken
418418 // from bits 11:0 of X
419419 or32AArch64Imm(TargetPtr, Value + Addend);
420 break;
421 case ELF::R_AARCH64_LDST8_ABS_LO12_NC:
422 // Operation: S + A
423 // Immediate goes in bits 21:10 of LD/ST instruction, taken
424 // from bits 11:0 of X
425 or32AArch64Imm(TargetPtr, getBits(Value + Addend, 0, 11));
426 break;
427 case ELF::R_AARCH64_LDST16_ABS_LO12_NC:
428 // Operation: S + A
429 // Immediate goes in bits 21:10 of LD/ST instruction, taken
430 // from bits 11:1 of X
431 or32AArch64Imm(TargetPtr, getBits(Value + Addend, 1, 11));
420432 break;
421433 case ELF::R_AARCH64_LDST32_ABS_LO12_NC:
422434 // Operation: S + A
899911 }
900912
901913 // Sometimes we don't need to create thunk for a branch.
902 // This typically happens when branch target is located
914 // This typically happens when branch target is located
903915 // in the same object file. In such case target is either
904916 // a weak symbol or symbol in a different executable section.
905917 // This function checks if branch target is located in the
1919 # R_AARCH64_MOVW_UABS_G0_NC
2020 movk x0, #:abs_g0_nc:f
2121 l:
22 # R_AARCH64_LDST8_ABS_LO12_NC
23 ldrsb x4, [x5, :lo12:a+1]
24 # R_AARCH64_LDST16_ABS_LO12_NC
25 ldrh w4, [x5, :lo12:a+2]
2226 # R_AARCH64_LDST32_ABS_LO12_NC
2327 ldr s4, [x5, :lo12:a]
2428 # R_AARCH64_LDST64_ABS_LO12_NC
5660 # rtdyld-check: *{4}(g + 8) = 0xf2b13560
5761 # rtdyld-check: *{4}(g + 12) = 0xf299bde0
5862
59 ## Check LDST32_ABS_LO12_NC and LDST64_ABS_LO12_NC
60 # rtdyld-check: (*{4}l)[21:10] = a[11:2]
61 # rtdyld-check: (*{4}(l+4))[21:10] = a[11:3]
63 ## Check LDSTXX_ABS_LO12_NC
64 # rtdyld-check: (*{4}l)[21:10] = (a+1)[11:0]
65 # rtdyld-check: (*{4}(l+4))[21:10] = (a+2)[11:1]
66 # rtdyld-check: (*{4}(l+8))[21:10] = a[11:2]
67 # rtdyld-check: (*{4}(l+12))[21:10] = a[11:3]
6268
6369 ## Check ADR_PREL_PG_HI21. Low order bits of immediate value
6470 ## go to bits 30:29. High order bits go to bits 23:5