llvm.org GIT mirror llvm / 9b804c5
RuntimeDyldELF: add R_AARCH64_ADD_ABS_LO12_NC reloc Differential revision: https://reviews.llvm.org/D28115 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290598 91177308-0d34-0410-b5e6-96231b3b80d8 Eugene Leviant 3 years ago
2 changed file(s) with 16 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
450450 TargetValue |= ((Result & 0x3000U) << (29 - 12));
451451 TargetValue |= ((Result & 0x1ffffc000ULL) >> (14 - 5));
452452 support::ulittle32_t::ref{TargetPtr} = TargetValue;
453 break;
454 }
455 case ELF::R_AARCH64_ADD_ABS_LO12_NC: {
456 // Operation: S + A
457 uint64_t Result = Value + Addend;
458
459 // Immediate goes in bits 21:10 of LD/ST instruction, taken
460 // from bits 11:0 of X
461 *TargetPtr |= ((Result & 0xfff) << 10);
453462 break;
454463 }
455464 case ELF::R_AARCH64_LDST32_ABS_LO12_NC: {
1313 movk x0, #:abs_g1_nc:f
1414 # R_AARCH64_MOVW_UABS_G0_NC
1515 movk x0, #:abs_g0_nc:f
16 a:
17 # R_AARCH64_ADD_ABS_LO12_NC
18 add x0, x0, :lo12:f
1619 ret
1720 .Lfunc_end0:
1821 .size g, .Lfunc_end0-g
3033 # rtdyld-check: *{4}(g + 8) = 0xf2b13560
3134 # rtdyld-check: *{4}(g + 12) = 0xf299bde0
3235 # rtdyld-check: *{8}k = f
36
37 ## f & 0xFFF = 0xdef (bits 11:0 of f)
38 ## 0xdef << 10 = 0x37bc00
39 # rtdyld-check: *{4}(a) = 0x9137bc00