Index: ELF/Writer.cpp =================================================================== --- ELF/Writer.cpp +++ ELF/Writer.cpp @@ -764,7 +764,7 @@ if (IsExec) { if (IsWrite) Rank |= RF_EXEC_WRITE; - else if (!Config->SingleRoRx) + else Rank |= RF_EXEC; } else { if (IsWrite) Index: test/ELF/aarch64-thunk-pi.s =================================================================== --- test/ELF/aarch64-thunk-pi.s +++ test/ELF/aarch64-thunk-pi.s @@ -16,8 +16,8 @@ bl high_target ret // CHECK: low_target: -// CHECK-NEXT: 0: 04 00 00 94 bl #16 -// CHECK-NEXT: 4: c0 03 5f d6 ret +// CHECK-NEXT: 8: 04 00 00 94 bl #16 +// CHECK-NEXT: c: c0 03 5f d6 ret .hidden low_target2 .globl low_target2 @@ -27,19 +27,19 @@ bl high_target2 ret // CHECK: low_target2: -// CHECK-NEXT: 8: 05 00 00 94 bl #20 -// CHECK-NEXT: c: c0 03 5f d6 ret +// CHECK-NEXT: 0: 05 00 00 94 bl #20 +// CHECK-NEXT: 4: c0 03 5f d6 ret // Expect range extension thunks for .text_low // adrp calculation is (PC + signed immediate) & (!0xfff) // CHECK: __AArch64ADRPThunk_high_target: -// CHECK-NEXT: 70: 10 00 08 90 adrp x16, #268435456 -// CHECK-NEXT: 74: 10 02 03 91 add x16, x16, #192 -// CHECK-NEXT: 78: 00 02 1f d6 br x16 +// CHECK-NEXT: e8: 10 00 08 90 adrp x16, #268435456 +// CHECK-NEXT: ec: 10 02 01 91 add x16, x16, #64 +// CHECK-NEXT: f0: 00 02 1f d6 br x16 // CHECK: __AArch64ADRPThunk_high_target2: -// CHECK-NEXT: 7c: 10 00 08 90 adrp x16, #268435456 -// CHECK-NEXT: 80: 10 22 00 91 add x16, x16, #8 -// CHECK-NEXT: 84: 00 02 1f d6 br x16 +// CHECK-NEXT: f4: 10 00 08 90 adrp x16, #268435456 +// CHECK-NEXT: f8: 10 22 00 91 add x16, x16, #8 +// CHECK-NEXT: fc: 00 02 1f d6 br x16 .section .text_high, "ax", %progbits @@ -50,7 +50,7 @@ bl low_target ret // CHECK: high_target: -// CHECK-NEXT: 10000000: 34 00 00 94 bl #208 +// CHECK-NEXT: 10000000: 14 00 00 94 bl #80 // CHECK-NEXT: 10000004: c0 03 5f d6 ret .hidden high_target2 @@ -68,24 +68,24 @@ // CHECK: __AArch64ADRPThunk_low_target2: // CHECK-NEXT: 10000010: 10 00 f8 90 adrp x16, #-268435456 -// CHECK-NEXT: 10000014: 10 a2 01 91 add x16, x16, #104 +// CHECK-NEXT: 10000014: 10 82 03 91 add x16, x16, #224 // CHECK-NEXT: 10000018: 00 02 1f d6 br x16 // CHECK: Disassembly of section .plt: // CHECK-NEXT: .plt: -// CHECK-NEXT: 100000a0: f0 7b bf a9 stp x16, x30, [sp, #-16]! -// CHECK-NEXT: 100000a4: 10 00 00 90 adrp x16, #0 -// CHECK-NEXT: 100000a8: 11 7a 40 f9 ldr x17, [x16, #240] -// CHECK-NEXT: 100000ac: 10 c2 03 91 add x16, x16, #240 -// CHECK-NEXT: 100000b0: 20 02 1f d6 br x17 -// CHECK-NEXT: 100000b4: 1f 20 03 d5 nop -// CHECK-NEXT: 100000b8: 1f 20 03 d5 nop -// CHECK-NEXT: 100000bc: 1f 20 03 d5 nop -// CHECK-NEXT: 100000c0: 10 00 00 90 adrp x16, #0 -// CHECK-NEXT: 100000c4: 11 7e 40 f9 ldr x17, [x16, #248] -// CHECK-NEXT: 100000c8: 10 e2 03 91 add x16, x16, #248 -// CHECK-NEXT: 100000cc: 20 02 1f d6 br x17 -// CHECK-NEXT: 100000d0: 10 00 00 90 adrp x16, #0 -// CHECK-NEXT: 100000d4: 11 82 40 f9 ldr x17, [x16, #256] -// CHECK-NEXT: 100000d8: 10 02 04 91 add x16, x16, #256 -// CHECK-NEXT: 100000dc: 20 02 1f d6 br x17 +// CHECK-NEXT: 10000020: f0 7b bf a9 stp x16, x30, [sp, #-16]! +// CHECK-NEXT: 10000024: 10 00 00 90 adrp x16, #0 +// CHECK-NEXT: 10000028: 11 3a 40 f9 ldr x17, [x16, #112] +// CHECK-NEXT: 1000002c: 10 c2 01 91 add x16, x16, #112 +// CHECK-NEXT: 10000030: 20 02 1f d6 br x17 +// CHECK-NEXT: 10000034: 1f 20 03 d5 nop +// CHECK-NEXT: 10000038: 1f 20 03 d5 nop +// CHECK-NEXT: 1000003c: 1f 20 03 d5 nop +// CHECK-NEXT: 10000040: 10 00 00 90 adrp x16, #0 +// CHECK-NEXT: 10000044: 11 3e 40 f9 ldr x17, [x16, #120] +// CHECK-NEXT: 10000048: 10 e2 01 91 add x16, x16, #120 +// CHECK-NEXT: 1000004c: 20 02 1f d6 br x17 +// CHECK-NEXT: 10000050: 10 00 00 90 adrp x16, #0 +// CHECK-NEXT: 10000054: 11 42 40 f9 ldr x17, [x16, #128] +// CHECK-NEXT: 10000058: 10 02 02 91 add x16, x16, #128 +// CHECK-NEXT: 1000005c: 20 02 1f d6 br x17 Index: test/ELF/eh-frame-padding-no-rosegment.s =================================================================== --- test/ELF/eh-frame-padding-no-rosegment.s +++ test/ELF/eh-frame-padding-no-rosegment.s @@ -7,6 +7,7 @@ .global bar .hidden bar bar: + ret // RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o @@ -37,8 +38,7 @@ // RUN: llvm-readobj -l --elf-output-style=GNU %t | FileCheck --check-prefix=PHDR %s // PHDR: Segment Sections -// PHDR: .text -// PHDR-SAME: .eh_frame +// PHDR: .eh_frame {{.*}}.text // Check that the CIE and FDE are padded with 0x00 and not 0xCC when the // .eh_frame section is placed in the executable segment @@ -58,7 +58,7 @@ // CHECK-NEXT: EntrySize: // CHECK-NEXT: SectionData ( // CHECK-NEXT: 0000: 1C000000 00000000 017A5052 00017810 -// CHECK-NEXT: 0010: 061BDAFF FFFF1B0C 07089001 00000000 -// CHECK-NEXT: 0020: 14000000 24000000 C4FFFFFF 00000000 +// CHECK-NEXT: 0010: 061B2A00 00001B0C 07089001 00000000 +// CHECK-NEXT: 0020: 14000000 24000000 14000000 00000000 // CHECK-NEXT: 0030: 00000000 00000000 // CHECK-NEXT: ) Index: test/ELF/linkerscript/no-space.s =================================================================== --- test/ELF/linkerscript/no-space.s +++ test/ELF/linkerscript/no-space.s @@ -3,11 +3,11 @@ # RUN: echo "SECTIONS {foo 0 : {*(foo*)} .dynsym : {*(.dynsym)} .dynstr : {*(.dynstr)} }" > %t.script # RUN: ld.lld --hash-style=sysv -o %t --script %t.script %t.o -shared -# RUN: llvm-readobj -elf-output-style=GNU -l %t | FileCheck %s +# RUN: llvm-readelf -l %t | FileCheck %s # RUN: echo "SECTIONS {foo : {*(foo*)} .dynsym : { *(.dynsym) } .dynstr : { *(.dynstr) } }" > %t.script # RUN: ld.lld --hash-style=sysv -o %t --script %t.script %t.o -shared -# RUN: llvm-readobj -elf-output-style=GNU -l %t | FileCheck %s +# RUN: llvm-readelf -l %t | FileCheck %s # There is not enough address space available for the header, so just start the PT_LOAD # after it. Don't create a PT_PHDR as the header is not allocated. @@ -18,7 +18,7 @@ # CHECK: Section to Segment mapping: # CHECK-NEXT: Segment Sections... -# CHECK-NEXT: 00 foo .text .hash .dynsym .dynstr +# CHECK-NEXT: 00 foo .hash .dynsym .dynstr .section foo, "a" .quad 0 Index: test/ELF/linkerscript/non-absolute.s =================================================================== --- test/ELF/linkerscript/non-absolute.s +++ test/ELF/linkerscript/non-absolute.s @@ -5,9 +5,10 @@ # RUN: llvm-objdump -d %t | FileCheck %s --check-prefix=DUMP # RUN: llvm-readobj -t %t | FileCheck %s --check-prefix=SYMBOL +# 0x94 - 169 = B = -0xf # DUMP: Disassembly of section .text: # DUMP-NEXT: foo: -# DUMP-NEXT: 50: {{.*}} -101(%rip), %eax +# DUMP-NEXT: 94: {{.*}} -169(%rip), %eax # SYMBOL: Symbol { # SYMBOL: Name: B Index: test/ELF/linkerscript/non-absolute2.test =================================================================== --- test/ELF/linkerscript/non-absolute2.test +++ test/ELF/linkerscript/non-absolute2.test @@ -13,6 +13,6 @@ # CHECK-NEXT: 0 00000000 0000000000000000 # CHECK-NEXT: 1 .dynsym 00000030 0000000000001000 # CHECK-NEXT: 2 .dynstr 00000003 0000000000001030 -# CHECK-NEXT: 3 .text 00000000 0000000000001034 +# CHECK: 5 .text 00000000 0000000000001070 # CHECK: 0000000000000001 .dynsym 00000000 A Index: test/ELF/linkerscript/non-alloc.s =================================================================== --- test/ELF/linkerscript/non-alloc.s +++ test/ELF/linkerscript/non-alloc.s @@ -1,9 +1,9 @@ # REQUIRES: x86 -# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t +# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o # RUN: echo "SECTIONS { .foo 0 : {*(foo)} }" > %t.script -# RUN: ld.lld --hash-style=sysv -o %t1 --script %t.script %t -shared -# RUN: llvm-readobj -elf-output-style=GNU -s -l %t1 | FileCheck %s +# RUN: ld.lld --hash-style=sysv -o %t --script %t.script %t.o -shared +# RUN: llvm-readelf -s -l %t | FileCheck %s # Test that we create all necessary PT_LOAD. We use to stop at the first # non-alloc, causing us to not create PT_LOAD for linker generated sections. @@ -15,7 +15,7 @@ # CHECK: Section to Segment mapping: # CHECK-NEXT: Segment Sections... -# CHECK-NEXT: 00 .dynsym .dynstr .text .hash +# CHECK-NEXT: 00 .dynsym .dynstr .hash .text # CHECK-NEXT: 01 .dynamic nop Index: test/ELF/linkerscript/orphan-first-cmd.test =================================================================== --- test/ELF/linkerscript/orphan-first-cmd.test +++ test/ELF/linkerscript/orphan-first-cmd.test @@ -17,4 +17,3 @@ # CHECK-NEXT: SHF_ALLOC # CHECK-NEXT: SHF_EXECINSTR # CHECK-NEXT: ] -# CHECK-NEXT: Address: 0x1038 Index: test/ELF/linkerscript/out-of-order.s =================================================================== --- test/ELF/linkerscript/out-of-order.s +++ test/ELF/linkerscript/out-of-order.s @@ -26,10 +26,10 @@ # CHECK-NEXT: 0 00000000 0000000000000000 # CHECK-NEXT: 1 .data 00000008 0000000000004000 # CHECK-NEXT: 2 .dynamic 00000060 0000000000004008 -# CHECK-NEXT: 3 .dynsym 00000018 0000000000002000 +# CHECK-NEXT: 3 .dynsym 00000018 0000000000002000 # CHECK-NEXT: 4 .dynstr 00000001 0000000000002018 -# CHECK-NEXT: 5 .text 00000008 000000000000201c -# CHECK-NEXT: 6 .hash 00000010 0000000000002024 +# CHECK-NEXT: 5 .hash 00000010 000000000000201c +# CHECK-NEXT: 6 .text 00000008 000000000000202c .quad 0 .data Index: test/ELF/linkerscript/section-metadata.s =================================================================== --- test/ELF/linkerscript/section-metadata.s +++ test/ELF/linkerscript/section-metadata.s @@ -10,15 +10,15 @@ # RUN: llvm-objdump -s %t | FileCheck --check-prefix=INV %s -# CHECK: Contents of section .text: -# CHECK-NEXT: 02000000 00000000 01000000 00000000 # CHECK: Contents of section .rodata: # CHECK-NEXT: 02000000 00000000 01000000 00000000 +# CHECK: Contents of section .text: +# CHECK-NEXT: 02000000 00000000 01000000 00000000 -# INV: Contents of section .text: -# INV-NEXT: 01000000 00000000 02000000 00000000 # INV: Contents of section .rodata: # INV-NEXT: 01000000 00000000 02000000 00000000 +# INV: Contents of section .text: +# INV-NEXT: 01000000 00000000 02000000 00000000 .global _start _start: Index: test/ELF/linkerscript/section-metadata2.s =================================================================== --- test/ELF/linkerscript/section-metadata2.s +++ test/ELF/linkerscript/section-metadata2.s @@ -7,20 +7,20 @@ # RUN: ld.lld --symbol-ordering-file %t.ord -o %t --script %t.script %t.o # RUN: llvm-objdump -s %t | FileCheck %s -# CHECK: Contents of section .text: -# CHECK-NEXT: 02000000 00000000 01000000 00000000 # CHECK: Contents of section .rodata: # CHECK-NEXT: 02000000 00000000 01000000 00000000 +# CHECK: Contents of section .text: +# CHECK-NEXT: 02000000 00000000 01000000 00000000 # RUN: echo "_foo" > %t.ord # RUN: echo "_bar" >> %t.ord # RUN: ld.lld --symbol-ordering-file %t.ord -o %t --script %t.script %t.o # RUN: llvm-objdump -s %t | FileCheck %s --check-prefix=INV -# INV: Contents of section .text: -# INV-NEXT: 01000000 00000000 02000000 00000000 # INV: Contents of section .rodata: # INV-NEXT: 01000000 00000000 02000000 00000000 +# INV: Contents of section .text: +# INV-NEXT: 01000000 00000000 02000000 00000000 .section .text.foo,"a",@progbits _foo: Index: test/ELF/linkerscript/sections-keep.s =================================================================== --- test/ELF/linkerscript/sections-keep.s +++ test/ELF/linkerscript/sections-keep.s @@ -1,14 +1,14 @@ # REQUIRES: x86 -# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t -# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %p/Inputs/keep.s -o %t2.o +# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o +# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %p/Inputs/keep.s -o %t1.o ## First check that section "keep" is garbage collected without using KEEP # RUN: echo "SECTIONS { \ # RUN: .text : { *(.text) } \ # RUN: .keep : { *(.keep) } \ # RUN: .temp : { *(.temp) }}" > %t.script -# RUN: ld.lld --gc-sections -o %t1 --script %t.script %t -# RUN: llvm-objdump -section-headers %t1 | \ +# RUN: ld.lld --gc-sections -o %t --script %t.script %t.o +# RUN: llvm-objdump -section-headers %t | \ # RUN: FileCheck -check-prefix=SECGC %s # SECGC: Sections: # SECGC-NEXT: Idx Name Size @@ -21,8 +21,8 @@ # RUN: .text : { *(.text) } \ # RUN: .keep : { KEEP(*(.keep)) } \ # RUN: .temp : { *(.temp) }}" > %t.script -# RUN: ld.lld --gc-sections -o %t1 --script %t.script %t -# RUN: llvm-objdump -section-headers %t1 | \ +# RUN: ld.lld --gc-sections -o %t --script %t.script %t.o +# RUN: llvm-objdump -section-headers %t | \ # RUN: FileCheck -check-prefix=SECNOGC %s # SECNOGC: Sections: # SECNOGC-NEXT: Idx Name Size @@ -38,14 +38,14 @@ # RUN: . = SIZEOF_HEADERS; \ # RUN: .keep : { KEEP(*(.keep)) } \ # RUN: .nokeep : { *(.keep) }}" > %t.script -# RUN: ld.lld --gc-sections -o %t1 --script %t.script %t -# RUN: llvm-objdump -section-headers %t1 | FileCheck -check-prefix=MIXED1 %s +# RUN: ld.lld --gc-sections -o %t --script %t.script %t.o +# RUN: llvm-objdump -section-headers %t | FileCheck -check-prefix=MIXED1 %s # MIXED1: Sections: # MIXED1-NEXT: Idx Name Size # MIXED1-NEXT: 0 00000000 # MIXED1-NEXT: 1 .keep 00000004 -# MIXED1-NEXT: 2 .text 00000007 00000000000000ec TEXT DATA -# MIXED1-NEXT: 3 .temp 00000004 00000000000000f3 DATA +# MIXED1-NEXT: 2 .temp 00000004 00000000000000ec +# MIXED1-NEXT: 3 .text 00000007 00000000000000f0 # MIXED1-NEXT: 4 .comment 00000008 0000000000000000 # MIXED1-NEXT: 5 .symtab 00000060 0000000000000000 # MIXED1-NEXT: 6 .shstrtab 00000036 0000000000000000 @@ -59,14 +59,14 @@ # RUN: . = SIZEOF_HEADERS; \ # RUN: .nokeep : { *(.keep) } \ # RUN: .keep : { KEEP(*(.keep)) }}" > %t.script -# RUN: ld.lld --gc-sections -o %t1 --script %t.script %t -# RUN: llvm-objdump -section-headers %t1 | FileCheck -check-prefix=MIXED2 %s +# RUN: ld.lld --gc-sections -o %t --script %t.script %t.o +# RUN: llvm-objdump -section-headers %t | FileCheck -check-prefix=MIXED2 %s # MIXED2: Sections: # MIXED2-NEXT: Idx Name Size # MIXED2-NEXT: 0 00000000 -# MIXED2-NEXT: 1 .nokeep 00000004 00000000000000e8 DATA -# MIXED2-NEXT: 2 .text 00000007 00000000000000ec TEXT DATA -# MIXED2-NEXT: 3 .temp 00000004 00000000000000f3 DATA +# MIXED2-NEXT: 1 .nokeep 00000004 00000000000000e8 +# MIXED2-NEXT: 2 .temp 00000004 00000000000000ec +# MIXED2-NEXT: 3 .text 00000007 00000000000000f0 # MIXED2-NEXT: 4 .comment 00000008 0000000000000000 # MIXED2-NEXT: 5 .symtab 00000060 0000000000000000 # MIXED2-NEXT: 6 .shstrtab 00000038 0000000000000000 @@ -75,10 +75,10 @@ # Check file pattern for kept sections. # RUN: echo "SECTIONS { \ # RUN: . = SIZEOF_HEADERS; \ -# RUN: .keep : { KEEP(*2.o(.keep)) } \ +# RUN: .keep : { KEEP(*1.o(.keep)) } \ # RUN: }" > %t.script -# RUN: ld.lld --gc-sections -o %t1 --script %t.script %t2.o %t -# RUN: llvm-objdump -s %t1 | FileCheck -check-prefix=FILEMATCH %s +# RUN: ld.lld --gc-sections -o %t --script %t.script %t1.o %t.o +# RUN: llvm-objdump -s %t | FileCheck -check-prefix=FILEMATCH %s # FILEMATCH: Contents of section .keep: # FILEMATCH-NEXT: 00e8 41414141 AAAA Index: test/ELF/linkerscript/sections-sort.s =================================================================== --- test/ELF/linkerscript/sections-sort.s +++ test/ELF/linkerscript/sections-sort.s @@ -13,11 +13,11 @@ .section foo, "a" .byte 0 -# CHECK: Id +# CHECK: Idx # CHECK-NEXT: 0 -# CHECK-NEXT: 1 .dynsym -# CHECK-NEXT: 2 .dynstr -# CHECK-NEXT: 3 .text +# CHECK-NEXT: 1 .text +# CHECK-NEXT: 2 .dynsym +# CHECK-NEXT: 3 .dynstr # CHECK-NEXT: 4 foo # CHECK-NEXT: 5 .hash # CHECK-NEXT: 6 .dynamic Index: test/ELF/linkerscript/sort-non-script.s =================================================================== --- test/ELF/linkerscript/sort-non-script.s +++ test/ELF/linkerscript/sort-non-script.s @@ -1,14 +1,14 @@ # REQUIRES: x86 -# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t +# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o # RUN: echo "SECTIONS { foo : {*(foo)} }" > %t.script -# RUN: ld.lld --hash-style=sysv -o %t1 --script %t.script %t -shared -# RUN: llvm-readobj -elf-output-style=GNU -s %t1 | FileCheck %s +# RUN: ld.lld --hash-style=sysv -o %t --script %t.script %t.o -shared +# RUN: llvm-readelf -s %t | FileCheck %s # CHECK: .dynsym {{.*}} A # CHECK-NEXT: .dynstr {{.*}} A -# CHECK-NEXT: .text {{.*}} AX # CHECK-NEXT: .hash {{.*}} A +# CHECK-NEXT: .text {{.*}} AX # CHECK-NEXT: foo {{.*}} WA # CHECK-NEXT: .dynamic {{.*}} WA Index: test/ELF/linkerscript/synthetic-symbols4.test =================================================================== --- test/ELF/linkerscript/synthetic-symbols4.test +++ test/ELF/linkerscript/synthetic-symbols4.test @@ -1,7 +1,7 @@ # REQUIRES: x86 -# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %p/Inputs/synthetic-symbols.s -o %t -# RUN: ld.lld -o %t.exe --eh-frame-hdr --script %s %t -# RUN: llvm-objdump -t %t.exe | FileCheck %s +# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %p/Inputs/synthetic-symbols.s -o %t.o +# RUN: ld.lld -o %t --eh-frame-hdr --script %s %t.o +# RUN: llvm-objdump -t %t | FileCheck %s SECTIONS { . = 0x201000; @@ -10,5 +10,5 @@ PROVIDE_HIDDEN(_end_sec = ADDR(.text) + SIZEOF(.text)); } -# CHECK: 0000000000201000 .text 00000000 .hidden _begin_sec -# CHECK-NEXT: 0000000000201001 .text 00000000 .hidden _end_sec +# CHECK: 0000000000201054 .text 00000000 .hidden _begin_sec +# CHECK-NEXT: 0000000000201055 .text 00000000 .hidden _end_sec Index: test/ELF/linkerscript/unused-synthetic.s =================================================================== --- test/ELF/linkerscript/unused-synthetic.s +++ test/ELF/linkerscript/unused-synthetic.s @@ -7,13 +7,13 @@ # RUN: }" > %t.script # RUN: ld.lld -shared -o %t.so --script %t.script %t.o -# RUN: llvm-objdump -section-headers %t.so | FileCheck %s +# RUN: llvm-readelf -s %t.so | FileCheck %s # CHECK-NOT: .got # CHECK-NOT: .plt # CHECK: .dynsym # CHECK-NEXT: .dynstr -# CHECK-NEXT: .text # CHECK-NEXT: .gnu.hash +# CHECK: .text # Test that the size of a removed unused synthetic input section is not added # to the output section size. Adding a symbol assignment prevents removal of Index: test/ELF/linkerscript/va.s =================================================================== --- test/ELF/linkerscript/va.s +++ test/ELF/linkerscript/va.s @@ -7,9 +7,9 @@ # CHECK: Sections: # CHECK-NEXT: Idx Name Size Address Type # CHECK-NEXT: 0 00000000 0000000000000000 -# CHECK-NEXT: 1 .text 00000001 0000000000000000 TEXT DATA -# CHECK-NEXT: 2 .foo 00000004 0000000000000001 DATA -# CHECK-NEXT: 3 .boo 00000004 0000000000000005 DATA +# CHECK-NEXT: 1 .foo 00000004 0000000000000000 DATA +# CHECK-NEXT: 2 .boo 00000004 0000000000000004 DATA +# CHECK-NEXT: 3 .text 00000001 0000000000000008 TEXT DATA .global _start _start: Index: test/ELF/mips-gp-ext.s =================================================================== --- test/ELF/mips-gp-ext.s +++ test/ELF/mips-gp-ext.s @@ -26,45 +26,45 @@ # REQUIRES: mips +# REL: Contents of section .reginfo: +# REL-NEXT: 0040 10000104 00000000 00000000 00000000 +# REL-NEXT: 0050 00000000 000001ec +# ^-- _gp + # REL: Contents of section .text: -# REL-NEXT: 0030 3c080000 2108010c 8f82ffcc +# REL-NEXT: 00e0 3c080000 2108010c 8f82ff1c # ^-- %hi(_gp_disp) # ^-- %lo(_gp_disp) # ^-- 8 - (0x13c - 0x100) # G - (GP - .got) -# REL: Contents of section .reginfo: -# REL-NEXT: 0058 10000104 00000000 00000000 00000000 -# REL-NEXT: 0068 00000000 0000013c -# ^-- _gp - # REL: Contents of section .data: # REL-NEXT: 00f0 fffffef4 # ^-- 0x30-0x13c # foo - GP -# REL: 00000030 .text 00000000 foo +# REL: 000000e0 .text 00000000 foo # REL: 00000000 *ABS* 00000000 .hidden _gp_disp -# REL: 0000013c *ABS* 00000000 .hidden _gp +# REL: 000001ec *ABS* 00000000 .hidden _gp + +# ABS: Contents of section .reginfo: +# ABS-NEXT: 0040 10000104 00000000 00000000 00000000 +# ABS-NEXT: 0050 00000000 00000200 +# ^-- _gp # ABS: Contents of section .text: -# ABS-NEXT: 0030 3c080000 210801d0 8f82ff08 +# ABS-NEXT: 00e0 3c080000 21080120 8f82ff08 # ^-- %hi(_gp_disp) # ^-- %lo(_gp_disp) # ^-- 8 - (0x200 - 0x100) # G - (GP - .got) -# ABS: Contents of section .reginfo: -# ABS-NEXT: 0058 10000104 00000000 00000000 00000000 -# ABS-NEXT: 0068 00000000 00000200 -# ^-- _gp - # ABS: Contents of section .data: -# ABS-NEXT: 00f0 fffffe30 -# ^-- 0x30-0x200 +# ABS-NEXT: 00f0 fffffee0 +# ^-- 0xe0-0x200 # foo - GP -# ABS: 00000030 .text 00000000 foo +# ABS: 000000e0 .text 00000000 foo # ABS: 00000000 *ABS* 00000000 .hidden _gp_disp # ABS: 00000200 *ABS* 00000000 .hidden _gp Index: test/ELF/synthetic-got.s =================================================================== --- test/ELF/synthetic-got.s +++ test/ELF/synthetic-got.s @@ -7,13 +7,13 @@ # RUN: | FileCheck %s --check-prefix=GOTDATA # GOT: Sections: -# GOT: 8 .got.plt 00000020 00000000000000d0 DATA -# GOT: 10 .got 00000008 00000000000001c0 DATA +# GOT: 8 .got.plt 00000020 00000000000000e0 DATA +# GOT: 10 .got 00000008 00000000000001d0 DATA # GOTDATA: Contents of section .got.plt: -# GOTDATA-NEXT: 00d0 f0000000 00000000 00000000 00000000 -# GOTDATA-NEXT: 00e0 00000000 00000000 c6000000 00000000 +# GOTDATA-NEXT: 00e0 00010000 00000000 00000000 00000000 +# GOTDATA-NEXT: 00f0 00000000 00000000 d6000000 00000000 # GOTDATA-NEXT: Contents of section .got: -# GOTDATA-NEXT: 01c0 00000000 00000000 +# GOTDATA-NEXT: 01d0 00000000 00000000 # RUN: echo "SECTIONS { .mygot : { *(.got) *(.got.plt) } }" > %t1.script # RUN: ld.lld --hash-style=sysv -shared %t.o -o %t1.out --script %t1.script @@ -21,12 +21,12 @@ # RUN: llvm-objdump -s -section=.mygot %t1.out | FileCheck %s --check-prefix=MYGOTDATA # MYGOT: Sections: -# MYGOT: 8 .mygot 00000028 00000000000000d0 DATA +# MYGOT: 8 .mygot 00000028 00000000000000e0 DATA # MYGOT-NOT: .got # MYGOT-NOT: .got.plt -# MYGOTDATA: 00d0 00000000 00000000 f8000000 00000000 -# MYGOTDATA-NEXT: 00e0 00000000 00000000 00000000 00000000 -# MYGOTDATA-NEXT: 00f0 c6000000 00000000 +# MYGOTDATA: 00e0 00000000 00000000 08010000 00000000 +# MYGOTDATA-NEXT: 00f0 00000000 00000000 00000000 00000000 +# MYGOTDATA-NEXT: 0100 d6000000 00000000 mov bar@gotpcrel(%rip), %rax call foo@plt Index: test/ELF/x86-64-retpoline-linkerscript.s =================================================================== --- test/ELF/x86-64-retpoline-linkerscript.s +++ test/ELF/x86-64-retpoline-linkerscript.s @@ -14,8 +14,8 @@ // CHECK: Disassembly of section .plt: // CHECK-NEXT: .plt: -// CHECK-NEXT: 10: ff 35 ea 00 00 00 pushq 234(%rip) -// CHECK-NEXT: 16: 4c 8b 1d eb 00 00 00 movq 235(%rip), %r11 +// CHECK-NEXT: 10: ff 35 72 00 00 00 pushq 114(%rip) +// CHECK-NEXT: 16: 4c 8b 1d 73 00 00 00 movq 115(%rip), %r11 // CHECK-NEXT: 1d: e8 0e 00 00 00 callq 14 <.plt+0x20> // CHECK-NEXT: 22: f3 90 pause // CHECK-NEXT: 24: 0f ae e8 lfence @@ -40,7 +40,7 @@ // CHECK-NEXT: 3d: cc int3 // CHECK-NEXT: 3e: cc int3 // CHECK-NEXT: 3f: cc int3 -// CHECK-NEXT: 40: 4c 8b 1d c9 00 00 00 movq 201(%rip), %r11 +// CHECK-NEXT: 40: 4c 8b 1d 51 00 00 00 movq 81(%rip), %r11 // CHECK-NEXT: 47: e8 e4 ff ff ff callq -28 <.plt+0x20> // CHECK-NEXT: 4c: e9 d1 ff ff ff jmp -47 <.plt+0x12> // CHECK-NEXT: 51: 68 00 00 00 00 pushq $0 @@ -50,7 +50,7 @@ // CHECK-NEXT: 5d: cc int3 // CHECK-NEXT: 5e: cc int3 // CHECK-NEXT: 5f: cc int3 -// CHECK-NEXT: 60: 4c 8b 1d b1 00 00 00 movq 177(%rip), %r11 +// CHECK-NEXT: 60: 4c 8b 1d 39 00 00 00 movq 57(%rip), %r11 // CHECK-NEXT: 67: e8 c4 ff ff ff callq -60 <.plt+0x20> // CHECK-NEXT: 6c: e9 b1 ff ff ff jmp -79 <.plt+0x12> // CHECK-NEXT: 71: 68 01 00 00 00 pushq $1 Index: test/ELF/x86-64-retpoline-znow-linkerscript.s =================================================================== --- test/ELF/x86-64-retpoline-znow-linkerscript.s +++ test/ELF/x86-64-retpoline-znow-linkerscript.s @@ -35,13 +35,13 @@ // CHECK-NEXT: 2d: cc int3 // CHECK-NEXT: 2e: cc int3 // CHECK-NEXT: 2f: cc int3 -// CHECK-NEXT: 30: 4c 8b 1d a9 00 00 00 movq 169(%rip), %r11 +// CHECK-NEXT: 30: 4c 8b 1d 31 00 00 00 movq 49(%rip), %r11 // CHECK-NEXT: 37: e9 d4 ff ff ff jmp -44 <.plt> // CHECK-NEXT: 3c: cc int3 // CHECK-NEXT: 3d: cc int3 // CHECK-NEXT: 3e: cc int3 // CHECK-NEXT: 3f: cc int3 -// CHECK-NEXT: 40: 4c 8b 1d a1 00 00 00 movq 161(%rip), %r11 +// CHECK-NEXT: 40: 4c 8b 1d 29 00 00 00 movq 41(%rip), %r11 // CHECK-NEXT: 47: e9 c4 ff ff ff jmp -60 <.plt> // CHECK-NEXT: 4c: cc int3 // CHECK-NEXT: 4d: cc int3