File tree Expand file tree Collapse file tree 2 files changed +99
-0
lines changed
lib/ExecutionEngine/JITLink
test/ExecutionEngine/JITLink/AArch64 Expand file tree Collapse file tree 2 files changed +99
-0
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,7 @@ class ELFLinkGraphBuilder_aarch64 : public ELFLinkGraphBuilder<ELFT> {
58
58
ELFMovwAbsG1,
59
59
ELFMovwAbsG2,
60
60
ELFMovwAbsG3,
61
+ ELFAbs32,
61
62
ELFAbs64,
62
63
ELFPrel32,
63
64
ELFPrel64,
@@ -98,6 +99,8 @@ class ELFLinkGraphBuilder_aarch64 : public ELFLinkGraphBuilder<ELFT> {
98
99
return ELFMovwAbsG2;
99
100
case ELF::R_AARCH64_MOVW_UABS_G3:
100
101
return ELFMovwAbsG3;
102
+ case ELF::R_AARCH64_ABS32:
103
+ return ELFAbs32;
101
104
case ELF::R_AARCH64_ABS64:
102
105
return ELFAbs64;
103
106
case ELF::R_AARCH64_PREL32:
@@ -284,6 +287,10 @@ class ELFLinkGraphBuilder_aarch64 : public ELFLinkGraphBuilder<ELFT> {
284
287
Kind = aarch64::MoveWide16;
285
288
break ;
286
289
}
290
+ case ELFAbs32: {
291
+ Kind = aarch64::Pointer32;
292
+ break ;
293
+ }
287
294
case ELFAbs64: {
288
295
Kind = aarch64::Pointer64;
289
296
break ;
@@ -357,6 +364,8 @@ class ELFLinkGraphBuilder_aarch64 : public ELFLinkGraphBuilder<ELFT> {
357
364
return " ELFMovwAbsG2" ;
358
365
case ELFMovwAbsG3:
359
366
return " ELFMovwAbsG3" ;
367
+ case ELFAbs32:
368
+ return " ELFAbs32" ;
360
369
case ELFAbs64:
361
370
return " ELFAbs64" ;
362
371
case ELFPrel32:
Original file line number Diff line number Diff line change
1
+ # Check success and failure cases of R_AARCH64_32 handling.
2
+ # This file contains a single R_AARCH64_ABS32 relocation. We expect the
3
+ # relocation to apply successfully when we assign x an address in the low
4
+ # 32-bits of the address space, and fail if we assign x an address outside that
5
+ # range.
6
+
7
+ # RUN: yaml2obj -o %t.o %s
8
+ # RUN: llvm-jitlink -abs x=0x12345678 -noexec -check=%s %t.o
9
+ # RUN: not llvm-jitlink -abs x=0x123456789 -noexec %t.o 2>&1 | \
10
+ # RUN: FileCheck -check-prefix=CHECK-ERROR %s
11
+
12
+ # jitlink-check: *{8}xptr = x
13
+
14
+ # CHECK-ERROR: relocation target "x" {{.*}} is out of range of Pointer32 fixup
15
+
16
+ --- !ELF
17
+ FileHeader :
18
+ Class : ELFCLASS64
19
+ Data : ELFDATA2LSB
20
+ Type : ET_REL
21
+ Machine : EM_AARCH64
22
+ SectionHeaderStringTable : .strtab
23
+ Sections :
24
+ - Name : .text
25
+ Type : SHT_PROGBITS
26
+ Flags : [ SHF_ALLOC, SHF_EXECINSTR ]
27
+ AddressAlign : 0x4
28
+ Content : E0031F2AC0035FD6
29
+ - Name : .data
30
+ Type : SHT_PROGBITS
31
+ Flags : [ SHF_WRITE, SHF_ALLOC ]
32
+ AddressAlign : 0x8
33
+ Content : ' 0000000000000000'
34
+ - Name : .comment
35
+ Type : SHT_PROGBITS
36
+ Flags : [ SHF_MERGE, SHF_STRINGS ]
37
+ AddressAlign : 0x1
38
+ EntSize : 0x1
39
+ Content : 00636C616E672076657273696F6E2031372E302E30202868747470733A2F2F6769746875622E636F6D2F6C6C766D2F6C6C766D2D70726F6A6563742E67697420333130616161633834363336656336633933383739633138643933653332663537623264383938362900
40
+ - Name : .note.GNU-stack
41
+ Type : SHT_PROGBITS
42
+ AddressAlign : 0x1
43
+ - Name : .rela.data
44
+ Type : SHT_RELA
45
+ Flags : [ SHF_INFO_LINK ]
46
+ Link : .symtab
47
+ AddressAlign : 0x8
48
+ Info : .data
49
+ Relocations :
50
+ - Symbol : x
51
+ Type : R_AARCH64_ABS32
52
+ - Name : .llvm_addrsig
53
+ Type : SHT_LLVM_ADDRSIG
54
+ Flags : [ SHF_EXCLUDE ]
55
+ Link : .symtab
56
+ AddressAlign : 0x1
57
+ Symbols : [ x ]
58
+ - Type : SectionHeaderTable
59
+ Sections :
60
+ - Name : .strtab
61
+ - Name : .text
62
+ - Name : .data
63
+ - Name : .rela.data
64
+ - Name : .comment
65
+ - Name : .note.GNU-stack
66
+ - Name : .llvm_addrsig
67
+ - Name : .symtab
68
+ Symbols :
69
+ - Name : hw.c
70
+ Type : STT_FILE
71
+ Index : SHN_ABS
72
+ - Name : ' $x.0'
73
+ Section : .text
74
+ - Name : ' $d.1'
75
+ Section : .data
76
+ - Name : ' $d.2'
77
+ Section : .comment
78
+ - Name : main
79
+ Type : STT_FUNC
80
+ Section : .text
81
+ Binding : STB_GLOBAL
82
+ Size : 0x8
83
+ - Name : xptr
84
+ Type : STT_OBJECT
85
+ Section : .data
86
+ Binding : STB_GLOBAL
87
+ Size : 0x8
88
+ - Name : x
89
+ Binding : STB_GLOBAL
90
+ ...
You can’t perform that action at this time.
0 commit comments