2 # RUN: llvm-mc -filetype=obj -triple=aarch64 %s -o %t.o
3 # RUN: ld.lld -pie --pack-dyn-relocs=relr -z max-page-size=4096 --verbose %t.o -o %t 2>&1 | FileCheck %s
4 # RUN: llvm-readobj -r %t | FileCheck --check-prefix=RELR %s
6 ## This test makes sure we don't shrink .relr.dyn, otherwise its size may
7 ## oscillate between 2 words and 3 words.
9 ## The test is very sensitive to the exact section sizes and offsets,
10 ## make sure .data is located at a page boundary.
12 # CHECK: .relr.dyn needs 1 padding word(s)
15 # RELR-NEXT: 0x2F30 R_AARCH64_RELATIVE -
16 # RELR-NEXT: 0x2F38 R_AARCH64_RELATIVE -
17 # RELR-NEXT: 0x3000 R_AARCH64_RELATIVE -
24 ## Encoded by the first word of .relr.dyn
27 ## Encoded by the second word of .relr.dyn
32 ## If .data is at 0x3000, the relocation will be encoded by the second word.
33 ## If we shrink .relr.dyn, the end of .dynamic will be at 0x2ff8 and .data
34 ## will be at 0x3ff8, we will need the third word to encode this relocation,
35 ## which will cause .relr.dyn to expand again.