Index: ELF/Writer.cpp =================================================================== --- ELF/Writer.cpp +++ ELF/Writer.cpp @@ -2225,7 +2225,8 @@ // -PF_X-to-non-PF-X boundary. // // TODO Delete force_align to enable this technique on other targets. - bool force_align = config->emachine != EM_PPC64; + bool force_align = + config->emachine != EM_AARCH64 && config->emachine != EM_PPC64; if (force_align || (config->zSeparateCode && last && (last->p_flags & PF_X) != (p->p_flags & PF_X))) Index: test/ELF/aarch64-abs16.s =================================================================== --- test/ELF/aarch64-abs16.s +++ test/ELF/aarch64-abs16.s @@ -14,11 +14,11 @@ // RUN: llvm-objdump -s -section=.data %t2 | FileCheck %s // CHECK: Contents of section .data: -// 210000: S = 0x100, A = 0xfeff +// 220158: S = 0x100, A = 0xfeff // S + A = 0xffff -// 210002: S = 0x100, A = -0x8100 +// 22015c: S = 0x100, A = -0x8100 // S + A = 0x8000 -// CHECK-NEXT: 210000 ffff0080 +// CHECK-NEXT: 220158 ffff0080 // RUN: not ld.lld %t.o %t255.o -o /dev/null 2>&1 | FileCheck %s --check-prefix=OVERFLOW1 // OVERFLOW1: relocation R_AARCH64_ABS16 out of range: -32769 is not in [-32768, 65535] Index: test/ELF/aarch64-abs32.s =================================================================== --- test/ELF/aarch64-abs32.s +++ test/ELF/aarch64-abs32.s @@ -14,11 +14,11 @@ // RUN: llvm-objdump -s -section=.data %t2 | FileCheck %s // CHECK: Contents of section .data: -// 210000: S = 0x100, A = 0xfffffeff +// 220158: S = 0x100, A = 0xfffffeff // S + A = 0xffffffff -// 210004: S = 0x100, A = -0x80000100 +// 22015c: S = 0x100, A = -0x80000100 // S + A = 0x80000000 -// CHECK-NEXT: 210000 ffffffff 00000080 +// CHECK-NEXT: 220158 ffffffff 00000080 // RUN: not ld.lld %t.o %t255.o -o /dev/null 2>&1 | FileCheck %s --check-prefix=OVERFLOW1 // OVERFLOW1: relocation R_AARCH64_ABS32 out of range: -2147483649 is not in [-2147483648, 4294967295] Index: test/ELF/aarch64-call26-thunk.s =================================================================== --- test/ELF/aarch64-call26-thunk.s +++ test/ELF/aarch64-call26-thunk.s @@ -12,11 +12,11 @@ // CHECK: Disassembly of section .text: // CHECK-EMPTY: // CHECK-NEXT: _start: -// CHECK-NEXT: 210000: 02 00 00 94 bl #8 +// CHECK-NEXT: 210120: 02 00 00 94 bl #8 // CHECK: __AArch64AbsLongThunk_big: -// CHECK-NEXT: 210008: 50 00 00 58 ldr x16, #8 -// CHECK-NEXT: 21000c: 00 02 1f d6 br x16 +// CHECK-NEXT: 210128: 50 00 00 58 ldr x16, #8 +// CHECK-NEXT: 21012c: 00 02 1f d6 br x16 // CHECK: $d: -// CHECK-NEXT: 210010: 00 00 00 00 .word 0x00000000 -// CHECK-NEXT: 210014: 10 00 00 00 .word 0x00000010 +// CHECK-NEXT: 210130: 00 00 00 00 .word 0x00000000 +// CHECK-NEXT: 210134: 10 00 00 00 .word 0x00000010 Index: test/ELF/aarch64-condb-reloc.s =================================================================== --- test/ELF/aarch64-condb-reloc.s +++ test/ELF/aarch64-condb-reloc.s @@ -13,21 +13,21 @@ # CHECK: Disassembly of section .text: # CHECK-EMPTY: # CHECK-NEXT: _foo: -# CHECK-NEXT: 210000: nop -# CHECK-NEXT: 210004: nop -# CHECK-NEXT: 210008: nop -# CHECK-NEXT: 21000c: nop +# CHECK-NEXT: 210120: nop +# CHECK-NEXT: 210124: nop +# CHECK-NEXT: 210128: nop +# CHECK-NEXT: 21012c: nop # CHECK: _bar: -# CHECK-NEXT: 210010: nop -# CHECK-NEXT: 210014: nop -# CHECK-NEXT: 210018: nop +# CHECK-NEXT: 210130: nop +# CHECK-NEXT: 210134: nop +# CHECK-NEXT: 210138: nop # CHECK: _dah: -# CHECK-NEXT: 21001c: nop -# CHECK-NEXT: 210020: nop +# CHECK-NEXT: 21013c: nop +# CHECK-NEXT: 210140: nop # CHECK: _start: -# CHECK-NEXT: 210024: b.eq #-36 <_foo> -# CHECK-NEXT: 210028: b.eq #-24 <_bar> -# CHECK-NEXT: 21002c: b.eq #-16 <_dah> +# CHECK-NEXT: 210144: b.eq #-36 <_foo> +# CHECK-NEXT: 210148: b.eq #-24 <_bar> +# CHECK-NEXT: 21014c: b.eq #-16 <_dah> #DSOREL: Section { #DSOREL: Index: @@ -37,8 +37,8 @@ #DSOREL-NEXT: SHF_ALLOC #DSOREL-NEXT: SHF_WRITE #DSOREL-NEXT: ] -#DSOREL-NEXT: Address: 0x30000 -#DSOREL-NEXT: Offset: 0x30000 +#DSOREL-NEXT: Address: 0x30470 +#DSOREL-NEXT: Offset: 0x470 #DSOREL-NEXT: Size: 48 #DSOREL-NEXT: Link: 0 #DSOREL-NEXT: Info: 0 @@ -47,60 +47,60 @@ #DSOREL-NEXT: } #DSOREL: Relocations [ #DSOREL-NEXT: Section ({{.*}}) .rela.plt { -#DSOREL-NEXT: 0x30018 R_AARCH64_JUMP_SLOT _foo -#DSOREL-NEXT: 0x30020 R_AARCH64_JUMP_SLOT _bar -#DSOREL-NEXT: 0x30028 R_AARCH64_JUMP_SLOT _dah +#DSOREL-NEXT: 0x30488 R_AARCH64_JUMP_SLOT _foo +#DSOREL-NEXT: 0x30490 R_AARCH64_JUMP_SLOT _bar +#DSOREL-NEXT: 0x30498 R_AARCH64_JUMP_SLOT _dah #DSOREL-NEXT: } #DSOREL-NEXT:] #DSO: Disassembly of section .text: #DSO-EMPTY: #DSO-NEXT: _foo: -#DSO-NEXT: 10000: nop -#DSO-NEXT: 10004: nop -#DSO-NEXT: 10008: nop -#DSO-NEXT: 1000c: nop +#DSO-NEXT: 10338: nop +#DSO-NEXT: 1033c: nop +#DSO-NEXT: 10340: nop +#DSO-NEXT: 10344: nop #DSO: _bar: -#DSO-NEXT: 10010: nop -#DSO-NEXT: 10014: nop -#DSO-NEXT: 10018: nop +#DSO-NEXT: 10348: nop +#DSO-NEXT: 1034c: nop +#DSO-NEXT: 10350: nop #DSO: _dah: -#DSO-NEXT: 1001c: nop -#DSO-NEXT: 10020: nop +#DSO-NEXT: 10354: nop +#DSO-NEXT: 10358: nop #DSO: _start: -#DSO-NEXT: 10024: b.eq #44 <_foo@plt> -#DSO-NEXT: 10028: b.eq #56 <_bar@plt> -#DSO-NEXT: 1002c: b.eq #68 <_dah@plt> +#DSO-NEXT: 1035c: b.eq #52 <_foo@plt> +#DSO-NEXT: 10360: b.eq #64 <_bar@plt> +#DSO-NEXT: 10364: b.eq #76 <_dah@plt> #DSO-EMPTY: #DSO-NEXT: Disassembly of section .plt: #DSO-EMPTY: #DSO-NEXT: .plt: -#DSO-NEXT: 10030: stp x16, x30, [sp, #-16]! -#DSO-NEXT: 10034: adrp x16, #131072 -#DSO-NEXT: 10038: ldr x17, [x16, #16] -#DSO-NEXT: 1003c: add x16, x16, #16 -#DSO-NEXT: 10040: br x17 -#DSO-NEXT: 10044: nop -#DSO-NEXT: 10048: nop -#DSO-NEXT: 1004c: nop +#DSO-NEXT: 10370: stp x16, x30, [sp, #-16]! +#DSO-NEXT: 10374: adrp x16, #131072 +#DSO-NEXT: 10378: ldr x17, [x16, #1152] +#DSO-NEXT: 1037c: add x16, x16, #1152 +#DSO-NEXT: 10380: br x17 +#DSO-NEXT: 10384: nop +#DSO-NEXT: 10388: nop +#DSO-NEXT: 1038c: nop #DSO-EMPTY: #DSO-NEXT: _foo@plt: -#DSO-NEXT: 10050: adrp x16, #131072 -#DSO-NEXT: 10054: ldr x17, [x16, #24] -#DSO-NEXT: 10058: add x16, x16, #24 -#DSO-NEXT: 1005c: br x17 +#DSO-NEXT: 10390: adrp x16, #131072 +#DSO-NEXT: 10394: ldr x17, [x16, #1160] +#DSO-NEXT: 10398: add x16, x16, #1160 +#DSO-NEXT: 1039c: br x17 #DSO-EMPTY: #DSO-NEXT: _bar@plt: -#DSO-NEXT: 10060: adrp x16, #131072 -#DSO-NEXT: 10064: ldr x17, [x16, #32] -#DSO-NEXT: 10068: add x16, x16, #32 -#DSO-NEXT: 1006c: br x17 +#DSO-NEXT: 103a0: adrp x16, #131072 +#DSO-NEXT: 103a4: ldr x17, [x16, #1168] +#DSO-NEXT: 103a8: add x16, x16, #1168 +#DSO-NEXT: 103ac: br x17 #DSO-EMPTY: #DSO-NEXT: _dah@plt: -#DSO-NEXT: 10070: adrp x16, #131072 -#DSO-NEXT: 10074: ldr x17, [x16, #40] -#DSO-NEXT: 10078: add x16, x16, #40 -#DSO-NEXT: 1007c: br x17 +#DSO-NEXT: 103b0: adrp x16, #131072 +#DSO-NEXT: 103b4: ldr x17, [x16, #1176] +#DSO-NEXT: 103b8: add x16, x16, #1176 +#DSO-NEXT: 103bc: br x17 .globl _start _start: Index: test/ELF/aarch64-copy.s =================================================================== --- test/ELF/aarch64-copy.s +++ test/ELF/aarch64-copy.s @@ -22,7 +22,7 @@ // CHECK-NEXT: SHF_ALLOC // CHECK-NEXT: SHF_WRITE // CHECK-NEXT: ] -// CHECK-NEXT: Address: 0x230000 +// CHECK-NEXT: Address: 0x2303F0 // CHECK-NEXT: Offset: // CHECK-NEXT: Size: 24 // CHECK-NEXT: Link: @@ -31,29 +31,29 @@ // CHECK: Relocations [ // CHECK-NEXT: Section ({{.*}}) .rela.dyn { -// CHECK-NEXT: 0x230000 R_AARCH64_COPY x 0x0 -// CHECK-NEXT: 0x230010 R_AARCH64_COPY y 0x0 -// CHECK-NEXT: 0x230014 R_AARCH64_COPY z 0x0 +// CHECK-NEXT: 0x2303F0 R_AARCH64_COPY x 0x0 +// CHECK-NEXT: 0x230400 R_AARCH64_COPY y 0x0 +// CHECK-NEXT: 0x230404 R_AARCH64_COPY z 0x0 // CHECK-NEXT: } // CHECK-NEXT: ] // CHECK: Symbols [ // CHECK: Name: x -// CHECK-NEXT: Value: 0x230000 +// CHECK-NEXT: Value: 0x2303F0 // CHECK-NEXT: Size: 4 // CHECK-NEXT: Binding: Global // CHECK-NEXT: Type: Object // CHECK-NEXT: Other: // CHECK-NEXT: Section: .bss // CHECK: Name: y -// CHECK-NEXT: Value: 0x230010 +// CHECK-NEXT: Value: 0x230400 // CHECK-NEXT: Size: 4 // CHECK-NEXT: Binding: Global // CHECK-NEXT: Type: Object // CHECK-NEXT: Other: // CHECK-NEXT: Section: .bss // CHECK: Name: z -// CHECK-NEXT: Value: 0x230014 +// CHECK-NEXT: Value: 0x230404 // CHECK-NEXT: Size: 4 // CHECK-NEXT: Binding: Global // CHECK-NEXT: Type: Object @@ -64,16 +64,13 @@ // CODE: Disassembly of section .text: // CODE-EMPTY: // CODE-NEXT: _start: -// S(x) = 0x230000, A = 0, P = 0x210000 -// S + A - P = 0x20000 = 131072 -// CODE-NEXT: 210000: adr x1, #131072 -// S(y) = 0x230010, A = 0, P = 0x210004 -// Page(S + A) - Page(P) = 0x230000 - 0x210000 = 0x20000 = 131072 -// CODE-NEXT: 210004: adrp x2, #131072 -// S(y) = 0x230010, A = 0 -// (S + A) & 0xFFF = 0x10 = 16 -// CODE-NEXT: 210008: add x2, x2, #16 +// S + A - P = 0x2303f0 + 0 - 0x21031c = 131284 +// CODE-NEXT: 21031c: adr x1, #131284 +// Page(S + A) - Page(P) = Page(0x230400) - Page(0x210320) = 131072 +// CODE-NEXT: 210320: adrp x2, #131072 +// (S + A) & 0xFFF = (0x230400 + 0) & 0xFFF = 1024 +// CODE-NEXT: 210324: add x2, x2, #1024 // RODATA: Contents of section .rodata: -// S(z) = 0x230014 -// RODATA-NEXT: 200318 14002300 +// S(z) = 0x230404 +// RODATA-NEXT: 200318 04042300 Index: test/ELF/aarch64-cortex-a53-843419-large.s =================================================================== --- test/ELF/aarch64-cortex-a53-843419-large.s +++ test/ELF/aarch64-cortex-a53-843419-large.s @@ -1,6 +1,6 @@ // REQUIRES: aarch64 // RUN: llvm-mc -filetype=obj -triple=aarch64-none-linux %s -o %t.o -// RUN: ld.lld --fix-cortex-a53-843419 %t.o -o %t2 +// RUN: ld.lld --fix-cortex-a53-843419 -z separate-code %t.o -o %t2 // RUN: llvm-objdump -triple=aarch64-linux-gnu -d %t2 -start-address=2162688 -stop-address=2162700 | FileCheck --check-prefix=CHECK1 %s // RUN: llvm-objdump -triple=aarch64-linux-gnu -d %t2 -start-address=2166784 -stop-address=2166788 | FileCheck --check-prefix=CHECK2 %s // RUN: llvm-objdump -triple=aarch64-linux-gnu -d %t2 -start-address=2170872 -stop-address=2170888 | FileCheck --check-prefix=CHECK3 %s Index: test/ELF/aarch64-cortex-a53-843419-recognize.s =================================================================== --- test/ELF/aarch64-cortex-a53-843419-recognize.s +++ test/ELF/aarch64-cortex-a53-843419-recognize.s @@ -1,8 +1,8 @@ // REQUIRES: aarch64 // RUN: llvm-mc -filetype=obj -triple=aarch64-none-linux %s -o %t.o -// RUN: ld.lld -fix-cortex-a53-843419 -verbose %t.o -o %t2 2>&1 | FileCheck -check-prefix CHECK-PRINT %s +// RUN: ld.lld -fix-cortex-a53-843419 -z separate-code -verbose %t.o -o %t2 2>&1 | FileCheck -check-prefix CHECK-PRINT %s // RUN: llvm-objdump -triple=aarch64-linux-gnu -d %t2 | FileCheck %s -check-prefixes=CHECK,CHECK-FIX -// RUN: ld.lld %t.o -o %t3 +// RUN: ld.lld %t.o -z separate-code -o %t3 // RUN: llvm-objdump -triple=aarch64-linux-gnu -d %t3 | FileCheck %s -check-prefixes=CHECK,CHECK-NOFIX // Test cases for Cortex-A53 Erratum 843419 // See ARM-EPM-048406 Cortex_A53_MPCore_Software_Developers_Errata_Notice.pdf Index: test/ELF/aarch64-cortex-a53-843419-tlsrelax.s =================================================================== --- test/ELF/aarch64-cortex-a53-843419-tlsrelax.s +++ test/ELF/aarch64-cortex-a53-843419-tlsrelax.s @@ -24,12 +24,12 @@ ret // CHECK: _start: -// CHECK-NEXT: 210ff8: 41 d0 3b d5 mrs x1, TPIDR_EL0 -// CHECK-NEXT: 210ffc: 00 00 a0 d2 movz x0, #0, lsl #16 -// CHECK-NEXT: 211000: 01 02 80 f2 movk x1, #16 -// CHECK-NEXT: 211004: 00 00 a0 d2 movz x0, #0, lsl #16 -// CHECK-NEXT: 211008: 01 02 80 f2 movk x1, #16 -// CHECK-NEXT: 21100c: c0 03 5f d6 ret +// CHECK-NEXT: 211ff8: 41 d0 3b d5 mrs x1, TPIDR_EL0 +// CHECK-NEXT: 211ffc: 00 00 a0 d2 movz x0, #0, lsl #16 +// CHECK-NEXT: 212000: 01 02 80 f2 movk x1, #16 +// CHECK-NEXT: 212004: 00 00 a0 d2 movz x0, #0, lsl #16 +// CHECK-NEXT: 212008: 01 02 80 f2 movk x1, #16 +// CHECK-NEXT: 21200c: c0 03 5f d6 ret .type v,@object .section .tbss,"awT",@nobits Index: test/ELF/aarch64-data-relocs.s =================================================================== --- test/ELF/aarch64-data-relocs.s +++ test/ELF/aarch64-data-relocs.s @@ -12,12 +12,11 @@ // S = 0x100, A = 0x24 // S + A = 0x124 // CHECK: Contents of section .R_AARCH64_ABS64: -// CHECK-NEXT: 210000 24010000 00000000 +// CHECK-NEXT: 210120 24010000 00000000 .section .R_AARCH64_PREL64, "ax",@progbits .xword foo - . + 0x24 -// S = 0x100, A = 0x24, P = 0x20008 -// S + A - P = 0xfffffffffffe011c +// S + A - P = 0x100 + 0x24 - 0x210128 = 0xffffffffffdefffc // CHECK: Contents of section .R_AARCH64_PREL64: -// CHECK-NEXT: 210008 1c01dfff ffffffff +// CHECK-NEXT: 210128 fcffdeff ffffffff Index: test/ELF/aarch64-feature-bti.s =================================================================== --- test/ELF/aarch64-feature-bti.s +++ test/ELF/aarch64-feature-bti.s @@ -8,7 +8,7 @@ ## We do not add BTI support when the inputs don't have the .note.gnu.property ## field. -# RUN: ld.lld %tno.o %t3.o --shared -o %tno.so +# RUN: ld.lld %tno.o %t3.o --shared -z separate-code -o %tno.so # RUN: llvm-objdump -d -mattr=+bti --no-show-raw-insn %tno.so | FileCheck --check-prefix=NOBTI %s # RUN: llvm-readelf -x .got.plt %tno.so | FileCheck --check-prefix SOGOTPLT %s # RUN: llvm-readelf --dynamic-table %tno.so | FileCheck --check-prefix NOBTIDYN %s @@ -39,7 +39,7 @@ ## their address doesn't escape the shared object, so they can't be indirectly ## called. Expect no other difference. -# RUN: ld.lld %t1.o %t3.o --shared -o %t.so +# RUN: ld.lld %t1.o %t3.o --shared -z separate-code -o %t.so # RUN: llvm-readelf -n %t.so | FileCheck --check-prefix BTIPROP %s # RUN: llvm-objdump -d -mattr=+bti --no-show-raw-insn %t.so | FileCheck --check-prefix BTISO %s # RUN: llvm-readelf -x .got.plt %t.so | FileCheck --check-prefix SOGOTPLT %s @@ -78,9 +78,9 @@ ## .note.gnu.property. We expect a bti c in front of all PLT entries as the ## address of a PLT entry can escape an executable. -# RUN: ld.lld %t2.o --shared -o %t2.so +# RUN: ld.lld %t2.o --shared -z separate-code -o %t2.so -# RUN: ld.lld %t.o %t.so %t2.so -o %t.exe +# RUN: ld.lld %t.o %t.so %t2.so -z separate-code -o %t.exe # RUN: llvm-readelf --dynamic-table -n %t.exe | FileCheck --check-prefix=BTIPROP %s # RUN: llvm-objdump -d -mattr=+bti --no-show-raw-insn %t.exe | FileCheck --check-prefix=EXECBTI %s @@ -107,7 +107,7 @@ # EXECBTI-NEXT: 210044: nop ## We expect the same for PIE, as the address of an ifunc can escape -# RUN: ld.lld --pie %t.o %t.so %t2.so -o %tpie.exe +# RUN: ld.lld --pie %t.o %t.so %t2.so -z separate-code -o %tpie.exe # RUN: llvm-readelf -n %tpie.exe | FileCheck --check-prefix=BTIPROP %s # RUN: llvm-readelf --dynamic-table -n %tpie.exe | FileCheck --check-prefix=BTIPROP %s # RUN: llvm-objdump -d -mattr=+bti --no-show-raw-insn %tpie.exe | FileCheck --check-prefix=PIE %s @@ -137,7 +137,7 @@ ## Build and executable with not all relocatable inputs having the BTI ## .note.property, expect no bti c and no .note.gnu.property entry -# RUN: ld.lld %t.o %t2.o %t.so -o %tnobti.exe +# RUN: ld.lld %t.o %t2.o %t.so -z separate-code -o %tnobti.exe # RUN: llvm-readelf --dynamic-table %tnobti.exe | FileCheck --check-prefix NOBTIDYN %s # RUN: llvm-objdump -d -mattr=+bti --no-show-raw-insn %tnobti.exe | FileCheck --check-prefix=NOEX %s @@ -166,7 +166,7 @@ ## Force BTI entries with the --force-bti command line option. Expect a warning ## from the file without the .note.gnu.property. -# RUN: ld.lld %t.o %t2.o --force-bti %t.so -o %tforcebti.exe 2>&1 | FileCheck --check-prefix=FORCE-WARN %s +# RUN: ld.lld %t.o %t2.o --force-bti %t.so -z separate-code -o %tforcebti.exe 2>&1 | FileCheck --check-prefix=FORCE-WARN %s # FORCE-WARN: aarch64-feature-bti.s.tmp2.o: --force-bti: file does not have BTI property Index: test/ELF/aarch64-feature-btipac.s =================================================================== --- test/ELF/aarch64-feature-btipac.s +++ test/ELF/aarch64-feature-btipac.s @@ -9,7 +9,7 @@ ## PLT[0] has bti c at start ## PLT[n] has autia1716 before br x17 -# RUN: ld.lld %t1.o %t3btipac.o --shared -o %t.so +# RUN: ld.lld %t1.o %t3btipac.o --shared -z separate-code -z separate-code -o %t.so # RUN: llvm-readelf -n %t.so | FileCheck --check-prefix BTIPACPROP %s # RUN: llvm-objdump -d -mattr=+v8.5a --no-show-raw-insn %t.so | FileCheck --check-prefix BTIPACSO %s # RUN: llvm-readelf --dynamic-table %t.so | FileCheck --check-prefix BTIPACDYN %s @@ -47,7 +47,7 @@ ## PLT[0] bti c as first instruction ## PLT[n] bti n as first instruction, autia1716 before br x17 -# RUN: ld.lld %t.o %t3btipac.o %t.so -o %t.exe +# RUN: ld.lld %t.o %t3btipac.o %t.so -z separate-code -o %t.exe # RUN: llvm-readelf -n %t.exe | FileCheck --check-prefix=BTIPACPROP %s # RUN: llvm-objdump -d -mattr=+v8.5a --no-show-raw-insn %t.exe | FileCheck --check-prefix BTIPACEX %s # RUN: llvm-readelf --dynamic-table %t.exe | FileCheck --check-prefix BTIPACDYN %s @@ -79,7 +79,7 @@ ## Check that combinations of BTI+PAC with 0 properties results in standard PLT -# RUN: ld.lld %t.o %t3.o %t.so -o %t.exe +# RUN: ld.lld %t.o %t3.o %t.so -z separate-code -o %t.exe # RUN: llvm-objdump -d -mattr=+v8.5a --no-show-raw-insn %t.exe | FileCheck --check-prefix EX %s # RUN: llvm-readelf --dynamic-table %t.exe | FileCheck --check-prefix=NODYN %s @@ -113,7 +113,7 @@ ## doesn't contain the BTI property, but generates PAC and BTI PLT sequences. ## The --pac-plt doesn't warn as it is not required for correctness. -# RUN: ld.lld %t.o %t3.o %t.so --pac-plt --force-bti -o %t.exe 2>&1 | FileCheck --check-prefix=FORCE-WARN %s +# RUN: ld.lld %t.o %t3.o %t.so --pac-plt --force-bti -z separate-code -o %t.exe 2>&1 | FileCheck --check-prefix=FORCE-WARN %s # FORCE-WARN: aarch64-feature-btipac.s.tmp3.o: --force-bti: file does not have BTI property Index: test/ELF/aarch64-feature-pac.s =================================================================== --- test/ELF/aarch64-feature-pac.s +++ test/ELF/aarch64-feature-pac.s @@ -8,7 +8,7 @@ ## We do not add PAC support when the inputs don't have the .note.gnu.property ## field. -# RUN: ld.lld %tno.o %t3.o --shared -o %tno.so +# RUN: ld.lld %tno.o %t3.o --shared -z separate-code -o %tno.so # RUN: llvm-objdump -d -mattr=+v8.3a --no-show-raw-insn %tno.so | FileCheck --check-prefix=NOPAC %s # RUN: llvm-readelf -x .got.plt %tno.so | FileCheck --check-prefix SOGOTPLT %s # RUN: llvm-readelf --dynamic-table %tno.so | FileCheck --check-prefix NOPACDYN %s @@ -35,7 +35,7 @@ # NOPACDYN-NOT: 0x0000000070000001 (AARCH64_BTI_PLT) # NOPACDYN-NOT: 0x0000000070000003 (AARCH64_PAC_PLT) -# RUN: ld.lld %t1.o %t3.o --shared -o %t.so +# RUN: ld.lld %t1.o %t3.o --shared -z separate-code -o %t.so # RUN: llvm-readelf -n %t.so | FileCheck --check-prefix PACPROP %s # RUN: llvm-objdump -d -mattr=+v8.3a --no-show-raw-insn %t.so | FileCheck --check-prefix PACSO %s # RUN: llvm-readelf -x .got.plt %t.so | FileCheck --check-prefix SOGOTPLT %s @@ -80,7 +80,7 @@ ## to the choice of using PAC in relocatable objects. The presence of the PAC ## .note.gnu.property is an indication of preference by the relocatable object. -# RUN: ld.lld %t.o %t2.o --pac-plt %t.so -o %tpacplt.exe +# RUN: ld.lld %t.o %t2.o --pac-plt %t.so -z separate-code -o %tpacplt.exe # RUN: llvm-readelf -n %tpacplt.exe | FileCheck --check-prefix=PACPROP %s # RUN: llvm-readelf --dynamic-table %tpacplt.exe | FileCheck --check-prefix PACDYN %s # RUN: llvm-objdump -d -mattr=+v8.3a --no-show-raw-insn %tpacplt.exe | FileCheck --check-prefix PACPLT %s Index: test/ELF/aarch64-fpic-got.s =================================================================== --- test/ELF/aarch64-fpic-got.s +++ test/ELF/aarch64-fpic-got.s @@ -2,7 +2,7 @@ # RUN: llvm-mc -filetype=obj -triple=aarch64-none-linux %s -o %t.o # RUN: llvm-mc -filetype=obj -triple=aarch64-none-linux %p/Inputs/shared.s -o %t-lib.o -# RUN: ld.lld -shared %t-lib.o -o %t-lib.so +# RUN: ld.lld -shared %t-lib.o -soname t-lib.so -o %t-lib.so # RUN: ld.lld %t-lib.so %t.o -o %t.exe # RUN: llvm-readobj -r %t.exe | FileCheck --check-prefix=RELOC %s @@ -11,14 +11,14 @@ ## Checks if got access to dynamic objects is done through a got relative ## dynamic relocation and not using plt relative (R_AARCH64_JUMP_SLOT). # RELOC: .rela.dyn { -# RELOC-NEXT: 0x2200C0 R_AARCH64_GLOB_DAT bar 0x0 +# RELOC-NEXT: 0x220320 R_AARCH64_GLOB_DAT bar 0x0 # RELOC-NEXT: } -## page(0x2200C0) - page(0x210000) = 65536 -## page(0x2200C0) & 0xff8 = 192 +## page(0x220320) - page(0x210000) = 65536 +## page(0x220320) & 0xff8 = 800 # DIS: _start: -# DIS-NEXT: 210000: adrp x0, #65536 -# DIS-NEXT: 210004: ldr x0, [x0, #192] +# DIS-NEXT: 210258: adrp x0, #65536 +# DIS-NEXT: 21025c: ldr x0, [x0, #800] .globl _start _start: Index: test/ELF/aarch64-gnu-ifunc-address.s =================================================================== --- test/ELF/aarch64-gnu-ifunc-address.s +++ test/ELF/aarch64-gnu-ifunc-address.s @@ -20,19 +20,18 @@ adrp x8, :got:myfunc ldr x8, [x8, :got_lo12:myfunc] ret -# CHECK: 0000000000010004 main: -# x8 = 0x20000 -# CHECK-NEXT: 10004: adrp x8, #65536 -# x8 = 0x200a0 = .got entry for myfunc with R_AARCH64_GLOB_DAT -# CHECK-NEXT: 10008: ldr x8, [x8, #160] -# CHECK-NEXT: 1000c: ret +# CHECK: 0000000000010284 main: +## myfunc's got entry = page(0x20330)-page(0x10284) + 0x330 = 65536 + 816 +# CHECK-NEXT: 10284: adrp x8, #65536 +# CHECK-NEXT: 10288: ldr x8, [x8, #816] +# CHECK-NEXT: 1028c: ret # CHECK: Disassembly of section .got: # CHECK-EMPTY: -# CHECK-NEXT: 00000000000200a0 .got: +# CHECK-NEXT: 0000000000020330 .got: # CHECK-RELOCS: Relocations [ # CHECK-RELOCS-NEXT: Section {{.*}} .rela.dyn { -# CHECK-RELOCS-NEXT: 0x200A0 R_AARCH64_GLOB_DAT myfunc 0x0 +# CHECK-RELOCS-NEXT: 0x20330 R_AARCH64_GLOB_DAT myfunc 0x0 # CHECK-RELOCS-NEXT: } # CHECK-RELOCS-NEXT: ] Index: test/ELF/aarch64-gnu-ifunc-nonpreemptable.s =================================================================== --- test/ELF/aarch64-gnu-ifunc-nonpreemptable.s +++ test/ELF/aarch64-gnu-ifunc-nonpreemptable.s @@ -31,42 +31,42 @@ ## The address of myfunc is the address of the PLT entry for myfunc. # PDE: myfunc_resolver: -# PDE-NEXT: 210000: ret +# PDE-NEXT: 210170: ret # PDE: main: -# PDE-NEXT: 210004: adrp x8, #0 -# PDE-NEXT: 210008: add x8, x8, #16 -# PDE-NEXT: 21000c: ret +# PDE-NEXT: 210174: adrp x8, #0 +# PDE-NEXT: 210178: add x8, x8, #384 +# PDE-NEXT: 21017c: ret # PDE-EMPTY: # PDE-NEXT: Disassembly of section .plt: # PDE-EMPTY: # PDE-NEXT: myfunc: ## page(.got.plt) - page(0x210010) = 65536 -# PDE-NEXT: 210010: adrp x16, #65536 -# PDE-NEXT: 210014: ldr x17, [x16] -# PDE-NEXT: 210018: add x16, x16, #0 -# PDE-NEXT: 21001c: br x17 +# PDE-NEXT: 210180: adrp x16, #65536 +# PDE-NEXT: 210184: ldr x17, [x16, #400] +# PDE-NEXT: 210188: add x16, x16, #400 +# PDE-NEXT: 21018c: br x17 ## The adrp to myfunc should generate a PLT entry and a GOT entry with an ## irelative relocation. # PDE-RELOC: .rela.plt { -# PDE-RELOC-NEXT: 0x220000 R_AARCH64_IRELATIVE - 0x210000 +# PDE-RELOC-NEXT: 0x220190 R_AARCH64_IRELATIVE - 0x210170 # PDE-RELOC-NEXT: } # PIE: myfunc_resolver: -# PIE-NEXT: 10000: ret +# PIE-NEXT: 10260: ret # PIE: main: -# PIE-NEXT: 10004: adrp x8, #0 -# PIE-NEXT: 10008: add x8, x8, #16 -# PIE-NEXT: 1000c: ret +# PIE-NEXT: 10264: adrp x8, #0 +# PIE-NEXT: 10268: add x8, x8, #624 +# PIE-NEXT: 1026c: ret # PIE-EMPTY: # PIE-NEXT: Disassembly of section .plt: # PIE-EMPTY: # PIE-NEXT: myfunc: -# PIE-NEXT: 10010: adrp x16, #131072 -# PIE-NEXT: 10014: ldr x17, [x16] -# PIE-NEXT: 10018: add x16, x16, #0 -# PIE-NEXT: 1001c: br x17 +# PIE-NEXT: 10270: adrp x16, #131072 +# PIE-NEXT: 10274: ldr x17, [x16, #832] +# PIE-NEXT: 10278: add x16, x16, #832 +# PIE-NEXT: 1027c: br x17 # PIE-RELOC: .rela.plt { -# PIE-RELOC-NEXT: 0x30000 R_AARCH64_IRELATIVE - 0x10000 +# PIE-RELOC-NEXT: 0x30340 R_AARCH64_IRELATIVE - 0x10260 # PIE-RELOC-NEXT: } Index: test/ELF/aarch64-gnu-ifunc-plt.s =================================================================== --- test/ELF/aarch64-gnu-ifunc-plt.s +++ test/ELF/aarch64-gnu-ifunc-plt.s @@ -10,19 +10,19 @@ // Check that the IRELATIVE relocations are after the JUMP_SLOT in the plt // CHECK: Relocations [ // CHECK-NEXT: Section (4) .rela.plt { -// CHECK: 0x230018 R_AARCH64_JUMP_SLOT bar2 0x0 -// CHECK-NEXT: 0x230020 R_AARCH64_JUMP_SLOT zed2 0x0 -// CHECK-NEXT: 0x230028 R_AARCH64_IRELATIVE - 0x210000 -// CHECK-NEXT: 0x230030 R_AARCH64_IRELATIVE - 0x210004 +// CHECK: 0x230428 R_AARCH64_JUMP_SLOT bar2 0x0 +// CHECK-NEXT: 0x230430 R_AARCH64_JUMP_SLOT zed2 0x0 +// CHECK-NEXT: 0x230438 R_AARCH64_IRELATIVE - 0x2102D8 +// CHECK-NEXT: 0x230440 R_AARCH64_IRELATIVE - 0x2102DC // CHECK-NEXT: } // CHECK-NEXT: ] // Check that .got.plt entries point back to PLT header // GOTPLT: Contents of section .got.plt: -// GOTPLT-NEXT: 230000 00000000 00000000 00000000 00000000 -// GOTPLT-NEXT: 230010 00000000 00000000 20002100 00000000 -// GOTPLT-NEXT: 230020 20002100 00000000 20002100 00000000 -// GOTPLT-NEXT: 230030 20002100 00000000 +// GOTPLT-NEXT: 230410 00000000 00000000 00000000 00000000 +// GOTPLT-NEXT: 230420 00000000 00000000 f0022100 00000000 +// GOTPLT-NEXT: 230430 f0022100 00000000 f0022100 00000000 +// GOTPLT-NEXT: 230440 f0022100 00000000 // Check that the PLTRELSZ tag includes the IRELATIVE relocations // CHECK: DynamicSection [ @@ -32,46 +32,46 @@ // DISASM: Disassembly of section .text: // DISASM-EMPTY: // DISASM-NEXT: foo: -// DISASM-NEXT: 210000: ret +// DISASM-NEXT: 2102d8: ret // DISASM: bar: -// DISASM-NEXT: 210004: ret +// DISASM-NEXT: 2102dc: ret // DISASM: _start: -// DISASM-NEXT: 210008: bl #88 -// DISASM-NEXT: 21000c: bl #100 -// DISASM-NEXT: 210010: bl #48 -// DISASM-NEXT: 210014: bl #60 +// DISASM-NEXT: 2102e0: bl #80 +// DISASM-NEXT: 2102e4: bl #92 +// DISASM-NEXT: 2102e8: bl #40 +// DISASM-NEXT: 2102ec: bl #52 // DISASM-EMPTY: // DISASM-NEXT: Disassembly of section .plt: // DISASM-EMPTY: // DISASM-NEXT: .plt: -// DISASM-NEXT: 210020: stp x16, x30, [sp, #-16]! -// DISASM-NEXT: 210024: adrp x16, #131072 -// DISASM-NEXT: 210028: ldr x17, [x16, #16] -// DISASM-NEXT: 21002c: add x16, x16, #16 -// DISASM-NEXT: 210030: br x17 -// DISASM-NEXT: 210034: nop -// DISASM-NEXT: 210038: nop -// DISASM-NEXT: 21003c: nop +// DISASM-NEXT: 2102f0: stp x16, x30, [sp, #-16]! +// DISASM-NEXT: 2102f4: adrp x16, #131072 +// DISASM-NEXT: 2102f8: ldr x17, [x16, #1056] +// DISASM-NEXT: 2102fc: add x16, x16, #1056 +// DISASM-NEXT: 210300: br x17 +// DISASM-NEXT: 210304: nop +// DISASM-NEXT: 210308: nop +// DISASM-NEXT: 21030c: nop // DISASM-EMPTY: // DISASM-NEXT: bar2@plt: -// DISASM-NEXT: 210040: adrp x16, #131072 -// DISASM-NEXT: 210044: ldr x17, [x16, #24] -// DISASM-NEXT: 210048: add x16, x16, #24 -// DISASM-NEXT: 21004c: br x17 +// DISASM-NEXT: 210310: adrp x16, #131072 +// DISASM-NEXT: 210314: ldr x17, [x16, #1064] +// DISASM-NEXT: 210318: add x16, x16, #1064 +// DISASM-NEXT: 21031c: br x17 // DISASM-EMPTY: // DISASM-NEXT: zed2@plt: -// DISASM-NEXT: 210050: adrp x16, #131072 -// DISASM-NEXT: 210054: ldr x17, [x16, #32] -// DISASM-NEXT: 210058: add x16, x16, #32 -// DISASM-NEXT: 21005c: br x17 -// DISASM-NEXT: 210060: adrp x16, #131072 -// DISASM-NEXT: 210064: ldr x17, [x16, #40] -// DISASM-NEXT: 210068: add x16, x16, #40 -// DISASM-NEXT: 21006c: br x17 -// DISASM-NEXT: 210070: adrp x16, #131072 -// DISASM-NEXT: 210074: ldr x17, [x16, #48] -// DISASM-NEXT: 210078: add x16, x16, #48 -// DISASM-NEXT: 21007c: br x17 +// DISASM-NEXT: 210320: adrp x16, #131072 +// DISASM-NEXT: 210324: ldr x17, [x16, #1072] +// DISASM-NEXT: 210328: add x16, x16, #1072 +// DISASM-NEXT: 21032c: br x17 +// DISASM-NEXT: 210330: adrp x16, #131072 +// DISASM-NEXT: 210334: ldr x17, [x16, #1080] +// DISASM-NEXT: 210338: add x16, x16, #1080 +// DISASM-NEXT: 21033c: br x17 +// DISASM-NEXT: 210340: adrp x16, #131072 +// DISASM-NEXT: 210344: ldr x17, [x16, #1088] +// DISASM-NEXT: 210348: add x16, x16, #1088 +// DISASM-NEXT: 21034c: br x17 .text .type foo STT_GNU_IFUNC Index: test/ELF/aarch64-nopic-plt.s =================================================================== --- test/ELF/aarch64-nopic-plt.s +++ test/ELF/aarch64-nopic-plt.s @@ -19,7 +19,7 @@ // CHECK-NEXT: Section: Undefined // CHECK: Name: foo -// CHECK-NEXT: Value: 0x210030 +// CHECK-NEXT: Value: 0x2102F0 // CHECK-NEXT: Size: 0 // CHECK-NEXT: Binding: Global // CHECK-NEXT: Type: Function Index: test/ELF/aarch64-tls-gdie.s =================================================================== --- test/ELF/aarch64-tls-gdie.s +++ test/ELF/aarch64-tls-gdie.s @@ -21,14 +21,14 @@ // SEC-NEXT: SHF_ALLOC // SEC-NEXT: SHF_WRITE // SEC-NEXT: ] -// SEC-NEXT: Address: 0x2200B0 +// SEC-NEXT: Address: 0x220300 -// page(0x2200B0) - page(0x20004) = 65536 -// 0x0B0 = 176 +// page(0x220300) - page(0x21023c) = 65536 +// 0x23c = 768 // CHECK: _start: -// CHECK-NEXT: 210000: nop -// CHECK-NEXT: 210004: adrp x0, #65536 -// CHECK-NEXT: 210008: ldr x0, [x0, #176] -// CHECK-NEXT: 21000c: nop -// CHECK-NEXT: 210010: nop +// CHECK-NEXT: 210238: nop +// CHECK-NEXT: 21023c: adrp x0, #65536 +// CHECK-NEXT: 210240: ldr x0, [x0, #768] +// CHECK-NEXT: 210244: nop +// CHECK-NEXT: 210248: nop Index: test/ELF/aarch64-tls-gdle.s =================================================================== --- test/ELF/aarch64-tls-gdle.s +++ test/ELF/aarch64-tls-gdle.s @@ -11,10 +11,10 @@ # TCB size = 0x16 and foo is first element from TLS register. # CHECK-LABEL: _start: -# CHECK-NEXT: 210000: movz x0, #0, lsl #16 -# CHECK-NEXT: 210004: movk x0, #16 -# CHECK-NEXT: 210008: nop -# CHECK-NEXT: 21000c: nop +# CHECK-NEXT: 2101c8: movz x0, #0, lsl #16 +# CHECK-NEXT: 2101cc: movk x0, #16 +# CHECK-NEXT: 2101d0: nop +# CHECK-NEXT: 2101d4: nop .globl _start _start: Index: test/ELF/aarch64-tls-ie.s =================================================================== --- test/ELF/aarch64-tls-ie.s +++ test/ELF/aarch64-tls-ie.s @@ -14,8 +14,8 @@ # RELOC-NEXT: SHF_ALLOC # RELOC-NEXT: SHF_WRITE # RELOC-NEXT: ] -# RELOC-NEXT: Address: 0x2200B0 -# RELOC-NEXT: Offset: 0x200B0 +# RELOC-NEXT: Address: 0x220338 +# RELOC-NEXT: Offset: 0x338 # RELOC-NEXT: Size: 16 # RELOC-NEXT: Link: 0 # RELOC-NEXT: Info: 0 @@ -24,8 +24,8 @@ # RELOC-NEXT: } # RELOC: Relocations [ # RELOC-NEXT: Section ({{.*}}) .rela.dyn { -# RELOC-NEXT: 0x2200B8 R_AARCH64_TLS_TPREL64 bar 0x0 -# RELOC-NEXT: 0x2200B0 R_AARCH64_TLS_TPREL64 foo 0x0 +# RELOC-NEXT: 0x220340 R_AARCH64_TLS_TPREL64 bar 0x0 +# RELOC-NEXT: 0x220338 R_AARCH64_TLS_TPREL64 foo 0x0 # RELOC-NEXT: } # RELOC-NEXT:] @@ -34,10 +34,10 @@ ## Page(0x2200B8) - Page(0x210000) = 0x10000 = 65536 ## 0x2200B8 & 0xff8 = 0xB8 = 184 # CHECK: _start: -# CHECK-NEXT: 210000: adrp x0, #65536 -# CHECK-NEXT: 210004: ldr x0, [x0, #176] -# CHECK-NEXT: 210008: adrp x0, #65536 -# CHECK-NEXT: 21000c: ldr x0, [x0, #184] +# CHECK-NEXT: 210278: adrp x0, #65536 +# CHECK-NEXT: 21027c: ldr x0, [x0, #824] +# CHECK-NEXT: 210280: adrp x0, #65536 +# CHECK-NEXT: 210284: ldr x0, [x0, #832] .globl _start _start: Index: test/ELF/aarch64-tls-le.s =================================================================== --- test/ELF/aarch64-tls-le.s +++ test/ELF/aarch64-tls-le.s @@ -20,12 +20,12 @@ # TCB size = 0x16 and foo is first element from TLS register. #CHECK: Disassembly of section .text: #CHECK: _start: -#CHECK: 210000: 40 d0 3b d5 mrs x0, TPIDR_EL0 -#CHECK: 210004: 00 00 40 91 add x0, x0, #0, lsl #12 -#CHECK: 210008: 00 40 00 91 add x0, x0, #16 -#CHECK: 21000c: 40 d0 3b d5 mrs x0, TPIDR_EL0 -#CHECK: 210010: 00 fc 7f 91 add x0, x0, #4095, lsl #12 -#CHECK: 210014: 00 e0 3f 91 add x0, x0, #4088 +#CHECK: 210158: 40 d0 3b d5 mrs x0, TPIDR_EL0 +#CHECK: 21015c: 00 00 40 91 add x0, x0, #0, lsl #12 +#CHECK: 210160: 00 40 00 91 add x0, x0, #16 +#CHECK: 210164: 40 d0 3b d5 mrs x0, TPIDR_EL0 +#CHECK: 210168: 00 fc 7f 91 add x0, x0, #4095, lsl #12 +#CHECK: 21016c: 00 e0 3f 91 add x0, x0, #4088 .section .tbss,"awT",@nobits Index: test/ELF/basic-aarch64.s =================================================================== --- test/ELF/basic-aarch64.s +++ test/ELF/basic-aarch64.s @@ -26,7 +26,7 @@ # CHECK-NEXT: Version: 1 # CHECK-NEXT: Entry: [[ENTRY:0x[0-9A-F]+]] # CHECK-NEXT: ProgramHeaderOffset: 0x40 -# CHECK-NEXT: SectionHeaderOffset: 0x10098 +# CHECK-NEXT: SectionHeaderOffset: 0x1B8 # CHECK-NEXT: Flags [ (0x0) # CHECK-NEXT: ] # CHECK-NEXT: HeaderSize: 64 @@ -59,8 +59,8 @@ # CHECK-NEXT: SHF_ALLOC (0x2) # CHECK-NEXT: SHF_EXECINSTR (0x4) # CHECK-NEXT: ] -# CHECK-NEXT: Address: 0x210000 -# CHECK-NEXT: Offset: 0x10000 +# CHECK-NEXT: Address: 0x210120 +# CHECK-NEXT: Offset: 0x120 # CHECK-NEXT: Size: 12 # CHECK-NEXT: Link: 0 # CHECK-NEXT: Info: 0 @@ -76,7 +76,7 @@ # CHECK-NEXT: SHF_STRINGS (0x20) # CHECK-NEXT: ] # CHECK-NEXT: Address: 0x0 -# CHECK-NEXT: Offset: 0x1000C +# CHECK-NEXT: Offset: 0x12C # CHECK-NEXT: Size: 8 # CHECK-NEXT: Link: 0 # CHECK-NEXT: Info: 0 @@ -90,7 +90,7 @@ # CHECK-NEXT: Flags [ (0x0) # CHECK-NEXT: ] # CHECK-NEXT: Address: 0x0 -# CHECK-NEXT: Offset: 0x10018 +# CHECK-NEXT: Offset: 0x138 # CHECK-NEXT: Size: 72 # CHECK-NEXT: Link: 5 # CHECK-NEXT: Info: 2 @@ -104,7 +104,7 @@ # CHECK-NEXT: Flags [ (0x0) # CHECK-NEXT: ] # CHECK-NEXT: Address: 0x0 -# CHECK-NEXT: Offset: 0x10060 +# CHECK-NEXT: Offset: 0x180 # CHECK-NEXT: Size: 42 # CHECK-NEXT: Link: 0 # CHECK-NEXT: Info: 0 @@ -118,7 +118,7 @@ # CHECK-NEXT: Flags [ (0x0) # CHECK-NEXT: ] # CHECK-NEXT: Address: 0x0 -# CHECK-NEXT: Offset: 0x1008A +# CHECK-NEXT: Offset: 0x1AA # CHECK-NEXT: Size: 13 # CHECK-NEXT: Link: 0 # CHECK-NEXT: Info: 0 @@ -138,7 +138,7 @@ # CHECK-NEXT: } # CHECK-NEXT: Symbol { # CHECK-NEXT: Name: $x.0 -# CHECK-NEXT: Value: 0x210000 +# CHECK-NEXT: Value: 0x210120 # CHECK-NEXT: Size: 0 # CHECK-NEXT: Binding: Local (0x0) # CHECK-NEXT: Type: None (0x0) @@ -159,8 +159,8 @@ # CHECK-NEXT: ProgramHeader { # CHECK-NEXT: Type: PT_PHDR (0x6) # CHECK-NEXT: Offset: 0x40 -# CHECK-NEXT: VirtualAddress: 0x200040 -# CHECK-NEXT: PhysicalAddress: 0x200040 +# CHECK-NEXT: VirtualAddress: 0x210040 +# CHECK-NEXT: PhysicalAddress: 0x210040 # CHECK-NEXT: FileSize: 224 # CHECK-NEXT: MemSize: 224 # CHECK-NEXT: Flags [ (0x4) @@ -171,20 +171,20 @@ # CHECK-NEXT: ProgramHeader { # CHECK-NEXT: Type: PT_LOAD (0x1) # CHECK-NEXT: Offset: 0x0 -# CHECK-NEXT: VirtualAddress: 0x200000 -# CHECK-NEXT: PhysicalAddress: 0x200000 -# CHECK-NEXT: FileSize: 288 -# CHECK-NEXT: MemSize: 288 -# CHECK-NEXT: Flags [ -# CHECK-NEXT: PF_R -# CHECK-NEXT: ] -# CHECK-NEXT: Alignment: 65536 -# CHECK-NEXT: } -# CHECK-NEXT: ProgramHeader { -# CHECK-NEXT: Type: PT_LOAD (0x1) -# CHECK-NEXT: Offset: 0x1000 # CHECK-NEXT: VirtualAddress: 0x210000 # CHECK-NEXT: PhysicalAddress: 0x210000 +# CHECK-NEXT: FileSize: 288 +# CHECK-NEXT: MemSize: 288 +# CHECK-NEXT: Flags [ +# CHECK-NEXT: PF_R +# CHECK-NEXT: ] +# CHECK-NEXT: Alignment: 65536 +# CHECK-NEXT: } +# CHECK-NEXT: ProgramHeader { +# CHECK-NEXT: Type: PT_LOAD (0x1) +# CHECK-NEXT: Offset: 0x120 +# CHECK-NEXT: VirtualAddress: 0x210120 +# CHECK-NEXT: PhysicalAddress: 0x210120 # CHECK-NEXT: FileSize: 12 # CHECK-NEXT: MemSize: 12 # CHECK-NEXT: Flags [ (0x5) Index: test/ELF/plt-aarch64.s =================================================================== --- test/ELF/plt-aarch64.s +++ test/ELF/plt-aarch64.s @@ -17,7 +17,7 @@ // CHECKDSO-NEXT: SHF_ALLOC // CHECKDSO-NEXT: SHF_EXECINSTR // CHECKDSO-NEXT: ] -// CHECKDSO-NEXT: Address: 0x10010 +// CHECKDSO-NEXT: Address: 0x10390 // CHECKDSO-NEXT: Offset: // CHECKDSO-NEXT: Size: 80 // CHECKDSO-NEXT: Link: @@ -55,16 +55,16 @@ // .got.plt[0..2] = 0 (reserved) // .got.plt[3..5] = .plt = 0x10010 // DUMPDSO-NEXT: 30000 00000000 00000000 00000000 00000000 ................ -// DUMPDSO-NEXT: 30010 00000000 00000000 10000100 00000000 ................ -// DUMPDSO-NEXT: 30020 10000100 00000000 10000100 00000000 ................ +// DUMPDSO-NEXT: 30010 00000000 00000000 90030100 00000000 ................ +// DUMPDSO-NEXT: 30020 90030100 00000000 90030100 00000000 ................ // DISASMDSO: _start: -// 0x10030 - 0x10000 = 0x30 = 48 -// DISASMDSO-NEXT: 10000: 0c 00 00 14 b #48 -// 0x10040 - 0x10004 = 0x3c = 60 -// DISASMDSO-NEXT: 10004: 0f 00 00 14 b #60 -// 0x10050 - 0x10008 = 0x48 = 72 -// DISASMDSO-NEXT: 10008: 12 00 00 14 b #72 +// 0x103b0 - 0x10378 = 56 +// DISASMDSO-NEXT: 10378: 0c 00 00 14 b #56 +// 0x103c0 - 0x1037c = 60 +// DISASMDSO-NEXT: 1037c: 0f 00 00 14 b #60 +// 0x103d0 - 0x10380 = 72 +// DISASMDSO-NEXT: 10380: 12 00 00 14 b #72 // DISASMDSO: foo: // DISASMDSO-NEXT: 1000c: 1f 20 03 d5 nop @@ -88,7 +88,7 @@ // Page(0x30018) - Page(0x10030) = 0x30000 - 0x10000 = 0x20000 = 131072 // DISASMDSO-EMPTY: // DISASMDSO-NEXT: foo@plt: -// DISASMDSO-NEXT: 10030: 10 01 00 90 adrp x16, #131072 +// DISASMDSO-NEXT: 103b0: 10 01 00 90 adrp x16, #131072 // 0x3018 & 0xFFF = 0x18 = 24 // DISASMDSO-NEXT: 10034: 11 0e 40 f9 ldr x17, [x16, #24] // DISASMDSO-NEXT: 10038: 10 62 00 91 add x16, x16, #24 @@ -98,7 +98,7 @@ // Page(0x30020) - Page(0x10040) = 0x30000 - 0x10000 = 0x20000 = 131072 // DISASMDSO-EMPTY: // DISASMDSO-NEXT: bar@plt: -// DISASMDSO-NEXT: 10040: 10 01 00 90 adrp x16, #131072 +// DISASMDSO-NEXT: 103c0: 10 01 00 90 adrp x16, #131072 // 0x3020 & 0xFFF = 0x20 = 32 // DISASMDSO-NEXT: 10044: 11 12 40 f9 ldr x17, [x16, #32] // DISASMDSO-NEXT: 10048: 10 82 00 91 add x16, x16, #32 @@ -108,7 +108,7 @@ // Page(0x30028) - Page(0x10050) = 0x30000 - 0x10000 = 0x20000 = 131072 // DISASMDSO-EMPTY: // DISASMDSO-NEXT: weak@plt: -// DISASMDSO-NEXT: 10050: 10 01 00 90 adrp x16, #131072 +// DISASMDSO-NEXT: 103d0: 10 01 00 90 adrp x16, #131072 // 0x3028 & 0xFFF = 0x28 = 40 // DISASMDSO-NEXT: 10054: 11 16 40 f9 ldr x17, [x16, #40] // DISASMDSO-NEXT: 10058: 10 a2 00 91 add x16, x16, #40