1 // Test that both Android
and RELR packed relocation sections are created
2 // correctly for each partition.
6 // RUN
: llvm-mc
%s
-o
%t.o
-filetype
=obj
--triple
=x86_64-unknown-linux
7 // RUN
: ld.lld
%t.o
-o
%t --shared
--gc-sections
--pack-dyn-relocs
=android+relr
9 // RUN
: llvm-objcopy
--extract-main-partition
%t %t0
10 // RUN
: llvm-objcopy
--extract-partition
=part1
%t %t1
12 // RUN
: llvm-readelf
--all
%t0 | FileCheck
--check-prefixes
=CHECK
,PART0
%s
13 // RUN
: llvm-readelf
--all
%t1 | FileCheck
--check-prefixes
=CHECK
,PART1
%s
15 // CHECK
: Section Headers
:
16 // CHECK
: .rela.dyn ANDROID_RELA {{0*}}[[ANDROID_RELA_ADDR:[^ ]*]]
17 // CHECK
: .relr.dyn RELR {{0*}}[[RELR_ADDR:[^ ]*]]
18 // PART0
: .data PROGBITS 000000000000[[DATA_SEGMENT:.]]378
19 // PART1
: .data PROGBITS 000000000000[[DATA_SEGMENT:.]]340
21 // CHECK
: Dynamic section
22 // CHECK
: 0x0000000060000011 (ANDROID_RELA
) 0x
[[ANDROID_RELA_ADDR
]]
23 // CHECK
: 0x0000000000000024 (RELR
) 0x
[[RELR_ADDR
]]
25 // CHECK
: Relocation section
'.rela.dyn'
27 // PART0-NEXT
: 000000000000[[DATA_SEGMENT
]]380 {{.*}} R_X86_64_64 000000000000[[DATA_SEGMENT]]378 p0 + 0
28 // PART1-NEXT
: 000000000000[[DATA_SEGMENT
]]348 {{.*}} R_X86_64_64 000000000000[[DATA_SEGMENT]]340 p1 + 0
31 // CHECK
: Relocation section
'.relr.dyn'
33 // PART0-NEXT
: 000000000000[[DATA_SEGMENT
]]378 {{.*}} R_X86_64_RELATIVE
34 // PART1-NEXT
: 000000000000[[DATA_SEGMENT
]]340 {{.*}} R_X86_64_RELATIVE
37 .section .llvm_sympart,"",@llvm_sympart
41 .section .data.p0,"aw",@progbits
48 .section .data.p1,"aw",@progbits