diff options
Diffstat (limited to 'ld/testsuite')
547 files changed, 8318 insertions, 1822 deletions
diff --git a/ld/testsuite/config/default.exp b/ld/testsuite/config/default.exp index 66721ff..9986397 100644 --- a/ld/testsuite/config/default.exp +++ b/ld/testsuite/config/default.exp @@ -117,12 +117,18 @@ if {![info exists CC_FOR_TARGET]} { if {![info exists CFLAGS_FOR_TARGET]} { set CFLAGS_FOR_TARGET "-g -O2" } +if {![info exists CFLAGS_FOR_TARGET_TEST]} { + set CFLAGS_FOR_TARGET_TEST "" +} if {![info exists CXX_FOR_TARGET]} { set CXX_FOR_TARGET [find_g++] } if {![info exists CXXFLAGS_FOR_TARGET]} { set CXXFLAGS_FOR_TARGET "" } +if {![info exists CXXFLAGS_FOR_TARGET_TEST]} { + set CXXFLAGS_FOR_TARGET_TEST "" +} # This allows us to run the linker testsuite with clang as the compilation # driver instead of gcc. The syntax of the overrides are as follows, one @@ -185,10 +191,13 @@ if {[istarget mips64*-*-linux*] && } if { [istarget rx-*-*] } { - global ASFLAGS set ASFLAGS "-muse-conventional-section-names" } +if { [istarget ia64-*-*] } { + set ASFLAGS "-x" +} + # Blackfin ELF targets require selection of an explicit CPU. Use the sim. if {[istarget bfin*-elf*]} { append gcc_B_opt " -msim" @@ -447,6 +456,22 @@ if { ![info exists NOPIE_CFLAGS] || ![info exists NOPIE_LDFLAGS] } then { } } +if { ![info exists DIRECT_EXTERN_ACCESS_CFLAGS] } then { + set DIRECT_EXTERN_ACCESS_CFLAGS "" + set NO_DIRECT_EXTERN_ACCESS_CFLAGS "" + # Exclude LoongArch since -mdirect-extern-access on LoongArch works + # only without dynamic linker. + if { ![istarget loongarch*-*-*] } { + if [compiler_supports "-mdirect-extern-access"] { + set DIRECT_EXTERN_ACCESS_CFLAGS "-mdirect-extern-access" + set NO_DIRECT_EXTERN_ACCESS_CFLAGS "-mno-direct-extern-access" + } elseif [compiler_supports "-fdirect-access-external-data"] { + set DIRECT_EXTERN_ACCESS_CFLAGS "-fdirect-access-external-data" + set NO_DIRECT_EXTERN_ACCESS_CFLAGS "-fno-direct-access-external-data" + } + } +} + if { ![info exists NOCF_PROTECTION_CFLAGS] } then { set NOCF_PROTECTION_CFLAGS "" if [compiler_supports "-fcf-protection=none"] { @@ -538,10 +563,11 @@ if { [check_compiler_available] } { } } -if {[file exists .libs/libdep.so]} { - set dep_plug_opt "--plugin .libs/libdep.so" -} elseif {[file exists .libs/libdep.dll]} { - set dep_plug_opt "--plugin .libs/libdep.dll" -} else { - set dep_plug_opt "" +set dep_plug_opt "" +if [check_plugin_api_available] { + if {[file exists .libs/libdep.so]} { + set dep_plug_opt "--plugin .libs/libdep.so" + } elseif {[file exists .libs/libdep.dll]} { + set dep_plug_opt "--plugin .libs/libdep.dll" + } } diff --git a/ld/testsuite/ld-aarch64/aarch64-elf.exp b/ld/testsuite/ld-aarch64/aarch64-elf.exp index 4de498f..8d56beb 100644 --- a/ld/testsuite/ld-aarch64/aarch64-elf.exp +++ b/ld/testsuite/ld-aarch64/aarch64-elf.exp @@ -376,6 +376,10 @@ run_dump_test_lp64 "variant_pcs-r" run_dump_test_lp64 "variant_pcs-shared" run_dump_test_lp64 "variant_pcs-now" +run_dump_test_lp64 "mte-tagged-frame" +run_dump_test_lp64 "dt-memtag-mode" +run_dump_test_lp64 "dt-memtag-stack" + set aarch64elflinktests { {"ld-aarch64/so with global symbol" "-shared" "" "" {copy-reloc-so.s} {} "copy-reloc-so.so"} diff --git a/ld/testsuite/ld-aarch64/aarch64.ld b/ld/testsuite/ld-aarch64/aarch64.ld index 75ee3b5..765ddf5 100644 --- a/ld/testsuite/ld-aarch64/aarch64.ld +++ b/ld/testsuite/ld-aarch64/aarch64.ld @@ -3,17 +3,23 @@ OUTPUT_ARCH(aarch64) ENTRY(_start) SECTIONS { - /* Read-only sections, merged into text segment: */ - PROVIDE (__executable_start = 0x8000); . = 0x8000; - .text : + PROVIDE (__executable_start = 0x8000); + . = SEGMENT_START("text-segment", 0x8000) + SIZEOF_HEADERS; + /* Start of the executable code region. */ + . = 0x9000; + .plt : ALIGN(16) { *(.plt) *(.iplt) } + . = 0x10000; + .text : { *(.before) *(.text) *(.after) } =0 - . = 0x9000; - .got : { *(.got) *(.got.plt)} . = 0x12340000; - .far : { *(.far) } - .ARM.attributes 0 : { *(.ARM.atttributes) } + .far : { *(.far) } + /* Start of the Read Write Data region. */ + . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); + .got : { *(.got) *(.got.plt)} + /* Start of the metadata region. */ + .ARM.attributes 0 : { KEEP (*(.ARM.attributes)) } } diff --git a/ld/testsuite/ld-aarch64/dt-memtag-mode.d b/ld/testsuite/ld-aarch64/dt-memtag-mode.d new file mode 100644 index 0000000..21670bc --- /dev/null +++ b/ld/testsuite/ld-aarch64/dt-memtag-mode.d @@ -0,0 +1,7 @@ +#source: dt-memtag.s +#ld: -shared -z memtag-mode=async +#readelf: -d + +#... + 0x0000000070000009 \(AARCH64_MEMTAG_MODE\) 0x1 +#... diff --git a/ld/testsuite/ld-aarch64/dt-memtag-stack.d b/ld/testsuite/ld-aarch64/dt-memtag-stack.d new file mode 100644 index 0000000..242f61f --- /dev/null +++ b/ld/testsuite/ld-aarch64/dt-memtag-stack.d @@ -0,0 +1,7 @@ +#source: dt-memtag.s +#ld: -shared -z memtag-stack +#readelf: -d + +#... + 0x000000007000000c \(AARCH64_MEMTAG_STACK\) 0x1 +#... diff --git a/ld/testsuite/ld-aarch64/dt-memtag.s b/ld/testsuite/ld-aarch64/dt-memtag.s new file mode 100644 index 0000000..51f3ba5 --- /dev/null +++ b/ld/testsuite/ld-aarch64/dt-memtag.s @@ -0,0 +1,7 @@ +// Test DT_AARCH64_MEMTAG_MODE. + +.text +.p2align 3 +.global foo +foo: +.xword foo diff --git a/ld/testsuite/ld-aarch64/gc-got-relocs.d b/ld/testsuite/ld-aarch64/gc-got-relocs.d index 6525d10..a1821c3 100644 --- a/ld/testsuite/ld-aarch64/gc-got-relocs.d +++ b/ld/testsuite/ld-aarch64/gc-got-relocs.d @@ -12,15 +12,14 @@ .*: file format elf64-(little|big)aarch64 SYMBOL TABLE: -0+8000 l d \.text 0+ \.text -0+0000 l df \*ABS\* 0+ .* -0+8000 g \.text 0+ _start +0+10000 l d \.text 0+ \.text +0+00000 l df \*ABS\* 0+ .* +0+10000 g \.text 0+ _start Contents of section .text: - 8000 1f2003d5 .* + 10000 1f2003d5 .* -Disassembly of section .text: - -0+8000 \<_start>: - 8000: d503201f nop +Disassembly of section \.text: +0+10000 \<_start>: + 10000: d503201f nop diff --git a/ld/testsuite/ld-aarch64/gc-plt-relocs.d b/ld/testsuite/ld-aarch64/gc-plt-relocs.d index 5c9b5fe..ac455f8 100644 --- a/ld/testsuite/ld-aarch64/gc-plt-relocs.d +++ b/ld/testsuite/ld-aarch64/gc-plt-relocs.d @@ -13,36 +13,36 @@ .*: file format elf64-(little|big)aarch64 DYNAMIC SYMBOL TABLE: -0+8000 g DF \.text 0+4 _start -0+0000 D \*UND\* 0+ foo -0+8008 g DF \.text 0+ bar +0+10000 g DF \.text 0+4 _start +0+00000 D \*UND\* 0+ foo +0+10008 g DF \.text 0+ bar + +Disassembly of section \.plt: + +0+9000 \<\.plt\>: + 9000: a9bf7bf0 stp x16, x30, \[sp, #-16\]! + 9004: f00919b0 adrp x16, 12340000 \<_GLOBAL_OFFSET_TABLE_\> + 9008: f9400e11 ldr x17, \[x16, #24\] + 900c: 91006210 add x16, x16, #0x18 + 9010: d61f0220 br x17 + 9014: d503201f nop + 9018: d503201f nop + 901c: d503201f nop + 9020: f00919b0 adrp x16, 12340000 \<_GLOBAL_OFFSET_TABLE_\> + 9024: f9401211 ldr x17, \[x16, #32\] + 9028: 91008210 add x16, x16, #0x20 + 902c: d61f0220 br x17 Disassembly of section .text: -0+8000 \<_start\>: - 8000: 9400000c bl 8030 \<.*> - -0+8004 \<hidfn\>: - 8004: 8a000000 and x0, x0, x0 - -0+8008 \<bar\>: - 8008: 14000001 b 800c \<foo\> - -0+800c \<foo\>: - 800c: 97fffffe bl 8004 \<hidfn\> - -Disassembly of section .plt: - -0+8010 \<\.plt\>: - 8010: a9bf7bf0 stp x16, x30, \[sp, #-16\]! - 8014: b0000010 adrp x16, 9000 .* - 8018: f9400e11 ldr x17, \[x16, #24\] - 801c: 91006210 add x16, x16, #0x18 - 8020: d61f0220 br x17 - 8024: d503201f nop - 8028: d503201f nop - 802c: d503201f nop - 8030: b0000010 adrp x16, 9000 .* - 8034: f9401211 ldr x17, \[x16, #32\] - 8038: 91008210 add x16, x16, #0x20 - 803c: d61f0220 br x17 +0+10000 \<_start\>: + 10000: 97ffe408 bl 9020 \<\.plt\+0x20> + +0+10004 \<hidfn\>: + 10004: 8a000000 and x0, x0, x0 + +0+10008 \<bar\>: + 10008: 14000001 b 1000c \<foo\> + +0+1000c \<foo\>: + 1000c: 97fffffe bl 10004 \<hidfn\> diff --git a/ld/testsuite/ld-aarch64/gc-relocs-257-dyn.d b/ld/testsuite/ld-aarch64/gc-relocs-257-dyn.d index 56fcfa4..2e5e4c6 100644 --- a/ld/testsuite/ld-aarch64/gc-relocs-257-dyn.d +++ b/ld/testsuite/ld-aarch64/gc-relocs-257-dyn.d @@ -13,5 +13,5 @@ Disassembly of section .text: -0+8000 \<_start\>: - 8000: d503201f nop +0+10000 \<_start\>: + 10000: d503201f nop diff --git a/ld/testsuite/ld-aarch64/gc-relocs-257.d b/ld/testsuite/ld-aarch64/gc-relocs-257.d index ffa7571..022b407 100644 --- a/ld/testsuite/ld-aarch64/gc-relocs-257.d +++ b/ld/testsuite/ld-aarch64/gc-relocs-257.d @@ -12,5 +12,5 @@ Disassembly of section .text: -0+8000 \<_start\>: - 8000: d503201f nop +0+10000 \<_start\>: + 10000: d503201f nop diff --git a/ld/testsuite/ld-aarch64/gc-tls-relocs.d b/ld/testsuite/ld-aarch64/gc-tls-relocs.d index 38637dc..2f2210c 100644 --- a/ld/testsuite/ld-aarch64/gc-tls-relocs.d +++ b/ld/testsuite/ld-aarch64/gc-tls-relocs.d @@ -13,15 +13,15 @@ .*: file format elf64-(little|big)aarch64 SYMBOL TABLE: -0+8000 l d \.text 0+ \.text -0+0000 l df \*ABS\* 0+ .* -0+8000 g \.text 0+ _start +0+10000 l d \.text 0+ \.text +0+00000 l df \*ABS\* 0+ .* +0+10000 g \.text 0+ _start Contents of section .text: - 8000 1f2003d5 .* + 10000 1f2003d5 .* -Disassembly of section .text: +Disassembly of section \.text: -0+8000 \<_start>: - 8000: d503201f nop +0+10000 \<_start>: + 10000: d503201f nop diff --git a/ld/testsuite/ld-aarch64/mte-tagged-frame-bar.s b/ld/testsuite/ld-aarch64/mte-tagged-frame-bar.s new file mode 100644 index 0000000..0bd5619 --- /dev/null +++ b/ld/testsuite/ld-aarch64/mte-tagged-frame-bar.s @@ -0,0 +1,17 @@ + .text + .global bar + .type bar, %function +bar: + .cfi_startproc + .cfi_mte_tagged_frame + stp x19, x20, [sp, -144]! + .cfi_def_cfa_offset 144 + .cfi_offset 19, -144 + .cfi_offset 20, -136 + ldp x19, x20, [sp], 144 + .cfi_restore 20 + .cfi_restore 19 + .cfi_def_cfa_offset 0 + ret + .cfi_endproc + .size bar, .-bar diff --git a/ld/testsuite/ld-aarch64/mte-tagged-frame-foo.s b/ld/testsuite/ld-aarch64/mte-tagged-frame-foo.s new file mode 100644 index 0000000..af5a8c4 --- /dev/null +++ b/ld/testsuite/ld-aarch64/mte-tagged-frame-foo.s @@ -0,0 +1,16 @@ + .text + .global foo + .type foo, %function +foo: + .cfi_startproc + stp x19, x20, [sp, -32]! + .cfi_def_cfa_offset 32 + .cfi_offset 19, -32 + .cfi_offset 20, -16 + ldp x19, x20, [sp], 32 + .cfi_restore 20 + .cfi_restore 19 + .cfi_def_cfa_offset 0 + ret + .cfi_endproc + .size foo, .-foo diff --git a/ld/testsuite/ld-aarch64/mte-tagged-frame.d b/ld/testsuite/ld-aarch64/mte-tagged-frame.d new file mode 100644 index 0000000..dd667fe --- /dev/null +++ b/ld/testsuite/ld-aarch64/mte-tagged-frame.d @@ -0,0 +1,35 @@ +#source: mte-tagged-frame-foo.s +#source: mte-tagged-frame-bar.s +#ld: -shared +#objdump: -Wf +#name: MTE tagged EH Frame FDE + +#... +Contents of the .eh_frame section: + +00000000 0000000000000010 00000000 CIE + Version: 1 + Augmentation: "zR" + Code alignment factor: 4 + Data alignment factor: -8 + Return address column: 30 + Augmentation data: 1b + DW_CFA_def_cfa: r31 \(sp\) ofs 0 + +00000014 0000000000000020 00000018 FDE cie=00000000 pc=[a-f0-9]+\.\.[a-f0-9]+ +#... + +00000038 0000000000000014 00000000 CIE + Version: 1 + Augmentation: "zRG" + Code alignment factor: 4 + Data alignment factor: -8 + Return address column: 30 + Augmentation data: 1b + DW_CFA_def_cfa: r31 \(sp\) ofs 0 + DW_CFA_nop + DW_CFA_nop + DW_CFA_nop + +00000050 000000000000001c 0000001c FDE cie=00000038 pc=[a-f0-9]+\.\.[a-f0-9]+ +#... diff --git a/ld/testsuite/ld-aarch64/protections/bti-and-memory-seal-plt-1-a.d b/ld/testsuite/ld-aarch64/protections/bti-and-memory-seal-plt-1-a.d new file mode 100644 index 0000000..7409525 --- /dev/null +++ b/ld/testsuite/ld-aarch64/protections/bti-and-memory-seal-plt-1-a.d @@ -0,0 +1,45 @@ +#name: No '-z force-bti' with '-z memory-seal' with feature properties (BTI) forces the generation of BTI PLT (shared) +#source: bti-plt-1.s +#source: bti-plt-2.s +#target: [check_shared_lib_support] +#as: -mabi=lp64 -defsym __property_bti__=1 +#ld: -shared -z memory-seal -T bti-plt.ld -L./tmpdir -lbti-plt-so +#objdump: -dr -j .plt + +[^:]*: *file format elf64-.*aarch64 + +Disassembly of section \.plt: + +[0-9]+ <\.plt>: +.*: d503245f bti c +.*: a9bf7bf0 stp x16, x30, \[sp, #-16\]! +.*: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_> +.*: f9400e11 ldr x17, \[x16, #24\] +.*: 91006210 add x16, x16, #0x18 +.*: d61f0220 br x17 +.*: d503201f nop +.*: d503201f nop + +[0-9]+ <.*>: +.*: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_> +.*: f9401211 ldr x17, \[x16, #32\] +.*: 91008210 add x16, x16, #0x20 +.*: d61f0220 br x17 + +[0-9]+ <.*>: +.*: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_> +.*: f9401611 ldr x17, \[x16, #40\] +.*: 9100a210 add x16, x16, #0x28 +.*: d61f0220 br x17 + +[0-9]+ <.*>: +.*: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_> +.*: f9401a11 ldr x17, \[x16, #48\] +.*: 9100c210 add x16, x16, #0x30 +.*: d61f0220 br x17 + +[0-9]+ <.*>: +.*: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_> +.*: f9401e11 ldr x17, \[x16, #56\] +.*: 9100e210 add x16, x16, #0x38 +.*: d61f0220 br x17 diff --git a/ld/testsuite/ld-aarch64/protections/bti-and-memory-seal-plt-1-b.d b/ld/testsuite/ld-aarch64/protections/bti-and-memory-seal-plt-1-b.d new file mode 100644 index 0000000..0dadcc9 --- /dev/null +++ b/ld/testsuite/ld-aarch64/protections/bti-and-memory-seal-plt-1-b.d @@ -0,0 +1,14 @@ +#name: No '-z force-bti' with '-z memory-seal' all input objects have BTI emits BTI feature (shared) +#source: bti-plt-1.s +#source: bti-plt-2.s +#target: [check_shared_lib_support] +#as: -mabi=lp64 -defsym __property_bti__=1 +#ld: -z memory-seal -shared -T bti-plt.ld +#readelf: -n + +Displaying notes found in: .note.gnu.property +[ ]+Owner[ ]+Data size[ ]+Description + GNU 0x00000018 NT_GNU_PROPERTY_TYPE_0 + Properties: memory seal\s +\s+AArch64 feature: BTI +#pass diff --git a/ld/testsuite/ld-aarch64/protections/bti-far-1.d b/ld/testsuite/ld-aarch64/protections/bti-far-1.d index 63fbb43..eb295cf 100644 --- a/ld/testsuite/ld-aarch64/protections/bti-far-1.d +++ b/ld/testsuite/ld-aarch64/protections/bti-far-1.d @@ -13,7 +13,7 @@ Disassembly of section \.plt: 0000000000018000 <\.plt>: 18000: d503245f bti c 18004: a9bf7bf0 stp x16, x30, \[sp, #-16\]! - 18008: 900000d0 adrp x16, 30000 <_GLOBAL_OFFSET_TABLE_> + 18008: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_> 1800c: f9400e11 ldr x17, \[x16, #24\] 18010: 91006210 add x16, x16, #0x18 18014: d61f0220 br x17 @@ -21,7 +21,7 @@ Disassembly of section \.plt: 1801c: d503201f nop 0000000000018020 <foo@plt>: - 18020: 900000d0 adrp x16, 30000 <_GLOBAL_OFFSET_TABLE_> + 18020: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_> 18024: f9401211 ldr x17, \[x16, #32\] 18028: 91008210 add x16, x16, #0x20 1802c: d61f0220 br x17 diff --git a/ld/testsuite/ld-aarch64/protections/bti-far-opt.d b/ld/testsuite/ld-aarch64/protections/bti-far-opt.d index cb293b6..f5038c0 100644 --- a/ld/testsuite/ld-aarch64/protections/bti-far-opt.d +++ b/ld/testsuite/ld-aarch64/protections/bti-far-opt.d @@ -13,7 +13,7 @@ Disassembly of section \.plt: 0000000000018000 <\.plt>: 18000: d503245f bti c 18004: a9bf7bf0 stp x16, x30, \[sp, #-16\]! - 18008: 900000d0 adrp x16, 30000 <_GLOBAL_OFFSET_TABLE_> + 18008: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_> 1800c: f9400e11 ldr x17, \[x16, #24\] 18010: 91006210 add x16, x16, #0x18 18014: d61f0220 br x17 @@ -21,7 +21,7 @@ Disassembly of section \.plt: 1801c: d503201f nop 0000000000018020 <foo@plt>: - 18020: 900000d0 adrp x16, 30000 <_GLOBAL_OFFSET_TABLE_> + 18020: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_> 18024: f9401211 ldr x17, \[x16, #32\] 18028: 91008210 add x16, x16, #0x20 1802c: d61f0220 br x17 diff --git a/ld/testsuite/ld-aarch64/protections/bti-far.ld b/ld/testsuite/ld-aarch64/protections/bti-far.ld index 214b8cb..d3ed904 100644 --- a/ld/testsuite/ld-aarch64/protections/bti-far.ld +++ b/ld/testsuite/ld-aarch64/protections/bti-far.ld @@ -2,14 +2,28 @@ OUTPUT_ARCH(aarch64) ENTRY(_start) SECTIONS { + PROVIDE(__executable_start = 0x8000); + . = SEGMENT_START("text-segment", 0x8000) + SIZEOF_HEADERS; + /* Start of the executable code region. */ + .hash : { *(.hash) } + .gnu.hash : { *(.gnu.hash) } + .dynsym : { *(.dynsym) } + .dynstr : { *(.dynstr) } . = 0x10000; - .rela.plt : { *(.rela.plt) *(.rela.iplt) } + .rela.dyn : { *(.rela.ifunc) } + .rela.plt : { *(.rela.plt) *(.rela.iplt) } . = 0x18000; - .plt : { *(.plt) *(.iplt) } + .plt : { *(.plt) *(.iplt) } . = 0x20000; - .text : { *(.text) } - . = 0x30000; - .got : { *(.got) *(.got.plt) } + .text : { *(.text) } . = 0x12340000; - .far : { *(.far) } + .far : { *(.far) } + /* Start of the Read Only Data region. */ + .note.gnu.property : { *(.note.gnu.property) } + + /* Start of the Read Write Data region. */ + . = ALIGN (CONSTANT (MAXPAGESIZE)); + .got : { *(.got) *(.got.plt) } + /* Start of the metadata region. */ + .ARM.attributes 0 : { KEEP (*(.ARM.attributes)) } } diff --git a/ld/testsuite/ld-aarch64/protections/bti-pac-plt-1-a.d b/ld/testsuite/ld-aarch64/protections/bti-pac-plt-1-a.d index 96268d3..4ab1ca8 100644 --- a/ld/testsuite/ld-aarch64/protections/bti-pac-plt-1-a.d +++ b/ld/testsuite/ld-aarch64/protections/bti-pac-plt-1-a.d @@ -11,7 +11,7 @@ Disassembly of section \.plt: [0-9a-f]+ <\.plt>: .*: a9bf7bf0 stp x16, x30, \[sp, #-16\]! -.*: 90000090 adrp x16, 28000 <_GLOBAL_OFFSET_TABLE_> +.*: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_> .*: f9400e11 ldr x17, \[x16, #24\] .*: 91006210 add x16, x16, #0x18 .*: d61f0220 br x17 @@ -20,13 +20,13 @@ Disassembly of section \.plt: .*: d503201f nop [0-9a-f]+ <.*>: -.*: 90000090 adrp x16, 28000 <_GLOBAL_OFFSET_TABLE_> +.*: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_> .*: f9401211 ldr x17, \[x16, #32\] .*: 91008210 add x16, x16, #0x20 .*: d61f0220 br x17 [0-9a-f]+ <.*>: -.*: 90000090 adrp x16, 28000 <_GLOBAL_OFFSET_TABLE_> +.*: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_> .*: f9401611 ldr x17, \[x16, #40\] .*: 9100a210 add x16, x16, #0x28 .*: d61f0220 br x17 diff --git a/ld/testsuite/ld-aarch64/protections/bti-pac-plt-1-b.d b/ld/testsuite/ld-aarch64/protections/bti-pac-plt-1-b.d index 041bf22..ef744e1 100644 --- a/ld/testsuite/ld-aarch64/protections/bti-pac-plt-1-b.d +++ b/ld/testsuite/ld-aarch64/protections/bti-pac-plt-1-b.d @@ -16,7 +16,7 @@ Disassembly of section \.plt: [0-9a-f]+ <\.plt>: .*: d503245f bti c .*: a9bf7bf0 stp x16, x30, \[sp, #-16\]! -.*: 90000090 adrp x16, 28000 <_GLOBAL_OFFSET_TABLE_> +.*: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_> .*: f9400e11 ldr x17, \[x16, #24\] .*: 91006210 add x16, x16, #0x18 .*: d61f0220 br x17 @@ -24,13 +24,13 @@ Disassembly of section \.plt: .*: d503201f nop [0-9a-f]+ <.*>: -.*: 90000090 adrp x16, 28000 <_GLOBAL_OFFSET_TABLE_> +.*: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_> .*: f9401211 ldr x17, \[x16, #32\] .*: 91008210 add x16, x16, #0x20 .*: d61f0220 br x17 [0-9a-f]+ <.*>: -.*: 90000090 adrp x16, 28000 <_GLOBAL_OFFSET_TABLE_> +.*: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_> .*: f9401611 ldr x17, \[x16, #40\] .*: 9100a210 add x16, x16, #0x28 .*: d61f0220 br x17 diff --git a/ld/testsuite/ld-aarch64/protections/bti-pac-plt-2-a.d b/ld/testsuite/ld-aarch64/protections/bti-pac-plt-2-a.d index f1ae3cd..0e87bcc 100644 --- a/ld/testsuite/ld-aarch64/protections/bti-pac-plt-2-a.d +++ b/ld/testsuite/ld-aarch64/protections/bti-pac-plt-2-a.d @@ -12,7 +12,7 @@ Disassembly of section \.plt: [0-9a-f]+ <\.plt>: .*: d503245f bti c .*: a9bf7bf0 stp x16, x30, \[sp, #-16\]! -.*: 90000090 adrp x16, 28000 <_GLOBAL_OFFSET_TABLE_> +.*: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_> .*: f9400e11 ldr x17, \[x16, #24\] .*: 91006210 add x16, x16, #0x18 .*: d61f0220 br x17 @@ -20,7 +20,7 @@ Disassembly of section \.plt: .*: d503201f nop [0-9a-f]+ <.*>: -.*: 90000090 adrp x16, 28000 <_GLOBAL_OFFSET_TABLE_> +.*: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_> .*: f9401211 ldr x17, \[x16, #32\] .*: 91008210 add x16, x16, #0x20 .*: d503219f autia1716 @@ -28,7 +28,7 @@ Disassembly of section \.plt: .*: d503201f nop [0-9a-f]+ <.*>: -.*: 90000090 adrp x16, 28000 <_GLOBAL_OFFSET_TABLE_> +.*: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_> .*: f9401611 ldr x17, \[x16, #40\] .*: 9100a210 add x16, x16, #0x28 .*: d503219f autia1716 diff --git a/ld/testsuite/ld-aarch64/protections/bti-pac-plt-2-b.d b/ld/testsuite/ld-aarch64/protections/bti-pac-plt-2-b.d index 69ccaab..199585c 100644 --- a/ld/testsuite/ld-aarch64/protections/bti-pac-plt-2-b.d +++ b/ld/testsuite/ld-aarch64/protections/bti-pac-plt-2-b.d @@ -12,7 +12,7 @@ Disassembly of section \.plt: [0-9]+ <\.plt>: .*: d503245f bti c .*: a9bf7bf0 stp x16, x30, \[sp, #-16\]! -.*: 90000090 adrp x16, 28000 <_GLOBAL_OFFSET_TABLE_> +.*: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_> .*: f9400e11 ldr x17, \[x16, #24\] .*: 91006210 add x16, x16, #0x18 .*: d61f0220 br x17 @@ -21,7 +21,7 @@ Disassembly of section \.plt: [0-9]+ <.*>: .*: d503245f bti c -.*: 90000090 adrp x16, 28000 <_GLOBAL_OFFSET_TABLE_> +.*: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_> .*: f9401211 ldr x17, \[x16, #32\] .*: 91008210 add x16, x16, #0x20 .*: d503219f autia1716 @@ -29,7 +29,7 @@ Disassembly of section \.plt: [0-9]+ <.*>: .*: d503245f bti c -.*: 90000090 adrp x16, 28000 <_GLOBAL_OFFSET_TABLE_> +.*: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_> .*: f9401611 ldr x17, \[x16, #40\] .*: 9100a210 add x16, x16, #0x28 .*: d503219f autia1716 diff --git a/ld/testsuite/ld-aarch64/protections/bti-pac-plt-3-a.d b/ld/testsuite/ld-aarch64/protections/bti-pac-plt-3-a.d index c0c0bdb..1789a98 100644 --- a/ld/testsuite/ld-aarch64/protections/bti-pac-plt-3-a.d +++ b/ld/testsuite/ld-aarch64/protections/bti-pac-plt-3-a.d @@ -12,7 +12,7 @@ Disassembly of section \.plt: [0-9a-f]+ <\.plt>: .*: d503245f bti c .*: a9bf7bf0 stp x16, x30, \[sp, #-16\]! -.*: 90000090 adrp x16, 28000 <_GLOBAL_OFFSET_TABLE_> +.*: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_> .*: f9400e11 ldr x17, \[x16, #24\] .*: 91006210 add x16, x16, #0x18 .*: d61f0220 br x17 @@ -20,7 +20,7 @@ Disassembly of section \.plt: .*: d503201f nop [0-9a-f]+ <.*>: -.*: 90000090 adrp x16, 28000 <_GLOBAL_OFFSET_TABLE_> +.*: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_> .*: f9401211 ldr x17, \[x16, #32\] .*: 91008210 add x16, x16, #0x20 .*: d503219f autia1716 @@ -28,7 +28,7 @@ Disassembly of section \.plt: .*: d503201f nop [0-9a-f]+ <.*>: -.*: 90000090 adrp x16, 28000 <_GLOBAL_OFFSET_TABLE_> +.*: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_> .*: f9401611 ldr x17, \[x16, #40\] .*: 9100a210 add x16, x16, #0x28 .*: d503219f autia1716 diff --git a/ld/testsuite/ld-aarch64/protections/bti-pac-plt-3-b.d b/ld/testsuite/ld-aarch64/protections/bti-pac-plt-3-b.d index 89a08ae..a0643ab 100644 --- a/ld/testsuite/ld-aarch64/protections/bti-pac-plt-3-b.d +++ b/ld/testsuite/ld-aarch64/protections/bti-pac-plt-3-b.d @@ -12,7 +12,7 @@ Disassembly of section \.plt: [0-9]+ <\.plt>: .*: d503245f bti c .*: a9bf7bf0 stp x16, x30, \[sp, #-16\]! -.*: 90000090 adrp x16, 28000 <_GLOBAL_OFFSET_TABLE_> +.*: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_> .*: f9400e11 ldr x17, \[x16, #24\] .*: 91006210 add x16, x16, #0x18 .*: d61f0220 br x17 @@ -21,7 +21,7 @@ Disassembly of section \.plt: [0-9]+ <.*>: .*: d503245f bti c -.*: 90000090 adrp x16, 28000 <_GLOBAL_OFFSET_TABLE_> +.*: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_> .*: f9401211 ldr x17, \[x16, #32\] .*: 91008210 add x16, x16, #0x20 .*: d503219f autia1716 @@ -29,7 +29,7 @@ Disassembly of section \.plt: [0-9]+ <.*>: .*: d503245f bti c -.*: 90000090 adrp x16, 28000 <_GLOBAL_OFFSET_TABLE_> +.*: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_> .*: f9401611 ldr x17, \[x16, #40\] .*: 9100a210 add x16, x16, #0x28 .*: d503219f autia1716 diff --git a/ld/testsuite/ld-aarch64/protections/bti-plt-1-a.d b/ld/testsuite/ld-aarch64/protections/bti-plt-1-a.d index 2dc3864..89c0abc 100644 --- a/ld/testsuite/ld-aarch64/protections/bti-plt-1-a.d +++ b/ld/testsuite/ld-aarch64/protections/bti-plt-1-a.d @@ -12,7 +12,7 @@ Disassembly of section \.plt: [0-9]+ <\.plt>: .*: d503245f bti c .*: a9bf7bf0 stp x16, x30, \[sp, #-16\]! -.*: 90000090 adrp x16, 28000 <_GLOBAL_OFFSET_TABLE_> +.*: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_> .*: f9400e11 ldr x17, \[x16, #24\] .*: 91006210 add x16, x16, #0x18 .*: d61f0220 br x17 @@ -20,13 +20,13 @@ Disassembly of section \.plt: .*: d503201f nop [0-9]+ <.*>: -.*: 90000090 adrp x16, 28000 <_GLOBAL_OFFSET_TABLE_> +.*: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_> .*: f9401211 ldr x17, \[x16, #32\] .*: 91008210 add x16, x16, #0x20 .*: d61f0220 br x17 [0-9]+ <.*>: -.*: 90000090 adrp x16, 28000 <_GLOBAL_OFFSET_TABLE_> +.*: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_> .*: f9401611 ldr x17, \[x16, #40\] .*: 9100a210 add x16, x16, #0x28 .*: d61f0220 br x17 diff --git a/ld/testsuite/ld-aarch64/protections/bti-plt-1-b.d b/ld/testsuite/ld-aarch64/protections/bti-plt-1-b.d index 1bf956c..c889c1c 100644 --- a/ld/testsuite/ld-aarch64/protections/bti-plt-1-b.d +++ b/ld/testsuite/ld-aarch64/protections/bti-plt-1-b.d @@ -2,7 +2,7 @@ #source: bti-plt-1.s #target: [check_shared_lib_support] #as: -mabi=lp64 -defsym __property_bti__=1 -#ld: -shared -z force-bti -T bti-plt.ld -L./tmpdir -lbti-plt-so +#ld: -shared -T bti-plt.ld -L./tmpdir -lbti-plt-so #objdump: -dr -j .plt [^:]*: *file format elf64-.*aarch64 @@ -12,7 +12,7 @@ Disassembly of section \.plt: [0-9]+ <\.plt>: .*: d503245f bti c .*: a9bf7bf0 stp x16, x30, \[sp, #-16\]! -.*: 90000090 adrp x16, 28000 <_GLOBAL_OFFSET_TABLE_> +.*: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_> .*: f9400e11 ldr x17, \[x16, #24\] .*: 91006210 add x16, x16, #0x18 .*: d61f0220 br x17 @@ -20,13 +20,13 @@ Disassembly of section \.plt: .*: d503201f nop [0-9]+ <.*>: -.*: 90000090 adrp x16, 28000 <_GLOBAL_OFFSET_TABLE_> +.*: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_> .*: f9401211 ldr x17, \[x16, #32\] .*: 91008210 add x16, x16, #0x20 .*: d61f0220 br x17 [0-9]+ <.*>: -.*: 90000090 adrp x16, 28000 <_GLOBAL_OFFSET_TABLE_> +.*: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_> .*: f9401611 ldr x17, \[x16, #40\] .*: 9100a210 add x16, x16, #0x28 .*: d61f0220 br x17 diff --git a/ld/testsuite/ld-aarch64/protections/bti-plt-1-c.d b/ld/testsuite/ld-aarch64/protections/bti-plt-1-c.d index 2fd0dea..c200b0c 100644 --- a/ld/testsuite/ld-aarch64/protections/bti-plt-1-c.d +++ b/ld/testsuite/ld-aarch64/protections/bti-plt-1-c.d @@ -13,7 +13,7 @@ Disassembly of section \.plt: [0-9]+ <\.plt>: .*: d503245f bti c .*: a9bf7bf0 stp x16, x30, \[sp, #-16\]! -.*: 90000090 adrp x16, 28000 <_GLOBAL_OFFSET_TABLE_> +.*: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_> .*: f9400e11 ldr x17, \[x16, #24\] .*: 91006210 add x16, x16, #0x18 .*: d61f0220 br x17 @@ -21,13 +21,13 @@ Disassembly of section \.plt: .*: d503201f nop [0-9]+ <.*>: -.*: 90000090 adrp x16, 28000 <_GLOBAL_OFFSET_TABLE_> +.*: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_> .*: f9401211 ldr x17, \[x16, #32\] .*: 91008210 add x16, x16, #0x20 .*: d61f0220 br x17 [0-9]+ <.*>: -.*: 90000090 adrp x16, 28000 <_GLOBAL_OFFSET_TABLE_> +.*: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_> .*: f9401611 ldr x17, \[x16, #40\] .*: 9100a210 add x16, x16, #0x28 .*: d61f0220 br x17 diff --git a/ld/testsuite/ld-aarch64/protections/bti-plt-3.d b/ld/testsuite/ld-aarch64/protections/bti-plt-3.d index e457bab..48db434 100644 --- a/ld/testsuite/ld-aarch64/protections/bti-plt-3.d +++ b/ld/testsuite/ld-aarch64/protections/bti-plt-3.d @@ -12,7 +12,7 @@ Disassembly of section \.plt: [0-9]+ <\.plt>: .*: d503245f bti c .*: a9bf7bf0 stp x16, x30, \[sp, #-16\]! -.*: 90000090 adrp x16, 28000 <_GLOBAL_OFFSET_TABLE_> +.*: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_> .*: f9400e11 ldr x17, \[x16, #24\] .*: 91006210 add x16, x16, #0x18 .*: d61f0220 br x17 @@ -21,7 +21,7 @@ Disassembly of section \.plt: [0-9]+ <.*>: .*: d503245f bti c -.*: 90000090 adrp x16, 28000 <_GLOBAL_OFFSET_TABLE_> +.*: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_> .*: f9401211 ldr x17, \[x16, #32\] .*: 91008210 add x16, x16, #0x20 .*: d61f0220 br x17 @@ -29,7 +29,7 @@ Disassembly of section \.plt: [0-9]+ <.*>: .*: d503245f bti c -.*: 90000090 adrp x16, 28000 <_GLOBAL_OFFSET_TABLE_> +.*: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_> .*: f9401611 ldr x17, \[x16, #40\] .*: 9100a210 add x16, x16, #0x28 .*: d61f0220 br x17 diff --git a/ld/testsuite/ld-aarch64/protections/bti-plt.ld b/ld/testsuite/ld-aarch64/protections/bti-plt.ld index 8682623..fffb8a98 100644 --- a/ld/testsuite/ld-aarch64/protections/bti-plt.ld +++ b/ld/testsuite/ld-aarch64/protections/bti-plt.ld @@ -2,13 +2,26 @@ OUTPUT_ARCH(aarch64) ENTRY(_start) SECTIONS { + PROVIDE(__executable_start = 0x8000); + . = SEGMENT_START("text-segment", 0x8000) + SIZEOF_HEADERS; + /* Start of the executable code region. */ + .hash : { *(.hash) } + .gnu.hash : { *(.gnu.hash) } + .dynsym : { *(.dynsym) } + .dynstr : { *(.dynstr) } . = 0x10000; - .rela.plt : { *(.rela.plt) *(.rela.iplt) } + .rela.dyn : { *(.rela.ifunc) } + .rela.plt : { *(.rela.plt) *(.rela.iplt) } . = 0x18000; - .plt : { *(.plt) *(.iplt) } + .plt : { *(.plt) *(.iplt) } . = 0x20000; - .text : { *(.text) } - . = 0x28000; - .got : { *(.got) *(.got.plt) } - .ARM.attributes 0 : { *(.ARM.atttributes) } + .text : { *(.text) } + /* Start of the Read Only Data region. */ + .note.gnu.property : { *(.note.gnu.property) } + + /* Start of the Read Write Data region. */ + . = ALIGN (CONSTANT (MAXPAGESIZE)); + .got : { *(.got) *(.got.plt) } + /* Start of the metadata region. */ + .ARM.attributes 0 : { KEEP (*(.ARM.attributes)) } } diff --git a/ld/testsuite/ld-aarch64/protections/pac-plt-1-a.d b/ld/testsuite/ld-aarch64/protections/pac-plt-1-a.d index fc10ec7..203cb12 100644 --- a/ld/testsuite/ld-aarch64/protections/pac-plt-1-a.d +++ b/ld/testsuite/ld-aarch64/protections/pac-plt-1-a.d @@ -11,7 +11,7 @@ Disassembly of section \.plt: [0-9]+ <.*>: .*: a9bf7bf0 stp x16, x30, \[sp, #-16\]! -.*: 90000090 adrp x16, 28000 <_GLOBAL_OFFSET_TABLE_> +.*: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_> .*: f9400e11 ldr x17, \[x16, #24\] .*: 91006210 add x16, x16, #0x18 .*: d61f0220 br x17 @@ -20,7 +20,7 @@ Disassembly of section \.plt: .*: d503201f nop [0-9]+ <.*>: -.*: 90000090 adrp x16, 28000 <_GLOBAL_OFFSET_TABLE_> +.*: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_> .*: f9401211 ldr x17, \[x16, #32\] .*: 91008210 add x16, x16, #0x20 .*: d503219f autia1716 @@ -28,7 +28,7 @@ Disassembly of section \.plt: .*: d503201f nop [0-9]+ <.*>: -.*: 90000090 adrp x16, 28000 <_GLOBAL_OFFSET_TABLE_> +.*: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_> .*: f9401611 ldr x17, \[x16, #40\] .*: 9100a210 add x16, x16, #0x28 .*: d503219f autia1716 diff --git a/ld/testsuite/ld-aarch64/protections/pac-plt-1-b.d b/ld/testsuite/ld-aarch64/protections/pac-plt-1-b.d index 7a0fd59..6592689 100644 --- a/ld/testsuite/ld-aarch64/protections/pac-plt-1-b.d +++ b/ld/testsuite/ld-aarch64/protections/pac-plt-1-b.d @@ -15,7 +15,7 @@ Disassembly of section \.plt: [0-9a-f]+ <\.plt>: .*: a9bf7bf0 stp x16, x30, \[sp, #-16\]! -.*: 90000090 adrp x16, 28000 <_GLOBAL_OFFSET_TABLE_> +.*: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_> .*: f9400e11 ldr x17, \[x16, #24\] .*: 91006210 add x16, x16, #0x18 .*: d61f0220 br x17 @@ -24,13 +24,13 @@ Disassembly of section \.plt: .*: d503201f nop [0-9a-f]+ <.*>: -.*: 90000090 adrp x16, 28000 <_GLOBAL_OFFSET_TABLE_> +.*: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_> .*: f9401211 ldr x17, \[x16, #32\] .*: 91008210 add x16, x16, #0x20 .*: d61f0220 br x17 [0-9a-f]+ <.*>: -.*: 90000090 adrp x16, 28000 <_GLOBAL_OFFSET_TABLE_> +.*: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_> .*: f9401611 ldr x17, \[x16, #40\] .*: 9100a210 add x16, x16, #0x28 .*: d61f0220 br x17 diff --git a/ld/testsuite/ld-aarch64/protections/pac-plt-2.d b/ld/testsuite/ld-aarch64/protections/pac-plt-2.d index 1c3d7f4..6795645 100644 --- a/ld/testsuite/ld-aarch64/protections/pac-plt-2.d +++ b/ld/testsuite/ld-aarch64/protections/pac-plt-2.d @@ -9,7 +9,7 @@ Disassembly of section \.plt: .* \<.plt\>: .*: a9bf7bf0 stp x16, x30, \[sp, #-16\]! -.*: 90000090 adrp x16, 28000 <_GLOBAL_OFFSET_TABLE_> +.*: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_> .*: f9401a11 ldr x17, \[x16, #48\] .*: 9100c210 add x16, x16, #0x30 .*: d61f0220 br x17 @@ -19,7 +19,7 @@ Disassembly of section \.plt: .* \<__tls_get_addr@plt\>: -.*: 90000090 adrp x16, 28000 <_GLOBAL_OFFSET_TABLE_> +.*: [[:xdigit:]]{8} adrp x16, [[:xdigit:]]+ <_GLOBAL_OFFSET_TABLE_> .*: f9401e11 ldr x17, \[x16, #56\] .*: 9100e210 add x16, x16, #0x38 .*: d503219f autia1716 diff --git a/ld/testsuite/ld-aarch64/relocs-ilp32.ld b/ld/testsuite/ld-aarch64/relocs-ilp32.ld index 4ddba91..3958ad8 100644 --- a/ld/testsuite/ld-aarch64/relocs-ilp32.ld +++ b/ld/testsuite/ld-aarch64/relocs-ilp32.ld @@ -15,7 +15,7 @@ SECTIONS .got : { *(.got) *(.got.plt)} . = 0x12340000; .far : { *(.far) } - .ARM.attributes 0 : { *(.ARM.atttributes) } + .ARM.attributes 0 : { *(.ARM.attributes) } /* Providing a .data section triggers a non-executable segment to be generated, which gives somewhere else for the linker to put the TLS segment without creating a RWX permissioned one. */ diff --git a/ld/testsuite/ld-aarch64/relocs.ld b/ld/testsuite/ld-aarch64/relocs.ld index 77adac8..b0e75e0 100644 --- a/ld/testsuite/ld-aarch64/relocs.ld +++ b/ld/testsuite/ld-aarch64/relocs.ld @@ -15,7 +15,7 @@ SECTIONS .got : { *(.got) *(.got.plt)} . = 0x12340000; .far : { *(.far) } - .ARM.attributes 0 : { *(.ARM.atttributes) } + .ARM.attributes 0 : { *(.ARM.attributes) } /* Providing a .data section triggers a non-executable segment to be generated, which gives somewhere else for the linker to put the TLS segment without creating a RWX permissioned one. */ diff --git a/ld/testsuite/ld-aarch64/sframe-simple-1.d b/ld/testsuite/ld-aarch64/sframe-simple-1.d index 6ab8c2a..1ae73de 100644 --- a/ld/testsuite/ld-aarch64/sframe-simple-1.d +++ b/ld/testsuite/ld-aarch64/sframe-simple-1.d @@ -11,7 +11,8 @@ Contents of the SFrame section .sframe: Header : Version: SFRAME_VERSION_2 - Flags: SFRAME_F_FDE_SORTED + Flags: SFRAME_F_FDE_SORTED, + SFRAME_F_FDE_FUNC_START_PCREL Num FDEs: 2 Num FREs: 2 diff --git a/ld/testsuite/ld-aarch64/variant_pcs-now.d b/ld/testsuite/ld-aarch64/variant_pcs-now.d index 5007632..1add2bb 100644 --- a/ld/testsuite/ld-aarch64/variant_pcs-now.d +++ b/ld/testsuite/ld-aarch64/variant_pcs-now.d @@ -4,65 +4,65 @@ #ld: -shared --hash-style=sysv -T variant_pcs.ld -z now #readelf: -rsW -Relocation section '\.rela\.plt' at offset 0x11000 contains 12 entries: +Relocation section '\.rela\.plt' at offset 0x[[:xdigit:]]+ contains 12 entries: Offset Info Type Symbol's Value Symbol's Name \+ Addend -0000000000009020 0000000100000402 R_AARCH64_JUMP_SLOT 0000000000000000 f_base_global_default_undef \+ 0 -0000000000009028 0000000200000402 R_AARCH64_JUMP_SLOT 0000000000000000 f_spec_global_default_undef \+ 0 -0000000000009030 0000000400000402 R_AARCH64_JUMP_SLOT 0000000000008000 f_base_global_default_def \+ 0 -0000000000009038 0000000500000402 R_AARCH64_JUMP_SLOT 0000000000008000 f_spec_global_default_def \+ 0 -0000000000009040 0000000000000408 R_AARCH64_IRELATIVE 8000 -0000000000009048 0000000300000402 R_AARCH64_JUMP_SLOT f_spec_global_default_ifunc\(\) f_spec_global_default_ifunc \+ 0 -0000000000009050 0000000000000408 R_AARCH64_IRELATIVE 8000 -0000000000009058 0000000600000402 R_AARCH64_JUMP_SLOT f_base_global_default_ifunc\(\) f_base_global_default_ifunc \+ 0 -0000000000009060 0000000000000408 R_AARCH64_IRELATIVE 8038 -0000000000009068 0000000000000408 R_AARCH64_IRELATIVE 8000 -0000000000009070 0000000000000408 R_AARCH64_IRELATIVE 8000 -0000000000009078 0000000000000408 R_AARCH64_IRELATIVE 8038 +00000000000[[:xdigit:]]{2}020 0000000100000402 R_AARCH64_JUMP_SLOT 0000000000000000 f_base_global_default_undef \+ 0 +00000000000[[:xdigit:]]{2}028 0000000200000402 R_AARCH64_JUMP_SLOT 0000000000000000 f_spec_global_default_undef \+ 0 +00000000000[[:xdigit:]]{2}030 0000000400000402 R_AARCH64_JUMP_SLOT 0000000000011000 f_base_global_default_def \+ 0 +00000000000[[:xdigit:]]{2}038 0000000500000402 R_AARCH64_JUMP_SLOT 0000000000011000 f_spec_global_default_def \+ 0 +00000000000[[:xdigit:]]{2}040 0000000000000408 R_AARCH64_IRELATIVE 11000 +00000000000[[:xdigit:]]{2}048 0000000300000402 R_AARCH64_JUMP_SLOT f_spec_global_default_ifunc\(\) f_spec_global_default_ifunc \+ 0 +00000000000[[:xdigit:]]{2}050 0000000000000408 R_AARCH64_IRELATIVE 11000 +00000000000[[:xdigit:]]{2}058 0000000600000402 R_AARCH64_JUMP_SLOT f_base_global_default_ifunc\(\) f_base_global_default_ifunc \+ 0 +00000000000[[:xdigit:]]{2}060 0000000000000408 R_AARCH64_IRELATIVE 11038 +00000000000[[:xdigit:]]{2}068 0000000000000408 R_AARCH64_IRELATIVE 11000 +00000000000[[:xdigit:]]{2}070 0000000000000408 R_AARCH64_IRELATIVE 11000 +00000000000[[:xdigit:]]{2}078 0000000000000408 R_AARCH64_IRELATIVE 11038 Symbol table '\.dynsym' contains 7 entries: Num: Value Size Type Bind Vis Ndx Name - 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND + 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND\s 1: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND f_base_global_default_undef 2: 0000000000000000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] UND f_spec_global_default_undef - 3: 0000000000008000 0 IFUNC GLOBAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_default_ifunc - 4: 0000000000008000 0 NOTYPE GLOBAL DEFAULT 1 f_base_global_default_def - 5: 0000000000008000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_default_def - 6: 0000000000008000 0 IFUNC GLOBAL DEFAULT 1 f_base_global_default_ifunc + 3: 0000000000011000 0 IFUNC GLOBAL DEFAULT \[VARIANT_PCS\] 6 f_spec_global_default_ifunc + 4: 0000000000011000 0 NOTYPE GLOBAL DEFAULT 6 f_base_global_default_def + 5: 0000000000011000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] 6 f_spec_global_default_def + 6: 0000000000011000 0 IFUNC GLOBAL DEFAULT 6 f_base_global_default_ifunc Symbol table '\.symtab' contains 35 entries: Num: Value Size Type Bind Vis Ndx Name - 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND - 1: 0000000000008000 0 SECTION LOCAL DEFAULT 1.* - 2: 0000000000008070 0 SECTION LOCAL DEFAULT 2.* - 3: 0000000000009000 0 SECTION LOCAL DEFAULT 3.* - 4: 0000000000009080 0 SECTION LOCAL DEFAULT 4.* - 5: 0000000000011000 0 SECTION LOCAL DEFAULT 5.* - 6: 0000000000011120 0 SECTION LOCAL DEFAULT 6.* - 7: 00000000000111c8 0 SECTION LOCAL DEFAULT 7.* - 8: 0000000000011270 0 SECTION LOCAL DEFAULT 8.* + 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND\s + 1: 00000000000080e8 0 SECTION LOCAL DEFAULT 1 \.hash + 2: 0000000000008118 0 SECTION LOCAL DEFAULT 2 \.dynsym + 3: 00000000000081c0 0 SECTION LOCAL DEFAULT 3 \.dynstr + 4: 0000000000009000 0 SECTION LOCAL DEFAULT 4 \.rela\.plt + 5: 0000000000010000 0 SECTION LOCAL DEFAULT 5 \.plt + 6: 0000000000011000 0 SECTION LOCAL DEFAULT 6 \.text + 7: 0000000000020000 0 SECTION LOCAL DEFAULT 7 \.dynamic + 8: 0000000000021000 0 SECTION LOCAL DEFAULT 8 \.got 9: 0000000000000000 0 FILE LOCAL DEFAULT ABS .*variant_pcs-1\.o - 10: 0000000000008000 0 NOTYPE LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local - 11: 0000000000008000 0 IFUNC LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local_ifunc - 12: 0000000000008000 0 IFUNC LOCAL DEFAULT 1 f_base_local_ifunc - 13: 0000000000008000 0 NOTYPE LOCAL DEFAULT 1 f_base_local - 14: 0000000000008000 0 NOTYPE LOCAL DEFAULT 1 \$x + 10: 0000000000011000 0 NOTYPE LOCAL DEFAULT \[VARIANT_PCS\] 6 f_spec_local + 11: 0000000000011000 0 IFUNC LOCAL DEFAULT \[VARIANT_PCS\] 6 f_spec_local_ifunc + 12: 0000000000011000 0 IFUNC LOCAL DEFAULT 6 f_base_local_ifunc + 13: 0000000000011000 0 NOTYPE LOCAL DEFAULT 6 f_base_local + 14: 0000000000011000 0 NOTYPE LOCAL DEFAULT 6 \$x 15: 0000000000000000 0 FILE LOCAL DEFAULT ABS .*variant_pcs-2\.o - 16: 0000000000008038 0 NOTYPE LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local2 - 17: 0000000000008038 0 IFUNC LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local2_ifunc - 18: 0000000000008038 0 IFUNC LOCAL DEFAULT 1 f_base_local2_ifunc - 19: 0000000000008038 0 NOTYPE LOCAL DEFAULT 1 f_base_local2 - 20: 0000000000008038 0 NOTYPE LOCAL DEFAULT 1 \$x - 21: 0000000000000000 0 FILE LOCAL DEFAULT ABS - 22: 0000000000009080 0 OBJECT LOCAL DEFAULT ABS _DYNAMIC - 23: 0000000000008000 0 NOTYPE LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_hidden_def - 24: 0000000000008000 0 IFUNC LOCAL DEFAULT 1 f_base_global_hidden_ifunc - 25: 0000000000008000 0 NOTYPE LOCAL DEFAULT 1 f_base_global_hidden_def - 26: 0000000000009000 0 OBJECT LOCAL DEFAULT ABS _GLOBAL_OFFSET_TABLE_ - 27: 0000000000008000 0 IFUNC LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_hidden_ifunc - 28: 0000000000008070 0 NOTYPE LOCAL DEFAULT 2 \$x + 16: 0000000000011038 0 NOTYPE LOCAL DEFAULT \[VARIANT_PCS\] 6 f_spec_local2 + 17: 0000000000011038 0 IFUNC LOCAL DEFAULT \[VARIANT_PCS\] 6 f_spec_local2_ifunc + 18: 0000000000011038 0 IFUNC LOCAL DEFAULT 6 f_base_local2_ifunc + 19: 0000000000011038 0 NOTYPE LOCAL DEFAULT 6 f_base_local2 + 20: 0000000000011038 0 NOTYPE LOCAL DEFAULT 6 \$x + 21: 0000000000000000 0 FILE LOCAL DEFAULT ABS\s + 22: 0000000000020000 0 OBJECT LOCAL DEFAULT ABS _DYNAMIC + 23: 0000000000011000 0 NOTYPE LOCAL DEFAULT \[VARIANT_PCS\] 6 f_spec_global_hidden_def + 24: 0000000000011000 0 IFUNC LOCAL DEFAULT 6 f_base_global_hidden_ifunc + 25: 0000000000011000 0 NOTYPE LOCAL DEFAULT 6 f_base_global_hidden_def + 26: 0000000000021000 0 OBJECT LOCAL DEFAULT ABS _GLOBAL_OFFSET_TABLE_ + 27: 0000000000011000 0 IFUNC LOCAL DEFAULT \[VARIANT_PCS\] 6 f_spec_global_hidden_ifunc + 28: 0000000000010000 0 NOTYPE LOCAL DEFAULT 5 \$x 29: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND f_base_global_default_undef 30: 0000000000000000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] UND f_spec_global_default_undef - 31: 0000000000008000 0 IFUNC GLOBAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_default_ifunc - 32: 0000000000008000 0 NOTYPE GLOBAL DEFAULT 1 f_base_global_default_def - 33: 0000000000008000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_default_def - 34: 0000000000008000 0 IFUNC GLOBAL DEFAULT 1 f_base_global_default_ifunc + 31: 0000000000011000 0 IFUNC GLOBAL DEFAULT \[VARIANT_PCS\] 6 f_spec_global_default_ifunc + 32: 0000000000011000 0 NOTYPE GLOBAL DEFAULT 6 f_base_global_default_def + 33: 0000000000011000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] 6 f_spec_global_default_def + 34: 0000000000011000 0 IFUNC GLOBAL DEFAULT 6 f_base_global_default_ifunc diff --git a/ld/testsuite/ld-aarch64/variant_pcs-r.d b/ld/testsuite/ld-aarch64/variant_pcs-r.d index 2651a68..65849e1 100644 --- a/ld/testsuite/ld-aarch64/variant_pcs-r.d +++ b/ld/testsuite/ld-aarch64/variant_pcs-r.d @@ -3,7 +3,7 @@ #ld: -r #readelf: -rsW -Relocation section '\.rela\.text' at offset .* contains 24 entries: +Relocation section '\.rela\.text' at offset 0x[[:xdigit:]]+ contains 24 entries: Offset Info Type Symbol's Value Symbol's Name \+ Addend 0000000000000000 000000180000011b R_AARCH64_CALL26 0000000000000000 f_spec_global_default_def \+ 0 0000000000000004 000000110000011b R_AARCH64_CALL26 0000000000000000 f_spec_global_default_undef \+ 0 @@ -32,10 +32,10 @@ Relocation section '\.rela\.text' at offset .* contains 24 entries: Symbol table '\.symtab' contains 26 entries: Num: Value Size Type Bind Vis Ndx Name - 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND - 1: 0000000000000000 0 SECTION LOCAL DEFAULT 1.* - 2: 0000000000000000 0 SECTION LOCAL DEFAULT 3.* - 3: 0000000000000000 0 SECTION LOCAL DEFAULT 4.* + 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND\s + 1: 0000000000000000 0 SECTION LOCAL DEFAULT 1 \.text + 2: 0000000000000000 0 SECTION LOCAL DEFAULT 3 \.data + 3: 0000000000000000 0 SECTION LOCAL DEFAULT 4 \.bss 4: 0000000000000000 0 FILE LOCAL DEFAULT ABS .*variant_pcs-1\.o 5: 0000000000000000 0 NOTYPE LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local 6: 0000000000000000 0 IFUNC LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local_ifunc diff --git a/ld/testsuite/ld-aarch64/variant_pcs-shared.d b/ld/testsuite/ld-aarch64/variant_pcs-shared.d index e021799..3a39d8c 100644 --- a/ld/testsuite/ld-aarch64/variant_pcs-shared.d +++ b/ld/testsuite/ld-aarch64/variant_pcs-shared.d @@ -4,65 +4,65 @@ #ld: -shared --hash-style=sysv -T variant_pcs.ld #readelf: -rsW -Relocation section '\.rela\.plt' at offset 0x11000 contains 12 entries: +Relocation section '\.rela\.plt' at offset 0x[[:xdigit:]]+ contains 12 entries: Offset Info Type Symbol's Value Symbol's Name \+ Addend -0000000000009020 0000000100000402 R_AARCH64_JUMP_SLOT 0000000000000000 f_base_global_default_undef \+ 0 -0000000000009028 0000000200000402 R_AARCH64_JUMP_SLOT 0000000000000000 f_spec_global_default_undef \+ 0 -0000000000009030 0000000400000402 R_AARCH64_JUMP_SLOT 0000000000008000 f_base_global_default_def \+ 0 -0000000000009038 0000000500000402 R_AARCH64_JUMP_SLOT 0000000000008000 f_spec_global_default_def \+ 0 -0000000000009040 0000000000000408 R_AARCH64_IRELATIVE 8000 -0000000000009048 0000000300000402 R_AARCH64_JUMP_SLOT f_spec_global_default_ifunc\(\) f_spec_global_default_ifunc \+ 0 -0000000000009050 0000000000000408 R_AARCH64_IRELATIVE 8000 -0000000000009058 0000000600000402 R_AARCH64_JUMP_SLOT f_base_global_default_ifunc\(\) f_base_global_default_ifunc \+ 0 -0000000000009060 0000000000000408 R_AARCH64_IRELATIVE 8038 -0000000000009068 0000000000000408 R_AARCH64_IRELATIVE 8000 -0000000000009070 0000000000000408 R_AARCH64_IRELATIVE 8000 -0000000000009078 0000000000000408 R_AARCH64_IRELATIVE 8038 +00000000000[[:xdigit:]]{2}020 0000000100000402 R_AARCH64_JUMP_SLOT 0000000000000000 f_base_global_default_undef \+ 0 +00000000000[[:xdigit:]]{2}028 0000000200000402 R_AARCH64_JUMP_SLOT 0000000000000000 f_spec_global_default_undef \+ 0 +00000000000[[:xdigit:]]{2}030 0000000400000402 R_AARCH64_JUMP_SLOT 0000000000011000 f_base_global_default_def \+ 0 +00000000000[[:xdigit:]]{2}038 0000000500000402 R_AARCH64_JUMP_SLOT 0000000000011000 f_spec_global_default_def \+ 0 +00000000000[[:xdigit:]]{2}040 0000000000000408 R_AARCH64_IRELATIVE 11000 +00000000000[[:xdigit:]]{2}048 0000000300000402 R_AARCH64_JUMP_SLOT f_spec_global_default_ifunc\(\) f_spec_global_default_ifunc \+ 0 +00000000000[[:xdigit:]]{2}050 0000000000000408 R_AARCH64_IRELATIVE 11000 +00000000000[[:xdigit:]]{2}058 0000000600000402 R_AARCH64_JUMP_SLOT f_base_global_default_ifunc\(\) f_base_global_default_ifunc \+ 0 +00000000000[[:xdigit:]]{2}060 0000000000000408 R_AARCH64_IRELATIVE 11038 +00000000000[[:xdigit:]]{2}068 0000000000000408 R_AARCH64_IRELATIVE 11000 +00000000000[[:xdigit:]]{2}070 0000000000000408 R_AARCH64_IRELATIVE 11000 +00000000000[[:xdigit:]]{2}078 0000000000000408 R_AARCH64_IRELATIVE 11038 Symbol table '\.dynsym' contains 7 entries: Num: Value Size Type Bind Vis Ndx Name - 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND + 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND\s 1: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND f_base_global_default_undef 2: 0000000000000000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] UND f_spec_global_default_undef - 3: 0000000000008000 0 IFUNC GLOBAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_default_ifunc - 4: 0000000000008000 0 NOTYPE GLOBAL DEFAULT 1 f_base_global_default_def - 5: 0000000000008000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_default_def - 6: 0000000000008000 0 IFUNC GLOBAL DEFAULT 1 f_base_global_default_ifunc + 3: 0000000000011000 0 IFUNC GLOBAL DEFAULT \[VARIANT_PCS\] 6 f_spec_global_default_ifunc + 4: 0000000000011000 0 NOTYPE GLOBAL DEFAULT 6 f_base_global_default_def + 5: 0000000000011000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] 6 f_spec_global_default_def + 6: 0000000000011000 0 IFUNC GLOBAL DEFAULT 6 f_base_global_default_ifunc Symbol table '\.symtab' contains 35 entries: Num: Value Size Type Bind Vis Ndx Name - 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND - 1: 0000000000008000 0 SECTION LOCAL DEFAULT 1.* - 2: 0000000000008070 0 SECTION LOCAL DEFAULT 2.* - 3: 0000000000009000 0 SECTION LOCAL DEFAULT 3.* - 4: 0000000000009080 0 SECTION LOCAL DEFAULT 4.* - 5: 0000000000011000 0 SECTION LOCAL DEFAULT 5.* - 6: 0000000000011120 0 SECTION LOCAL DEFAULT 6.* - 7: 00000000000111c8 0 SECTION LOCAL DEFAULT 7.* - 8: 0000000000011270 0 SECTION LOCAL DEFAULT 8.* + 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND\s + 1: 00000000000080e8 0 SECTION LOCAL DEFAULT 1 \.hash + 2: 0000000000008118 0 SECTION LOCAL DEFAULT 2 \.dynsym + 3: 00000000000081c0 0 SECTION LOCAL DEFAULT 3 \.dynstr + 4: 0000000000009000 0 SECTION LOCAL DEFAULT 4 \.rela\.plt + 5: 0000000000010000 0 SECTION LOCAL DEFAULT 5 \.plt + 6: 0000000000011000 0 SECTION LOCAL DEFAULT 6 \.text + 7: 0000000000020000 0 SECTION LOCAL DEFAULT 7 \.dynamic + 8: 0000000000021000 0 SECTION LOCAL DEFAULT 8 \.got 9: 0000000000000000 0 FILE LOCAL DEFAULT ABS .*variant_pcs-1\.o - 10: 0000000000008000 0 NOTYPE LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local - 11: 0000000000008000 0 IFUNC LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local_ifunc - 12: 0000000000008000 0 IFUNC LOCAL DEFAULT 1 f_base_local_ifunc - 13: 0000000000008000 0 NOTYPE LOCAL DEFAULT 1 f_base_local - 14: 0000000000008000 0 NOTYPE LOCAL DEFAULT 1 \$x + 10: 0000000000011000 0 NOTYPE LOCAL DEFAULT \[VARIANT_PCS\] 6 f_spec_local + 11: 0000000000011000 0 IFUNC LOCAL DEFAULT \[VARIANT_PCS\] 6 f_spec_local_ifunc + 12: 0000000000011000 0 IFUNC LOCAL DEFAULT 6 f_base_local_ifunc + 13: 0000000000011000 0 NOTYPE LOCAL DEFAULT 6 f_base_local + 14: 0000000000011000 0 NOTYPE LOCAL DEFAULT 6 \$x 15: 0000000000000000 0 FILE LOCAL DEFAULT ABS .*variant_pcs-2\.o - 16: 0000000000008038 0 NOTYPE LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local2 - 17: 0000000000008038 0 IFUNC LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_local2_ifunc - 18: 0000000000008038 0 IFUNC LOCAL DEFAULT 1 f_base_local2_ifunc - 19: 0000000000008038 0 NOTYPE LOCAL DEFAULT 1 f_base_local2 - 20: 0000000000008038 0 NOTYPE LOCAL DEFAULT 1 \$x - 21: 0000000000000000 0 FILE LOCAL DEFAULT ABS - 22: 0000000000009080 0 OBJECT LOCAL DEFAULT ABS _DYNAMIC - 23: 0000000000008000 0 NOTYPE LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_hidden_def - 24: 0000000000008000 0 IFUNC LOCAL DEFAULT 1 f_base_global_hidden_ifunc - 25: 0000000000008000 0 NOTYPE LOCAL DEFAULT 1 f_base_global_hidden_def - 26: 0000000000009000 0 OBJECT LOCAL DEFAULT ABS _GLOBAL_OFFSET_TABLE_ - 27: 0000000000008000 0 IFUNC LOCAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_hidden_ifunc - 28: 0000000000008070 0 NOTYPE LOCAL DEFAULT 2 \$x + 16: 0000000000011038 0 NOTYPE LOCAL DEFAULT \[VARIANT_PCS\] 6 f_spec_local2 + 17: 0000000000011038 0 IFUNC LOCAL DEFAULT \[VARIANT_PCS\] 6 f_spec_local2_ifunc + 18: 0000000000011038 0 IFUNC LOCAL DEFAULT 6 f_base_local2_ifunc + 19: 0000000000011038 0 NOTYPE LOCAL DEFAULT 6 f_base_local2 + 20: 0000000000011038 0 NOTYPE LOCAL DEFAULT 6 \$x + 21: 0000000000000000 0 FILE LOCAL DEFAULT ABS\s + 22: 0000000000020000 0 OBJECT LOCAL DEFAULT ABS _DYNAMIC + 23: 0000000000011000 0 NOTYPE LOCAL DEFAULT \[VARIANT_PCS\] 6 f_spec_global_hidden_def + 24: 0000000000011000 0 IFUNC LOCAL DEFAULT 6 f_base_global_hidden_ifunc + 25: 0000000000011000 0 NOTYPE LOCAL DEFAULT 6 f_base_global_hidden_def + 26: 0000000000021000 0 OBJECT LOCAL DEFAULT ABS _GLOBAL_OFFSET_TABLE_ + 27: 0000000000011000 0 IFUNC LOCAL DEFAULT \[VARIANT_PCS\] 6 f_spec_global_hidden_ifunc + 28: 0000000000010000 0 NOTYPE LOCAL DEFAULT 5 \$x 29: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND f_base_global_default_undef 30: 0000000000000000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] UND f_spec_global_default_undef - 31: 0000000000008000 0 IFUNC GLOBAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_default_ifunc - 32: 0000000000008000 0 NOTYPE GLOBAL DEFAULT 1 f_base_global_default_def - 33: 0000000000008000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_default_def - 34: 0000000000008000 0 IFUNC GLOBAL DEFAULT 1 f_base_global_default_ifunc + 31: 0000000000011000 0 IFUNC GLOBAL DEFAULT \[VARIANT_PCS\] 6 f_spec_global_default_ifunc + 32: 0000000000011000 0 NOTYPE GLOBAL DEFAULT 6 f_base_global_default_def + 33: 0000000000011000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] 6 f_spec_global_default_def + 34: 0000000000011000 0 IFUNC GLOBAL DEFAULT 6 f_base_global_default_ifunc diff --git a/ld/testsuite/ld-aarch64/variant_pcs.ld b/ld/testsuite/ld-aarch64/variant_pcs.ld index a66a934..cadecd8 100644 --- a/ld/testsuite/ld-aarch64/variant_pcs.ld +++ b/ld/testsuite/ld-aarch64/variant_pcs.ld @@ -3,21 +3,31 @@ OUTPUT_ARCH(aarch64) ENTRY(_start) SECTIONS { - /* Read-only sections, merged into text segment: */ - PROVIDE (__executable_start = 0x8000); . = 0x8000; + PROVIDE(__executable_start = 0x8000); + . = SEGMENT_START("text-segment", 0x8000) + SIZEOF_HEADERS; + /* Start of the executable code region. */ + .hash : { *(.hash) } + .gnu.hash : { *(.gnu.hash) } + .dynsym : { *(.dynsym) } + .dynstr : { *(.dynstr) } + . = 0x9000; + .rela.plt : { *(.rela.plt) *(.rela.iplt) } + . = 0x10000; + .plt : { *(.plt) } + . = 0x11000; .text : { *(.before) *(.text) *(.after) - } =0 - . = 0x9000; + } + + /* Start of the Read Write Data region. */ + . = ALIGN (CONSTANT (MAXPAGESIZE)); + .dynamic : { *(.dynamic) } + . = ALIGN(4K); .got : { *(.got) *(.got.plt)} - . = 0x10000; - .rela.dyn : { *(.rela.ifunc) } - . = 0x11000; - .rela.plt : { *(.rela.plt) *(.rela.iplt) } - . = 0x12340000; - .far : { *(.far) } - .ARM.attributes 0 : { *(.ARM.atttributes) } + + /* Start of the metadata region. */ + .ARM.attributes 0 : { KEEP (*(.ARM.attributes)) } } diff --git a/ld/testsuite/ld-arm/arm-elf.exp b/ld/testsuite/ld-arm/arm-elf.exp index cacd3bd..bf627f3 100644 --- a/ld/testsuite/ld-arm/arm-elf.exp +++ b/ld/testsuite/ld-arm/arm-elf.exp @@ -319,7 +319,7 @@ append armelftests_common $tmp run_ld_link_tests $armelftests_common -set armelftests_nonacl { +set armelftests { {"Thumb-1 BL" "-Ttext 0x1000 --section-start .foo=0x401000" "" "" {thumb1-bl.s} {{objdump -dr thumb1-bl.d}} "thumb1-bl"} @@ -338,7 +338,7 @@ set tmp { "-shared -T arm-dyn.ld --hash-style=sysv" "" "" {gc-thumb-lib.s} {} "gc-thumb-lib.so"} - {"Thumb and -gc-sections" "-pie -T arm.ld -gc-sections tmpdir/gc-thumb-lib.so" "" "" {gc-thumb.s} + {"Thumb and -gc-sections (pie)" "-pie -T arm.ld -gc-sections tmpdir/gc-thumb-lib.so" "" "" {gc-thumb.s} {{readelf --relocs gc-thumb.d}} "gc-thumb"} {"Simple non-PIC shared library" "-shared" "" "" {arm-lib.s} @@ -351,14 +351,14 @@ set tmp { {{objdump -fdw arm-app.d} {objdump -Rw arm-app.r}} "arm-app"} } -if [check_shared_lib_support] { append armelftests_nonacl $tmp } +if [check_shared_lib_support] { append armelftests $tmp } set tmp { {"Simple static application without .rel.plt in linker script" "-T arm-no-rel-plt.ld" "" "" {arm-static-app.s} {{objdump -fdw arm-static-app.d} {objdump -rw arm-static-app.r}} "arm-static-app-no-rel-plt"} } -append armelftests_nonacl $tmp +append armelftests $tmp set tmp { {"Simple dynamic application without .rel.plt in linker script" "tmpdir/arm-lib.so -T arm-no-rel-plt.ld" "" "" {arm-app.s} @@ -406,11 +406,9 @@ set tmp { {{objdump -fdw tls-lib-loc.d} {objdump -Rw tls-lib-loc.r}} "tls-lib-loc.so"} } -if [check_shared_lib_support] { append armelftests_nonacl $tmp } +if [check_shared_lib_support] { append armelftests $tmp } -if { ![istarget "arm*-*-nacl*"] } { - run_ld_link_tests $armelftests_nonacl -} +run_ld_link_tests $armelftests run_dump_test "group-relocs-alu-bad" run_dump_test "group-relocs-alu-bad-2" @@ -437,7 +435,7 @@ if { [istarget "arm*-*-netbsd*"] } { return } -if { ![istarget "arm*-*-*eabi*"] && ![istarget "arm*-*-nacl*"] } { +if { ![istarget "arm*-*-*eabi*"] } { # Special variants of these tests, as a different farcall stub is # generated for a non-ARM-EABI target: indeed in such a case, # there are no attributes to indicate that blx can be used. @@ -446,7 +444,7 @@ if { ![istarget "arm*-*-*eabi*"] && ![istarget "arm*-*-nacl*"] } { {"Thumb-2-as-Thumb-1 BL" "-Ttext 0x1000 --section-start .foo=0x100100c" "" "" {thumb2-bl-as-thumb1-bad.s} {{objdump -d thumb2-bl-as-thumb1-bad-noeabi.d}} "thumb2-bl-as-thumb1-bad"} - {"Thumb-2 BL bad" "-Ttext 0x1000 --section-start .foo=0x100100c" "" "" {thumb2-bl-bad.s} + {"Thumb-2 BL bad noeabi" "-Ttext 0x1000 --section-start .foo=0x100100c" "" "" {thumb2-bl-bad.s} {{objdump -d thumb2-bl-bad-noeabi.d}} "thumb2-bl-bad"} } @@ -457,11 +455,7 @@ if { ![istarget "arm*-*-*eabi*"] && ![istarget "arm*-*-nacl*"] } { # Farcalls stubs are fully supported for ARM-EABI only. # This list is massaged below into run_ld_link_tests standard format. -# The source list is almost that same format. The one difference is -# that each "action" (elements of element 5) might have four elements -# instead of three; in that case, the fourth element is the name of -# the dump file to use for arm*-*nacl* targets instead of the canonical -# dump file (the third element). +# The source list is almost that same format. set armeabitests_common { {"EABI attribute merging" "-r" "" "" {attr-merge.s attr-merge.s} {{readelf -A attr-merge.attr}} @@ -522,20 +516,20 @@ set armeabitests_common { "movw-merge"} {"ARM-ARM farcall" "-Ttext 0x1000 --section-start .foo=0x2001020" "" "" {farcall-arm-arm.s} - {{objdump -d farcall-arm-arm.d farcall-arm-nacl.d}} + {{objdump -d farcall-arm-arm.d}} "farcall-arm-arm"} {"ARM-ARM farcall (PIC veneer)" "-Ttext 0x1000 --section-start .foo=0x2001020 --pic-veneer" "" "" {farcall-arm-arm.s} - {{objdump -d farcall-arm-arm-pic-veneer.d farcall-arm-nacl-pic.d}} + {{objdump -d farcall-arm-arm-pic-veneer.d}} "farcall-arm-arm-pic-veneer"} {"ARM-ARM farcall (BE8)" "-Ttext 0x1000 --section-start .foo=0x2001020 -EB --be8" "" "-EB" {farcall-arm-arm.s} - {{objdump -d farcall-arm-arm.d farcall-arm-nacl.d}} + {{objdump -d farcall-arm-arm.d}} "farcall-arm-arm-be8"} {"ARM-ARM farcall (BE)" "-Ttext 0x1000 --section-start .foo=0x2001020 -EB" "" "-EB" {farcall-arm-arm.s} - {{objdump -d farcall-arm-arm.d farcall-arm-nacl.d}} + {{objdump -d farcall-arm-arm.d}} "farcall-arm-arm-be"} {"Long branch with mixed text and data" "-T arm.ld" "" "" {farcall-data.s} - {{objdump -dr farcall-data.d farcall-data-nacl.d}} + {{objdump -dr farcall-data.d}} "farcall-data"} {"callweak-2" "-static -T arm.ld" "" "" {callweak-2.s} {{objdump -dr callweak-2.d}} @@ -553,7 +547,7 @@ set armeabitests_common_shared { if [check_shared_lib_support] { append armeabitests_common $armeabitests_common_shared} -set armeabitests_nonacl { +set armeabitests { {"ARM-Thumb farcall" "-Ttext 0x1000 --section-start .foo=0x2001014" "" "" {farcall-arm-thumb.s} {{objdump -d farcall-arm-thumb.d}} "farcall-arm-thumb"} @@ -652,7 +646,7 @@ set armeabitests_nonacl { {"Thumb-2-as-Thumb-1 BL" "--no-fix-arm1176 -Ttext 0x1000 --section-start .foo=0x100100c" "" "" {thumb2-bl-as-thumb1-bad.s} {{objdump -d thumb2-bl-as-thumb1-bad.d}} "thumb2-bl-as-thumb1-bad"} - {"Thumb-2 BL" "-Ttext 0x1000 --section-start .foo=0x100100c" "" "" {thumb2-bl-bad.s} + {"Thumb-2 BL bad" "-Ttext 0x1000 --section-start .foo=0x100100c" "" "" {thumb2-bl-bad.s} {{objdump -d thumb2-bl-bad.d}} "thumb2-bl-bad"} {"Branch to linker script symbol with BL for thumb-only target" "-T branch-lks-sym.ld" "" "" {thumb-bl-lks-sym.s} @@ -687,7 +681,7 @@ set armeabitests_nonacl { {{objdump -d fix-arm1176-off.d}} "fix-arm1176-6"} - {"Thumb-2 BL" "-Ttext 0x1000 --section-start .foo=0x1001000" "" "-march=armv7" {thumb2-bl.s} + {"Thumb-2 BL on armv7" "-Ttext 0x1000 --section-start .foo=0x1001000" "" "-march=armv7" {thumb2-bl.s} {{objdump -dr thumb2-bl.d}} "thumb2-bl"} {"Thumb-2 BL on ARMv6-M" "-Ttext 0x1000 --section-start .foo=0x1001000" "" "-march=armv6-m" {thumb2-bl.s} @@ -949,7 +943,7 @@ set armeabitests_nonacl { "arm-pic-veneer"} } -set armeabitests_nonacl_shared { +set armeabitests_shared { {"TLS gnu shared library" "--no-fix-arm1176 -shared -T arm-dyn.ld --hash-style=sysv" "" "" {tls-gdesc.s} @@ -1107,7 +1101,7 @@ set armeabitests_nonacl_shared { {{readelf -Ds preempt-app.sym}} "preempt-app"} } -if [check_shared_lib_support] { append armeabitests_nonacl $armeabitests_nonacl_shared} +if [check_shared_lib_support] { append armeabitests $armeabitests_shared} set armfdpiceabitests { @@ -1152,10 +1146,6 @@ set armfdpiceabitests { # Massage the $armeabitests_common list into run_ld_link_tests standard form. # See the comment before 'set armeabitests_common', above. set elide_action_elt 3 -set is_nacl [istarget "arm*-*-nacl*"] -if {$is_nacl} { - set elide_action_elt 2 -} set neabi_common [llength $armeabitests_common] for {set i 0} {$i < $neabi_common} {incr i} { set case [lindex $armeabitests_common $i] @@ -1171,9 +1161,7 @@ for {set i 0} {$i < $neabi_common} {incr i} { } run_ld_link_tests $armeabitests_common -if { !$is_nacl } { - run_ld_link_tests $armeabitests_nonacl -} +run_ld_link_tests $armeabitests if { [istarget "arm*-*-uclinuxfdpiceabi"] } { run_ld_link_tests $armfdpiceabitests @@ -1255,7 +1243,7 @@ run_dump_test "attr-merge-nosection-1" run_dump_test "attr-merge-hardfp-use-1" run_dump_test "attr-merge-hardfp-use-2" run_dump_test "unresolved-1" -if { !$is_nacl && [check_shared_lib_support] } { +if { [check_shared_lib_support] } { run_dump_test "unresolved-1-dyn" } run_dump_test "unresolved-2" @@ -1281,7 +1269,7 @@ run_dump_test "non-contiguous-arm5" run_dump_test "non-contiguous-arm6" run_dump_test "non-contiguous-arm7" -if { !$is_nacl && [check_shared_lib_support] } { +if { [check_shared_lib_support] } { run_dump_test "thumb-plt" run_dump_test "thumb-plt-got" } diff --git a/ld/testsuite/ld-arm/arm.ld b/ld/testsuite/ld-arm/arm.ld index 8e3fac2..4b596ce 100644 --- a/ld/testsuite/ld-arm/arm.ld +++ b/ld/testsuite/ld-arm/arm.ld @@ -19,5 +19,5 @@ SECTIONS .got : { *(.got) *(.got.plt)} . = 0x12340000; .far : { *(.far) } - .ARM.attribues 0 : { *(.ARM.atttributes) } + .ARM.attributes 0 : { *(.ARM.attributes) } } diff --git a/ld/testsuite/ld-arm/arm_purecode.ld b/ld/testsuite/ld-arm/arm_purecode.ld index 195aca1..488e3dd 100644 --- a/ld/testsuite/ld-arm/arm_purecode.ld +++ b/ld/testsuite/ld-arm/arm_purecode.ld @@ -28,5 +28,5 @@ SECTIONS .got : { *(.got) *(.got.plt)} . = 0x12340000; .far : { *(.far) } - .ARM.attribues 0 : { *(.ARM.atttributes) } + .ARM.attributes 0 : { *(.ARM.attributes) } } diff --git a/ld/testsuite/ld-arm/cortex-a8-far.d b/ld/testsuite/ld-arm/cortex-a8-far.d index a87cd5d..5c7c6fb 100644 --- a/ld/testsuite/ld-arm/cortex-a8-far.d +++ b/ld/testsuite/ld-arm/cortex-a8-far.d @@ -1,4 +1,4 @@ -#target: *-*-*eabi* *-*-nacl* +#target: *-*-*eabi* .*: file format .* diff --git a/ld/testsuite/ld-arm/discard-unwind.ld b/ld/testsuite/ld-arm/discard-unwind.ld index d8f6524..54418f7 100644 --- a/ld/testsuite/ld-arm/discard-unwind.ld +++ b/ld/testsuite/ld-arm/discard-unwind.ld @@ -15,5 +15,5 @@ SECTIONS *(.v4_bx) } =0 /DISCARD/ : { *(.ARM.exidx*) } - .ARM.attribues 0 : { *(.ARM.atttributes) } + .ARM.attributes 0 : { *(.ARM.attributes) } } diff --git a/ld/testsuite/ld-arm/farcall-arm-nacl-pic.d b/ld/testsuite/ld-arm/farcall-arm-nacl-pic.d deleted file mode 100644 index a39a468..0000000 --- a/ld/testsuite/ld-arm/farcall-arm-nacl-pic.d +++ /dev/null @@ -1,20 +0,0 @@ -.*: file format .* - -Disassembly of section \.text: - -0+1000 <_start>: -\s*1000:\s+eb000002\s+bl\s+1010 <__bar_veneer> -#... - -0+1010 <__bar_veneer>: -\s*1010:\s+e59fc00c\s+ldr\s+ip, \[pc, #12\]\s+@ 1024 <__bar_veneer\+0x14> -\s*1014:\s+e08cc00f\s+add\s+ip, ip, pc -\s*1018:\s+e3ccc13f\s+bic\s+ip, ip, #-1073741809\s+@ 0xc000000f -\s*101c:\s+e12fff1c\s+bx\s+ip -\s*1020:\s+e125be70\s+bkpt\s+0x5be0 -\s*1024:\s+02000004\s+.word\s+0x02000004 -#... - -\s*Disassembly of section \.foo: -\s*02001020 <bar>: -\s*2001020:\s+e12fff1e\s+bx\s+lr diff --git a/ld/testsuite/ld-arm/farcall-arm-nacl.d b/ld/testsuite/ld-arm/farcall-arm-nacl.d deleted file mode 100644 index 0431f4a..0000000 --- a/ld/testsuite/ld-arm/farcall-arm-nacl.d +++ /dev/null @@ -1,20 +0,0 @@ -.*: file format .* - -Disassembly of section \.text: - -0+1000 <_start>: -\s*1000:\s+eb000002\s+bl\s+1010 <__bar_veneer> -#... - -0+1010 <__bar_veneer>: -\s*1010:\s+e59fc00c\s+ldr\s+ip, \[pc, #12\]\s+@ 1024 <__bar_veneer\+0x14> -\s*1014:\s+e3ccc13f\s+bic\s+ip, ip, #-1073741809\s+@ 0xc000000f -\s*1018:\s+e12fff1c\s+bx\s+ip -\s*101c:\s+e320f000\s+nop\s+\{0\} -\s*1020:\s+e125be70\s+bkpt\s+0x5be0 -\s*1024:\s+02001020\s+.word\s+0x02001020 -#... - -\s*Disassembly of section \.foo: -\s*02001020 <bar>: -\s*2001020:\s+e12fff1e\s+bx\s+lr diff --git a/ld/testsuite/ld-arm/farcall-data-nacl.d b/ld/testsuite/ld-arm/farcall-data-nacl.d deleted file mode 100644 index 2c51fe8..0000000 --- a/ld/testsuite/ld-arm/farcall-data-nacl.d +++ /dev/null @@ -1,24 +0,0 @@ -.*: file format .* - -Disassembly of section .text: - -0+8000 <_start>: -\s*8000:\s+ea000002\s+b\s+8010 <__far_veneer> -#... - -0+8010 <__far_veneer>: -\s*8010:\s+e59fc00c\s+ldr\s+ip, \[pc, #12\]\s+@ 8024 <__far_veneer\+0x14> -\s*8014:\s+e3ccc13f\s+bic\s+ip, ip, #-1073741809\s+@ 0xc000000f -\s*8018:\s+e12fff1c\s+bx\s+ip -\s*801c:\s+e320f000\s+nop\s+\{0\} -\s*8020:\s+e125be70\s+bkpt\s+0x5be0 -\s*8024:\s+12340000\s+.word\s+0x12340000 -#... - -0+8030 <after>: -\s*8030:\s+11111111\s+\.word\s+0x11111111 - -Disassembly of section \.far: - -12340000 <far>: -12340000:\s+e12fff1e\s+bx\s+lr diff --git a/ld/testsuite/ld-arm/farcall-thumb2-purecode-consecutive-veneer.d b/ld/testsuite/ld-arm/farcall-thumb2-purecode-consecutive-veneer.d index b89da03..0d74ca3 100644 --- a/ld/testsuite/ld-arm/farcall-thumb2-purecode-consecutive-veneer.d +++ b/ld/testsuite/ld-arm/farcall-thumb2-purecode-consecutive-veneer.d @@ -11,17 +11,17 @@ Disassembly of section .text: Disassembly of section .foo: 02001020 <_start>: - 2001020: f000 f802 bl 2001028 <__bar_veneer> - 2001024: f000 f806 bl 2001034 <__baz_veneer> + 2001020: f000 f808 bl 2001034 <__bar_veneer> + 2001024: f000 f800 bl 2001028 <__baz_veneer> -02001028 <__bar_veneer>: - 2001028: f241 0c01 movw ip, #4097 @ 0x1001 +02001028 <__baz_veneer>: + 2001028: f241 0c03 movw ip, #4099 @ 0x1003 200102c: f2c0 0c00 movt ip, #0 2001030: 4760 bx ip 2001032: bf00 nop -02001034 <__baz_veneer>: - 2001034: f241 0c03 movw ip, #4099 @ 0x1003 +02001034 <__bar_veneer>: + 2001034: f241 0c01 movw ip, #4097 @ 0x1001 2001038: f2c0 0c00 movt ip, #0 200103c: 4760 bx ip 200103e: bf00 nop diff --git a/ld/testsuite/ld-arm/group-relocs-alu-bad-2.d b/ld/testsuite/ld-arm/group-relocs-alu-bad-2.d index e3f1df7..1912cd6 100644 --- a/ld/testsuite/ld-arm/group-relocs-alu-bad-2.d +++ b/ld/testsuite/ld-arm/group-relocs-alu-bad-2.d @@ -1,4 +1,4 @@ -#name: ALU group relocations failure test +#name: ALU group relocations failure test (2) #source: group-relocs-alu-bad-2.s #ld: -Ttext 0x8000 --section-start foo=0x1208000 #error: overflow whilst splitting 0x1234 for group relocation diff --git a/ld/testsuite/ld-arm/group-relocs-ldc-bad-2.d b/ld/testsuite/ld-arm/group-relocs-ldc-bad-2.d index cc52ecc..ce645b7 100644 --- a/ld/testsuite/ld-arm/group-relocs-ldc-bad-2.d +++ b/ld/testsuite/ld-arm/group-relocs-ldc-bad-2.d @@ -1,4 +1,4 @@ -#name: LDC group relocations failure test +#name: LDC group relocations failure test (2) #source: group-relocs-ldc-bad-2.s #ld: -Ttext 0x8000 --section-start foo=0x118400 #error: overflow whilst splitting 0x123456 for group relocation diff --git a/ld/testsuite/ld-arm/group-relocs-ldr-bad-2.d b/ld/testsuite/ld-arm/group-relocs-ldr-bad-2.d index 771395d..8de930e 100644 --- a/ld/testsuite/ld-arm/group-relocs-ldr-bad-2.d +++ b/ld/testsuite/ld-arm/group-relocs-ldr-bad-2.d @@ -1,4 +1,4 @@ -#name: LDR group relocations failure test +#name: LDR group relocations failure test (2) #source: group-relocs-ldr-bad-2.s #ld: -Ttext 0x8000 --section-start foo=0x8001000 #error: .*overflow whilst splitting 0x7ff9000 for group relocation.* diff --git a/ld/testsuite/ld-arm/group-relocs-ldrs-bad-2.d b/ld/testsuite/ld-arm/group-relocs-ldrs-bad-2.d index c104ea6..fc5c3f9 100644 --- a/ld/testsuite/ld-arm/group-relocs-ldrs-bad-2.d +++ b/ld/testsuite/ld-arm/group-relocs-ldrs-bad-2.d @@ -1,4 +1,4 @@ -#name: LDRS group relocations failure test +#name: LDRS group relocations failure test (2) #source: group-relocs-ldrs-bad-2.s #ld: -Ttext 0x8000 --section-start foo=0x8000100 #error: overflow whilst splitting 0x7ff8100 for group relocation diff --git a/ld/testsuite/ld-arm/non-contiguous-arm3.d b/ld/testsuite/ld-arm/non-contiguous-arm3.d index 2912f35..ab83b5e 100644 --- a/ld/testsuite/ld-arm/non-contiguous-arm3.d +++ b/ld/testsuite/ld-arm/non-contiguous-arm3.d @@ -3,7 +3,6 @@ #ld: --enable-non-contiguous-regions -T non-contiguous-arm3.ld -z max-page-size=0x10000 #objdump: -rdth #xfail: [is_generic] -#skip: arm*nacl .*: file format elf32-(little|big)arm diff --git a/ld/testsuite/ld-arm/non-contiguous-arm6.d b/ld/testsuite/ld-arm/non-contiguous-arm6.d index 3d737f0..c21cb4c 100644 --- a/ld/testsuite/ld-arm/non-contiguous-arm6.d +++ b/ld/testsuite/ld-arm/non-contiguous-arm6.d @@ -3,7 +3,6 @@ #ld: --enable-non-contiguous-regions -T non-contiguous-arm6.ld -z max-page-size=0x10000 #objdump: -rdth #xfail: [is_generic] -#skip: arm*nacl .*: file format elf32-(little|big)arm diff --git a/ld/testsuite/ld-arm/script-type.ld b/ld/testsuite/ld-arm/script-type.ld index 01995eb..af34697 100644 --- a/ld/testsuite/ld-arm/script-type.ld +++ b/ld/testsuite/ld-arm/script-type.ld @@ -3,7 +3,7 @@ SECTIONS { foo_a = bar_a; foo_t = bar_t; foo_o = bar_o; - *(.text) + *(.text) } - .ARM.attribues 0 : { *(.ARM.attributes) } + .ARM.attributes 0 : { *(.ARM.attributes) } } diff --git a/ld/testsuite/ld-arm/unwind-1.d b/ld/testsuite/ld-arm/unwind-1.d index add5cb7..073d6a5 100644 --- a/ld/testsuite/ld-arm/unwind-1.d +++ b/ld/testsuite/ld-arm/unwind-1.d @@ -1,10 +1,7 @@ #ld: -T arm.ld -#objdump: -s +#objdump: -s -j .ARM.exidx .*: file format.* -#... -Contents of section .ARM.exidx: - 8008 (f8ffff7f b0b0a880 f4ffff7f 01000000|7ffffff8 80a8b0b0 7ffffff4 00000001) .* -Contents of section .far: -#... +Contents of section \.ARM\.exidx: + 8008 (f8ffff7f b0b0a880 f4ffff7f 01000000|7ffffff8 80a8b0b0 7ffffff4 00000001) \.+ diff --git a/ld/testsuite/ld-arm/unwind-2.d b/ld/testsuite/ld-arm/unwind-2.d index a096c9b..c9cd433 100644 --- a/ld/testsuite/ld-arm/unwind-2.d +++ b/ld/testsuite/ld-arm/unwind-2.d @@ -1,10 +1,7 @@ #ld: -T arm.ld -#objdump: -s +#objdump: -s -j .ARM.exidx .*: file format.* -#... -Contents of section .ARM.exidx: - 8004 (fcffff7f b0b0a880 f8ffff7f 01000000|7ffffffc 80a8b0b0 7ffffff8 00000001) .* -Contents of section .far: -#... +Contents of section \.ARM\.exidx: + 8004 (fcffff7f b0b0a880 f8ffff7f 01000000|7ffffffc 80a8b0b0 7ffffff8 00000001) \.+ diff --git a/ld/testsuite/ld-arm/unwind-3.d b/ld/testsuite/ld-arm/unwind-3.d index 0b8e85e..9da1484 100644 --- a/ld/testsuite/ld-arm/unwind-3.d +++ b/ld/testsuite/ld-arm/unwind-3.d @@ -1,11 +1,8 @@ #ld: -T arm.ld -#objdump: -s +#objdump: -s -j .ARM.exidx .*: file format.* -#... -Contents of section .ARM.exidx: - 800c (f4ffff7f b0b0a880 f0ffff7f 01000000|7ffffff4 80a8b0b0 7ffffff0 00000001) .* - 801c (ecffff7f b0b0a880 e8ffff7f 01000000|7fffffec 80a8b0b0 7fffffe8 00000001) .* -Contents of section .far: -#... +Contents of section \.ARM\.exidx: + 800c (f4ffff7f b0b0a880 f0ffff7f 01000000|7ffffff4 80a8b0b0 7ffffff0 00000001) \.+ + 801c (ecffff7f b0b0a880 e8ffff7f 01000000|7fffffec 80a8b0b0 7fffffe8 00000001) \.+ diff --git a/ld/testsuite/ld-arm/unwind-4.d b/ld/testsuite/ld-arm/unwind-4.d index ffc8725..7b71de88 100644 --- a/ld/testsuite/ld-arm/unwind-4.d +++ b/ld/testsuite/ld-arm/unwind-4.d @@ -1,9 +1,8 @@ #ld: -q -T arm.ld -#objdump: -sr +#objdump: -sr -j .ARM.exidx .*: file format.* -#... RELOCATION RECORDS FOR \[\.ARM\.exidx\]: OFFSET +TYPE +VALUE 00000000 R_ARM_PREL31 \.text @@ -17,11 +16,6 @@ OFFSET +TYPE +VALUE 00000010 R_ARM_NONE __aeabi_unwind_cpp_pr0 00000018 R_ARM_PREL31 \.text - -Contents of section .text: -#... -Contents of section .ARM.exidx: - 8020 (e0ffff7f b0b0a880 dcffff7f e8ffff7f|7fffffe0 80a8b0b0 7fffffdc 7fffffe8) .* - 8030 (d8ffff7f b0b0a880 d8ffff7f 01000000|7fffffd8 80a8b0b0 7fffffd8 00000001) .* -Contents of section .far: -#... +Contents of section \.ARM\.exidx: + 8020 (e0ffff7f b0b0a880 dcffff7f e8ffff7f|7fffffe0 80a8b0b0 7fffffdc 7fffffe8) \.+ + 8030 (d8ffff7f b0b0a880 d8ffff7f 01000000|7fffffd8 80a8b0b0 7fffffd8 00000001) \.+ diff --git a/ld/testsuite/ld-checks/over2.d b/ld/testsuite/ld-checks/over2.d index 511b917..b082c59 100644 --- a/ld/testsuite/ld-checks/over2.d +++ b/ld/testsuite/ld-checks/over2.d @@ -1,4 +1,4 @@ -#name: section size overflow +#name: section size overflow (2) #source: over2.s #ld: -Ttext=0xfffffffc #nm: -n diff --git a/ld/testsuite/ld-cris/asneed1.d b/ld/testsuite/ld-cris/asneed1.d index 00fba75..b40356d 100644 --- a/ld/testsuite/ld-cris/asneed1.d +++ b/ld/testsuite/ld-cris/asneed1.d @@ -1,7 +1,7 @@ #source: start1.s #source: dso-2.s #source: dso-1.s -#as: --pic --no-underscore --em=criself +#as: --pic --no-underscore --emulation=criself #ld: -m crislinux --as-needed tmpdir/libdso-1.so #objdump: -p diff --git a/ld/testsuite/ld-cris/badgotr1.d b/ld/testsuite/ld-cris/badgotr1.d index f7a5ac8..a993e90 100644 --- a/ld/testsuite/ld-cris/badgotr1.d +++ b/ld/testsuite/ld-cris/badgotr1.d @@ -1,5 +1,5 @@ #source: gotrel1.s -#as: --pic --underscore --em=criself +#as: --pic --underscore --emulation=criself #ld: -m crislinux -shared #objdump: -dr #error: \A[^\nc][^\n]*o: uses _-prefixed [^\nc]*\n[^\nc][^\n]* failed to merge [^\n]*\n[^\nc][^\n]* no GOT [^\n]*\n[^\nc][^\n]* bad value\Z diff --git a/ld/testsuite/ld-cris/def2.d b/ld/testsuite/ld-cris/def2.d index ff75d88..00c5f41 100644 --- a/ld/testsuite/ld-cris/def2.d +++ b/ld/testsuite/ld-cris/def2.d @@ -2,7 +2,7 @@ #source: stabs1.s #source: globsymw1.s #target: cris-*-*elf* cris-*-*aout* -#as: --em=crisaout +#as: --emulation=crisaout #ld: -mcrisaout #objdump: -p # Just checking that undef2 links correctly when given a symbol. diff --git a/ld/testsuite/ld-cris/def3.d b/ld/testsuite/ld-cris/def3.d index e1ae3c5..231414b 100644 --- a/ld/testsuite/ld-cris/def3.d +++ b/ld/testsuite/ld-cris/def3.d @@ -2,7 +2,7 @@ #source: stabs1.s #source: globsymw1.s #target: cris-*-*elf* cris-*-*aout* -#as: --em=criself +#as: --emulation=criself #ld: -mcriself #objdump: -p # Just checking that undef3 links correctly when given a symbol. diff --git a/ld/testsuite/ld-cris/dso-pltdis1.d b/ld/testsuite/ld-cris/dso-pltdis1.d index efc4d94..9614033 100644 --- a/ld/testsuite/ld-cris/dso-pltdis1.d +++ b/ld/testsuite/ld-cris/dso-pltdis1.d @@ -1,7 +1,7 @@ #source: dsov32-1.s #source: dsov32-2.s #source: dsofn4g.s -#as: --pic --no-underscore --march=v32 --em=criself +#as: --pic --no-underscore --march=v32 --emulation=criself #ld: --shared -m crislinux --hash-style=sysv #objdump: -d -R diff --git a/ld/testsuite/ld-cris/dso-pltdis2.d b/ld/testsuite/ld-cris/dso-pltdis2.d index c6f53fd..e967386 100644 --- a/ld/testsuite/ld-cris/dso-pltdis2.d +++ b/ld/testsuite/ld-cris/dso-pltdis2.d @@ -1,7 +1,7 @@ #source: dsov32-1.s #source: dsov32-2.s #source: dsofng.s -#as: --pic --no-underscore --march=v32 --em=criself +#as: --pic --no-underscore --march=v32 --emulation=criself #ld: --shared -m crislinux --hash-style=sysv #objdump: -d diff --git a/ld/testsuite/ld-cris/dso12-pltdis.d b/ld/testsuite/ld-cris/dso12-pltdis.d index 429f91e..e5a230c 100644 --- a/ld/testsuite/ld-cris/dso12-pltdis.d +++ b/ld/testsuite/ld-cris/dso12-pltdis.d @@ -1,7 +1,7 @@ #source: expdyn1.s #source: dsov32-1.s #source: dsov32-2.s -#as: --pic --no-underscore --march=v32 --em=criself +#as: --pic --no-underscore --march=v32 --emulation=criself #ld: --shared -m crislinux -z nocombreloc --hash-style=sysv #objdump: -d diff --git a/ld/testsuite/ld-cris/expdyn1.d b/ld/testsuite/ld-cris/expdyn1.d index 37cbe4d..0c1ea55 100644 --- a/ld/testsuite/ld-cris/expdyn1.d +++ b/ld/testsuite/ld-cris/expdyn1.d @@ -1,5 +1,5 @@ #source: expdyn1.s -#as: --no-underscore --em=criself +#as: --no-underscore --emulation=criself #ld: -m crislinux -export-dynamic tmpdir/libdso-1.so --hash-style=sysv #objdump: -T diff --git a/ld/testsuite/ld-cris/expdyn2.d b/ld/testsuite/ld-cris/expdyn2.d index 6c5faa5..b2a6fb3 100644 --- a/ld/testsuite/ld-cris/expdyn2.d +++ b/ld/testsuite/ld-cris/expdyn2.d @@ -1,6 +1,6 @@ #source: expdyn1.s #source: expdref1.s --pic -#as: --no-underscore --em=criself +#as: --no-underscore --emulation=criself #ld: -m crislinux --export-dynamic tmpdir/libdso-1.so #objdump: -R diff --git a/ld/testsuite/ld-cris/expdyn3.d b/ld/testsuite/ld-cris/expdyn3.d index 34f2a5e..aefbe84 100644 --- a/ld/testsuite/ld-cris/expdyn3.d +++ b/ld/testsuite/ld-cris/expdyn3.d @@ -1,7 +1,7 @@ #source: expdyn1.s #source: expdref1.s --pic #source: euwref1.s --pic -#as: --no-underscore --em=criself +#as: --no-underscore --emulation=criself #ld: -m crislinux --export-dynamic tmpdir/libdso-1.so #objdump: -R diff --git a/ld/testsuite/ld-cris/expdyn4.d b/ld/testsuite/ld-cris/expdyn4.d index e932056..5510142 100644 --- a/ld/testsuite/ld-cris/expdyn4.d +++ b/ld/testsuite/ld-cris/expdyn4.d @@ -1,7 +1,7 @@ #source: expdyn1.s #source: expdref1.s --pic #source: comref1.s --pic -#as: --no-underscore --em=criself +#as: --no-underscore --emulation=criself #ld: -m crislinux --export-dynamic tmpdir/libdso-1.so #objdump: -R diff --git a/ld/testsuite/ld-cris/expdyn5.d b/ld/testsuite/ld-cris/expdyn5.d index 818ee4f..0c4dfd0 100644 --- a/ld/testsuite/ld-cris/expdyn5.d +++ b/ld/testsuite/ld-cris/expdyn5.d @@ -1,6 +1,6 @@ #source: expdyn1.s #source: expdref1.s --pic -#as: --no-underscore --em=criself +#as: --no-underscore --emulation=criself #ld: -m crislinux --export-dynamic tmpdir/libdso-1.so --hash-style=sysv #objdump: -s -j .got diff --git a/ld/testsuite/ld-cris/expdyn6.d b/ld/testsuite/ld-cris/expdyn6.d index cf4a578..c315d95 100644 --- a/ld/testsuite/ld-cris/expdyn6.d +++ b/ld/testsuite/ld-cris/expdyn6.d @@ -1,7 +1,7 @@ #source: expdyn1.s #source: expdref1.s --pic #source: euwref1.s --pic -#as: --no-underscore --em=criself +#as: --no-underscore --emulation=criself #ld: -m crislinux --export-dynamic tmpdir/libdso-1.so --hash-style=sysv #objdump: -s -j .got diff --git a/ld/testsuite/ld-cris/expdyn7.d b/ld/testsuite/ld-cris/expdyn7.d index 6028343..a5d52d1 100644 --- a/ld/testsuite/ld-cris/expdyn7.d +++ b/ld/testsuite/ld-cris/expdyn7.d @@ -1,7 +1,7 @@ #source: expdyn1.s #source: expdref1.s --pic #source: comref1.s --pic -#as: --no-underscore --em=criself +#as: --no-underscore --emulation=criself #ld: -m crislinux --export-dynamic tmpdir/libdso-1.so --hash-style=sysv #objdump: -s -j .got diff --git a/ld/testsuite/ld-cris/gotplt1.d b/ld/testsuite/ld-cris/gotplt1.d index 163bb01..96ea5e1 100644 --- a/ld/testsuite/ld-cris/gotplt1.d +++ b/ld/testsuite/ld-cris/gotplt1.d @@ -1,7 +1,7 @@ #source: dso-2.s #source: dsofnf2.s #source: gotrel1.s -#as: --pic --no-underscore --em=criself +#as: --pic --no-underscore --emulation=criself #ld: -m crislinux tmpdir/libdso-1.so --hash-style=sysv #objdump: -sR diff --git a/ld/testsuite/ld-cris/gotplt2.d b/ld/testsuite/ld-cris/gotplt2.d index 32d0f89..32c515f 100644 --- a/ld/testsuite/ld-cris/gotplt2.d +++ b/ld/testsuite/ld-cris/gotplt2.d @@ -1,7 +1,7 @@ #source: dso-2.s #source: dsofnf.s #source: gotrel1.s -#as: --pic --no-underscore --em=criself +#as: --pic --no-underscore --emulation=criself #ld: -shared -m crislinux -z nocombreloc --hash-style=sysv #objdump: -sR diff --git a/ld/testsuite/ld-cris/gotplt3.d b/ld/testsuite/ld-cris/gotplt3.d index abc0192..7dd8562 100644 --- a/ld/testsuite/ld-cris/gotplt3.d +++ b/ld/testsuite/ld-cris/gotplt3.d @@ -2,7 +2,7 @@ #source: dsofnf.s #source: gotrel1.s #source: dso-1.s -#as: --pic --no-underscore --em=criself +#as: --pic --no-underscore --emulation=criself #ld: -shared -m crislinux -z nocombreloc --hash-style=sysv #objdump: -sR diff --git a/ld/testsuite/ld-cris/hiddef1.d b/ld/testsuite/ld-cris/hiddef1.d index 602f1bf..7cbe876 100644 --- a/ld/testsuite/ld-cris/hiddef1.d +++ b/ld/testsuite/ld-cris/hiddef1.d @@ -2,7 +2,7 @@ #source: hiddef1.s #source: hidrefgotplt1.s #ld: -shared -m crislinux --hash-style=sysv -#as: --pic --no-underscore -I$srcdir/$subdir --em=criself +#as: --pic --no-underscore -I$srcdir/$subdir --emulation=criself #readelf: -S -s -r # Regression test for mishandling of GOTPLT relocs against a diff --git a/ld/testsuite/ld-cris/ldsym1.d b/ld/testsuite/ld-cris/ldsym1.d index e8dcd32..2aacf3a 100644 --- a/ld/testsuite/ld-cris/ldsym1.d +++ b/ld/testsuite/ld-cris/ldsym1.d @@ -1,6 +1,6 @@ # source: expdyn1.s # target: cris-*-*elf* cris-*-*aout* -# as: --em=criself +# as: --emulation=criself # ld: -mcriself # objdump: -d diff --git a/ld/testsuite/ld-cris/libdso-1.d b/ld/testsuite/ld-cris/libdso-1.d index 5a7e9a1..ba5d3b0 100644 --- a/ld/testsuite/ld-cris/libdso-1.d +++ b/ld/testsuite/ld-cris/libdso-1.d @@ -1,5 +1,5 @@ #source: dso-1.s -#as: --pic --no-underscore --em=criself +#as: --pic --no-underscore --emulation=criself #ld: --shared -m crislinux #objdump: -T diff --git a/ld/testsuite/ld-cris/libdso-10.d b/ld/testsuite/ld-cris/libdso-10.d index 0f0d562..696b16e 100644 --- a/ld/testsuite/ld-cris/libdso-10.d +++ b/ld/testsuite/ld-cris/libdso-10.d @@ -1,5 +1,5 @@ #source: dso-1.s -#as: --pic --no-underscore --march=v32 --em=criself +#as: --pic --no-underscore --march=v32 --emulation=criself #ld: --shared -m crislinux --hash-style=sysv #objdump: -p -h diff --git a/ld/testsuite/ld-cris/libdso-11.d b/ld/testsuite/ld-cris/libdso-11.d index 0e00ad6..f95ca4f 100644 --- a/ld/testsuite/ld-cris/libdso-11.d +++ b/ld/testsuite/ld-cris/libdso-11.d @@ -1,6 +1,6 @@ #source: dso-1.s #source: dsov32-1.s -#as: --pic --no-underscore --march=v32 --em=criself +#as: --pic --no-underscore --march=v32 --emulation=criself #ld: --shared -m crislinux --hash-style=sysv #objdump: -s -T diff --git a/ld/testsuite/ld-cris/libdso-12.d b/ld/testsuite/ld-cris/libdso-12.d index 7fe8342..1bf4596 100644 --- a/ld/testsuite/ld-cris/libdso-12.d +++ b/ld/testsuite/ld-cris/libdso-12.d @@ -1,7 +1,7 @@ #source: expdyn1.s #source: dsov32-1.s #source: dsov32-2.s -#as: --pic --no-underscore --march=v32 --em=criself +#as: --pic --no-underscore --march=v32 --emulation=criself #ld: --shared -m crislinux -z nocombreloc --hash-style=sysv #objdump: -s -T diff --git a/ld/testsuite/ld-cris/libdso-12b.d b/ld/testsuite/ld-cris/libdso-12b.d index 215d188..a133f11 100644 --- a/ld/testsuite/ld-cris/libdso-12b.d +++ b/ld/testsuite/ld-cris/libdso-12b.d @@ -1,7 +1,7 @@ #source: expdyn1.s #source: dsov32-1.s #source: dsov32-2.s -#as: --pic --no-underscore --march=v32 --em=criself +#as: --pic --no-underscore --march=v32 --emulation=criself #ld: --shared -m crislinux --hash-style=sysv #objdump: -s -T diff --git a/ld/testsuite/ld-cris/libdso-12c.d b/ld/testsuite/ld-cris/libdso-12c.d index 949a0e7..484630e 100644 --- a/ld/testsuite/ld-cris/libdso-12c.d +++ b/ld/testsuite/ld-cris/libdso-12c.d @@ -2,7 +2,7 @@ #source: dsov32-1.s #source: dsov32-2.s #source: dso-1.s -#as: --pic --no-underscore --march=v32 --em=criself +#as: --pic --no-underscore --march=v32 --emulation=criself #ld: --shared -m crislinux --version-script $srcdir/$subdir/hidedsofns2468 --hash-style=sysv #objdump: -s -T diff --git a/ld/testsuite/ld-cris/libdso-13.d b/ld/testsuite/ld-cris/libdso-13.d index b50a5af..ad32019 100644 --- a/ld/testsuite/ld-cris/libdso-13.d +++ b/ld/testsuite/ld-cris/libdso-13.d @@ -1,6 +1,6 @@ #source: dso-1.s #source: dsov32-3.s -#as: --pic --no-underscore --march=v32 --em=criself +#as: --pic --no-underscore --march=v32 --emulation=criself #ld: --shared -m crislinux -z nocombreloc --enable-new-dtags --hash-style=sysv #readelf: -d -r #warning: relocation R_CRIS_32_PCREL should not be used in a shared object; recompile with -fPIC diff --git a/ld/testsuite/ld-cris/libdso-13b.d b/ld/testsuite/ld-cris/libdso-13b.d index cf8200e..b592a9c 100644 --- a/ld/testsuite/ld-cris/libdso-13b.d +++ b/ld/testsuite/ld-cris/libdso-13b.d @@ -1,6 +1,6 @@ #source: dso-1.s #source: dsov32-3.s -#as: --pic --no-underscore --march=v32 --em=criself +#as: --pic --no-underscore --march=v32 --emulation=criself #ld: --shared -m crislinux --version-script $srcdir/$subdir/hidedsofns2468 --hash-style=sysv #readelf: -d -r diff --git a/ld/testsuite/ld-cris/libdso-14.d b/ld/testsuite/ld-cris/libdso-14.d index b87a5ce..ce4b8ad 100644 --- a/ld/testsuite/ld-cris/libdso-14.d +++ b/ld/testsuite/ld-cris/libdso-14.d @@ -1,6 +1,6 @@ #source: dso-1.s #source: dsov32-4.s -#as: --pic --no-underscore --march=v32 --em=criself +#as: --pic --no-underscore --march=v32 --emulation=criself #ld: --shared -m crislinux --hash-style=sysv #readelf: -d -r diff --git a/ld/testsuite/ld-cris/libdso-15.d b/ld/testsuite/ld-cris/libdso-15.d index e772fa3..6f9b575 100644 --- a/ld/testsuite/ld-cris/libdso-15.d +++ b/ld/testsuite/ld-cris/libdso-15.d @@ -1,5 +1,5 @@ #source: expdyn2.s -#as: --pic --no-underscore --em=criself -I$srcdir/$subdir +#as: --pic --no-underscore --emulation=criself -I$srcdir/$subdir #ld: --shared -m crislinux --version-script $srcdir/$subdir/expalltst3 --hash-style=sysv #objdump: -s -T diff --git a/ld/testsuite/ld-cris/libdso-15b.d b/ld/testsuite/ld-cris/libdso-15b.d index d02619b..161a58e 100644 --- a/ld/testsuite/ld-cris/libdso-15b.d +++ b/ld/testsuite/ld-cris/libdso-15b.d @@ -1,5 +1,5 @@ #source: expdref2.s -#as: --pic --no-underscore --em=criself +#as: --pic --no-underscore --emulation=criself #ld: --shared -m crislinux --hash-style=sysv #ld_after_inputfiles: tmpdir/libdso-15.so #objdump: -s -T diff --git a/ld/testsuite/ld-cris/libdso-15c.d b/ld/testsuite/ld-cris/libdso-15c.d index b035990..3adb952 100644 --- a/ld/testsuite/ld-cris/libdso-15c.d +++ b/ld/testsuite/ld-cris/libdso-15c.d @@ -1,5 +1,5 @@ #source: expdref2.s -#as: --pic --no-underscore --em=criself +#as: --pic --no-underscore --emulation=criself #ld: --shared -m crislinux --hash-style=sysv #ld_after_inputfiles: tmpdir/libdso-15.so #readelf: -d diff --git a/ld/testsuite/ld-cris/libdso-1b.d b/ld/testsuite/ld-cris/libdso-1b.d index 56e5788..6d88e13 100644 --- a/ld/testsuite/ld-cris/libdso-1b.d +++ b/ld/testsuite/ld-cris/libdso-1b.d @@ -1,5 +1,5 @@ #source: dso-1b.s -#as: --pic --no-underscore --em=criself -I$srcdir/$subdir +#as: --pic --no-underscore --emulation=criself -I$srcdir/$subdir #ld: --shared -m crislinux --version-script $srcdir/$subdir/hidedsofns2468 --hash-style=sysv #objdump: -T diff --git a/ld/testsuite/ld-cris/libdso-1c.d b/ld/testsuite/ld-cris/libdso-1c.d index d69b857..218f296 100644 --- a/ld/testsuite/ld-cris/libdso-1c.d +++ b/ld/testsuite/ld-cris/libdso-1c.d @@ -1,5 +1,5 @@ #source: expdref1.s -#as: --pic --no-underscore --em=criself -I$srcdir/$subdir +#as: --pic --no-underscore --emulation=criself -I$srcdir/$subdir #ld: --shared -m crislinux --hash-style=sysv #ld_after_inputfiles: tmpdir/libdso-1b.so #objdump: -s -T diff --git a/ld/testsuite/ld-cris/libdso-1d.d b/ld/testsuite/ld-cris/libdso-1d.d index 83a4337..7755b0e 100644 --- a/ld/testsuite/ld-cris/libdso-1d.d +++ b/ld/testsuite/ld-cris/libdso-1d.d @@ -1,6 +1,6 @@ #source: expdref1.s #source: expdyn1w.s -#as: --pic --no-underscore --em=criself -I$srcdir/$subdir +#as: --pic --no-underscore --emulation=criself -I$srcdir/$subdir #ld: --shared -m crislinux --hash-style=sysv #ld_after_inputfiles: tmpdir/libdso-1b.so #objdump: -s -T diff --git a/ld/testsuite/ld-cris/libdso-2.d b/ld/testsuite/ld-cris/libdso-2.d index 900d00d..7133dd5 100644 --- a/ld/testsuite/ld-cris/libdso-2.d +++ b/ld/testsuite/ld-cris/libdso-2.d @@ -1,6 +1,6 @@ #source: dso-1.s #source: dso-2.s -#as: --pic --no-underscore --em=criself +#as: --pic --no-underscore --emulation=criself #ld: --shared -m crislinux --hash-style=sysv --version-script $srcdir/$subdir/hide1 #readelf: -S -s -r diff --git a/ld/testsuite/ld-cris/libdso-3.d b/ld/testsuite/ld-cris/libdso-3.d index 9e18c59..c02eb3d 100644 --- a/ld/testsuite/ld-cris/libdso-3.d +++ b/ld/testsuite/ld-cris/libdso-3.d @@ -1,6 +1,6 @@ #source: expdyn1.s #source: dso-3.s -#as: --pic --no-underscore --em=criself +#as: --pic --no-underscore --emulation=criself #ld: --shared -m crislinux #objdump: -R diff --git a/ld/testsuite/ld-cris/libdso-4.d b/ld/testsuite/ld-cris/libdso-4.d index 3d57395..11a85a1 100644 --- a/ld/testsuite/ld-cris/libdso-4.d +++ b/ld/testsuite/ld-cris/libdso-4.d @@ -1,5 +1,5 @@ #source: dso-2.s -#as: --pic --no-underscore --em=criself +#as: --pic --no-underscore --emulation=criself #ld: --shared -m crislinux --hash-style=sysv #objdump: -T diff --git a/ld/testsuite/ld-cris/locref1.d b/ld/testsuite/ld-cris/locref1.d index ac26b28..da5d86c 100644 --- a/ld/testsuite/ld-cris/locref1.d +++ b/ld/testsuite/ld-cris/locref1.d @@ -1,4 +1,4 @@ -#as: --no-underscore --pic --em=criself +#as: --no-underscore --pic --emulation=criself #source: expdyn1.s #source: locref1.s #ld: -m crislinux diff --git a/ld/testsuite/ld-cris/locref2.d b/ld/testsuite/ld-cris/locref2.d index 0cf5394..4f8712b 100644 --- a/ld/testsuite/ld-cris/locref2.d +++ b/ld/testsuite/ld-cris/locref2.d @@ -1,4 +1,4 @@ -#as: --no-underscore --pic --em=criself +#as: --no-underscore --pic --emulation=criself #source: gotrel1.s #source: locref2.s #ld: -m crislinux diff --git a/ld/testsuite/ld-cris/nodyn4.d b/ld/testsuite/ld-cris/nodyn4.d index c1af092..9a20173 100644 --- a/ld/testsuite/ld-cris/nodyn4.d +++ b/ld/testsuite/ld-cris/nodyn4.d @@ -1,7 +1,7 @@ #source: expdyn1.s #source: expdref1.s --pic #source: comref1.s --pic -#as: --no-underscore --em=criself +#as: --no-underscore --emulation=criself #ld: -m crislinux #readelf: -l diff --git a/ld/testsuite/ld-cris/nodyn5.d b/ld/testsuite/ld-cris/nodyn5.d index 28b581e..0130fa5 100644 --- a/ld/testsuite/ld-cris/nodyn5.d +++ b/ld/testsuite/ld-cris/nodyn5.d @@ -1,7 +1,7 @@ #source: expdyn1.s #source: expdref1.s --pic #source: comref1.s --pic -#as: --no-underscore --em=criself +#as: --no-underscore --emulation=criself #ld: -m crislinux #objdump: -s -j .got diff --git a/ld/testsuite/ld-cris/pcrelcp-1.d b/ld/testsuite/ld-cris/pcrelcp-1.d index 0d5f6b8..7152308 100644 --- a/ld/testsuite/ld-cris/pcrelcp-1.d +++ b/ld/testsuite/ld-cris/pcrelcp-1.d @@ -1,4 +1,4 @@ -#as: --no-underscore --em=criself +#as: --no-underscore --emulation=criself #ld: -shared -m crislinux -z nocombreloc #ld_after_inputfiles: tmpdir/libdso-1b.so #warning: \A[^\n]*\.o, section `.text', to symbol `expfn@@TST2':[^\n]*recompile with -fPIC\Z diff --git a/ld/testsuite/ld-cris/pic-gc-72.d b/ld/testsuite/ld-cris/pic-gc-72.d index 3c096ea..269a5d2 100644 --- a/ld/testsuite/ld-cris/pic-gc-72.d +++ b/ld/testsuite/ld-cris/pic-gc-72.d @@ -1,7 +1,7 @@ #source: pic-gc-72.s #source: expdref1.s #source: expdyn1.s -#as: --pic --no-underscore --em=criself -I$srcdir/$subdir +#as: --pic --no-underscore --emulation=criself -I$srcdir/$subdir #ld: --shared -m crislinux --gc-sections --hash-style=sysv #objdump: -s -t -R -p -T diff --git a/ld/testsuite/ld-cris/pic-gc-73.d b/ld/testsuite/ld-cris/pic-gc-73.d index 603ce45..bafe483 100644 --- a/ld/testsuite/ld-cris/pic-gc-73.d +++ b/ld/testsuite/ld-cris/pic-gc-73.d @@ -1,6 +1,6 @@ #source: pic-gc-73.s #source: expdyn1.s -#as: --pic --no-underscore --em=criself -I$srcdir/$subdir +#as: --pic --no-underscore --emulation=criself -I$srcdir/$subdir #ld: --shared -m crislinux --gc-sections --hash-style=sysv #objdump: -s -t -R -p -T diff --git a/ld/testsuite/ld-cris/pr16044.d b/ld/testsuite/ld-cris/pr16044.d index 9bb264b..59e90bb 100644 --- a/ld/testsuite/ld-cris/pr16044.d +++ b/ld/testsuite/ld-cris/pr16044.d @@ -1,7 +1,7 @@ #source: dso-4.s #source: dso-2b.s #source: dso-1c.s -#as: --pic --no-underscore --em=criself -I$srcdir/$subdir +#as: --pic --no-underscore --emulation=criself -I$srcdir/$subdir #ld: --shared -m crislinux --hash-style=sysv #readelf: -s -r diff --git a/ld/testsuite/ld-cris/pr26589.d b/ld/testsuite/ld-cris/pr26589.d index aee3143..17da49a 100644 --- a/ld/testsuite/ld-cris/pr26589.d +++ b/ld/testsuite/ld-cris/pr26589.d @@ -1,6 +1,6 @@ #source: dso-1.s #source: locref3.s -#as: --pic --no-underscore --em=criself +#as: --pic --no-underscore --emulation=criself #ld: --shared -m crislinux #readelf: --dyn-syms -r diff --git a/ld/testsuite/ld-cris/pv32-1.d b/ld/testsuite/ld-cris/pv32-1.d index 3b17e23..0d9a924 100644 --- a/ld/testsuite/ld-cris/pv32-1.d +++ b/ld/testsuite/ld-cris/pv32-1.d @@ -1,5 +1,5 @@ #source: pv32.s -#as: --march=v32 --no-underscore --em=criself +#as: --march=v32 --no-underscore --emulation=criself #ld: -e here -m crislinux tmpdir/libdso-12.so --hash-style=sysv #objdump: -s -T diff --git a/ld/testsuite/ld-cris/tls-dso-dtpoffd2.d b/ld/testsuite/ld-cris/tls-dso-dtpoffd2.d index 46ad8ab..cd99981 100644 --- a/ld/testsuite/ld-cris/tls-dso-dtpoffd2.d +++ b/ld/testsuite/ld-cris/tls-dso-dtpoffd2.d @@ -3,7 +3,7 @@ #source: tls-gd-1.s #source: tls128.s #source: tls-x.s -#as: --no-underscore --em=criself --pic -I$srcdir/$subdir +#as: --no-underscore --emulation=criself --pic -I$srcdir/$subdir #ld: -m crislinux --shared --hash-style=sysv --hash-style=sysv #objdump: -d -s -t -r -p diff --git a/ld/testsuite/ld-cris/tls-dso-dtpoffd4.d b/ld/testsuite/ld-cris/tls-dso-dtpoffd4.d index a8f1305..b1792e8 100644 --- a/ld/testsuite/ld-cris/tls-dso-dtpoffd4.d +++ b/ld/testsuite/ld-cris/tls-dso-dtpoffd4.d @@ -3,7 +3,7 @@ #source: tls-gd-1.s #source: tls128.s #source: tls-commx.s -#as: --no-underscore --em=criself --pic -I$srcdir/$subdir +#as: --no-underscore --emulation=criself --pic -I$srcdir/$subdir #ld: -m crislinux --shared --hash-style=sysv #objdump: -d -s -t -r -p diff --git a/ld/testsuite/ld-cris/tls-dso-tpoffgotcomm1.d b/ld/testsuite/ld-cris/tls-dso-tpoffgotcomm1.d index a591113..fcdfe4e 100644 --- a/ld/testsuite/ld-cris/tls-dso-tpoffgotcomm1.d +++ b/ld/testsuite/ld-cris/tls-dso-tpoffgotcomm1.d @@ -1,6 +1,6 @@ #source: start1.s #source: tls-dso-tpoffgotcomm1.s -#as: --no-underscore --pic --em=criself -I$srcdir/$subdir +#as: --no-underscore --pic --emulation=criself -I$srcdir/$subdir #ld: -m crislinux -shared --hash-style=sysv #objdump: -d -h -s -t -r -R -p diff --git a/ld/testsuite/ld-cris/tls-dso-x1x2-1.d b/ld/testsuite/ld-cris/tls-dso-x1x2-1.d index 6168701..29e3ed7 100644 --- a/ld/testsuite/ld-cris/tls-dso-x1x2-1.d +++ b/ld/testsuite/ld-cris/tls-dso-x1x2-1.d @@ -1,6 +1,6 @@ #source: tls-hx.s #source: tls-x1x2.s -#as: --no-underscore --em=criself +#as: --no-underscore --emulation=criself #ld: -m crislinux --shared --hash-style=sysv #objdump: -T diff --git a/ld/testsuite/ld-cris/tls-dso-xz-1.d b/ld/testsuite/ld-cris/tls-dso-xz-1.d index 9a33b78..87a0165 100644 --- a/ld/testsuite/ld-cris/tls-dso-xz-1.d +++ b/ld/testsuite/ld-cris/tls-dso-xz-1.d @@ -2,7 +2,7 @@ #source: tls-hx1x2.s #source: tls-x.s #source: tls-z.s -#as: --no-underscore --em=criself +#as: --no-underscore --emulation=criself #ld: -m crislinux --shared #objdump: -T diff --git a/ld/testsuite/ld-cris/tls-e-20.d b/ld/testsuite/ld-cris/tls-e-20.d index eb323a5..d192e84 100644 --- a/ld/testsuite/ld-cris/tls-e-20.d +++ b/ld/testsuite/ld-cris/tls-e-20.d @@ -4,7 +4,7 @@ #source: tls-ld-6.s --pic #source: tls-ie-10.s --pic #source: tls-hx1x2.s --pic -#as: --no-underscore --em=criself -I$srcdir/$subdir +#as: --no-underscore --emulation=criself -I$srcdir/$subdir #ld: -m crislinux #objdump: -d -s -h -t -r -p diff --git a/ld/testsuite/ld-cris/tls-e-20a.d b/ld/testsuite/ld-cris/tls-e-20a.d index 7d5a95e..5680184 100644 --- a/ld/testsuite/ld-cris/tls-e-20a.d +++ b/ld/testsuite/ld-cris/tls-e-20a.d @@ -6,7 +6,7 @@ #source: tls-ie-10.s #source: tls-hx.s #source: tls-hx1x2.s -#as: --no-underscore --em=criself -I$srcdir/$subdir --pic +#as: --no-underscore --emulation=criself -I$srcdir/$subdir --pic #ld: -m crislinux #objdump: -d -s -h -t -r -p diff --git a/ld/testsuite/ld-cris/tls-e-21.d b/ld/testsuite/ld-cris/tls-e-21.d index 80ca3e3..33c2214 100644 --- a/ld/testsuite/ld-cris/tls-e-21.d +++ b/ld/testsuite/ld-cris/tls-e-21.d @@ -2,7 +2,7 @@ #source: tls128.s #source: tls-gd-2.s #source: tls-hx.s -#as: --no-underscore --em=criself --pic +#as: --no-underscore --emulation=criself --pic #ld: -m crislinux #objdump: -d -s -t -r -p diff --git a/ld/testsuite/ld-cris/tls-e-22.d b/ld/testsuite/ld-cris/tls-e-22.d index 93ab45d..c49a4b4 100644 --- a/ld/testsuite/ld-cris/tls-e-22.d +++ b/ld/testsuite/ld-cris/tls-e-22.d @@ -2,7 +2,7 @@ #source: tls128.s #source: tls-ld-6.s #source: tls-hx.s -#as: --no-underscore --em=criself --pic -I$srcdir/$subdir +#as: --no-underscore --emulation=criself --pic -I$srcdir/$subdir #ld: -m crislinux #objdump: -d -s -t -r -p diff --git a/ld/testsuite/ld-cris/tls-e-23.d b/ld/testsuite/ld-cris/tls-e-23.d index a09d55e..ae07bb2 100644 --- a/ld/testsuite/ld-cris/tls-e-23.d +++ b/ld/testsuite/ld-cris/tls-e-23.d @@ -2,7 +2,7 @@ #source: tls128.s #source: tls-ie-10.s #source: tls-hx.s -#as: --no-underscore --em=criself --pic -I$srcdir/$subdir +#as: --no-underscore --emulation=criself --pic -I$srcdir/$subdir #ld: -m crislinux #objdump: -d -s -t -r -p diff --git a/ld/testsuite/ld-cris/tls-e-66.d b/ld/testsuite/ld-cris/tls-e-66.d index ba1755d..f556ddf 100644 --- a/ld/testsuite/ld-cris/tls-e-66.d +++ b/ld/testsuite/ld-cris/tls-e-66.d @@ -1,7 +1,7 @@ #source: start1.s #source: tls-le-12s.s #source: tls-z.s -#as: --no-underscore --em=criself -I$srcdir/$subdir +#as: --no-underscore --emulation=criself -I$srcdir/$subdir #ld: -m crislinux #objdump: -d -s -t -r -p -h diff --git a/ld/testsuite/ld-cris/tls-e-80.d b/ld/testsuite/ld-cris/tls-e-80.d index 15ce3d7..919be62 100644 --- a/ld/testsuite/ld-cris/tls-e-80.d +++ b/ld/testsuite/ld-cris/tls-e-80.d @@ -8,7 +8,7 @@ #source: tls-ld-6.s --pic #source: tls-ie-10.s --pic #source: tls-hx1x2.s --pic -#as: --no-underscore --em=criself -I$srcdir/$subdir +#as: --no-underscore --emulation=criself -I$srcdir/$subdir #ld: -m crislinux #objdump: -d -s -h -t -r -p diff --git a/ld/testsuite/ld-cris/tls-e-dtpoffd1.d b/ld/testsuite/ld-cris/tls-e-dtpoffd1.d index 5da24b5..3d07dbc 100644 --- a/ld/testsuite/ld-cris/tls-e-dtpoffd1.d +++ b/ld/testsuite/ld-cris/tls-e-dtpoffd1.d @@ -3,7 +3,7 @@ #source: tls-gd-1.s #source: tls128.s #source: tls-x.s -#as: --no-underscore --em=criself --pic -I$srcdir/$subdir +#as: --no-underscore --emulation=criself --pic -I$srcdir/$subdir #ld: -m crislinux #objdump: -d -s -t -r -p diff --git a/ld/testsuite/ld-cris/tls-e-dtpoffd3.d b/ld/testsuite/ld-cris/tls-e-dtpoffd3.d index 6013a3a..f619598 100644 --- a/ld/testsuite/ld-cris/tls-e-dtpoffd3.d +++ b/ld/testsuite/ld-cris/tls-e-dtpoffd3.d @@ -3,7 +3,7 @@ #source: tls-gd-1.s #source: tls128.s #source: tls-commx.s -#as: --no-underscore --em=criself --pic -I$srcdir/$subdir +#as: --no-underscore --emulation=criself --pic -I$srcdir/$subdir #ld: -m crislinux #objdump: -d -s -t -r -p diff --git a/ld/testsuite/ld-cris/tls-e-tpiecomm1.d b/ld/testsuite/ld-cris/tls-e-tpiecomm1.d index 2e0f0f0..0360790 100644 --- a/ld/testsuite/ld-cris/tls-e-tpiecomm1.d +++ b/ld/testsuite/ld-cris/tls-e-tpiecomm1.d @@ -1,6 +1,6 @@ #source: start1.s #source: tls-e-tpiecomm1.s -#as: --no-underscore --em=criself -I$srcdir/$subdir +#as: --no-underscore --emulation=criself -I$srcdir/$subdir #ld: -m crislinux #objdump: -d -s -h -t -r -p diff --git a/ld/testsuite/ld-cris/tls-e-tpoffcomm1.d b/ld/testsuite/ld-cris/tls-e-tpoffcomm1.d index 4fc067e..4300a22 100644 --- a/ld/testsuite/ld-cris/tls-e-tpoffcomm1.d +++ b/ld/testsuite/ld-cris/tls-e-tpoffcomm1.d @@ -1,6 +1,6 @@ #source: start1.s #source: tls-e-tpoffcomm1.s -#as: --no-underscore --em=criself -I$srcdir/$subdir +#as: --no-underscore --emulation=criself -I$srcdir/$subdir #ld: -m crislinux #objdump: -d -s -h -t -r -p diff --git a/ld/testsuite/ld-cris/tls-e-tpoffgotcomm1.d b/ld/testsuite/ld-cris/tls-e-tpoffgotcomm1.d index 9d34f68..a0501e9 100644 --- a/ld/testsuite/ld-cris/tls-e-tpoffgotcomm1.d +++ b/ld/testsuite/ld-cris/tls-e-tpoffgotcomm1.d @@ -1,6 +1,6 @@ #source: start1.s #source: tls-dso-tpoffgotcomm1.s --pic -#as: --no-underscore --em=criself -I$srcdir/$subdir +#as: --no-underscore --emulation=criself -I$srcdir/$subdir #ld: -m crislinux #objdump: -d -s -h -t -p diff --git a/ld/testsuite/ld-cris/tls-err-20x.d b/ld/testsuite/ld-cris/tls-err-20x.d index 9a3af03..06661dc 100644 --- a/ld/testsuite/ld-cris/tls-err-20x.d +++ b/ld/testsuite/ld-cris/tls-err-20x.d @@ -3,7 +3,7 @@ #source: tls-ld-6.s --pic #source: tls-ie-10.s --pic #source: tls-hx.s --pic -#as: --no-underscore --em=criself +#as: --no-underscore --emulation=criself #ld: -m crislinux #error: \A[^\n]*: warning: cannot find entry symbol _start; defaulting to [0-9a-f]*\n[^\n]*: in function `tlsdsofn9':\n[^\n]*: undefined reference to `x1'\n[^\n]*: undefined reference to `x2'\Z diff --git a/ld/testsuite/ld-cris/tls-err-24.d b/ld/testsuite/ld-cris/tls-err-24.d index 0867870..504b76e 100644 --- a/ld/testsuite/ld-cris/tls-err-24.d +++ b/ld/testsuite/ld-cris/tls-err-24.d @@ -1,6 +1,6 @@ #source: tls-le-12s.s #source: tls-z.s -#as: --no-underscore --em=criself +#as: --no-underscore --emulation=criself #ld: --shared -m crislinux #error: \A[^\n]*\.o, [^\n]*\n[^\n]*mixup[^\n]*\n[^\n]*invalid operation\Z diff --git a/ld/testsuite/ld-cris/tls-err-25.d b/ld/testsuite/ld-cris/tls-err-25.d index e162d6e..6f049f2 100644 --- a/ld/testsuite/ld-cris/tls-err-25.d +++ b/ld/testsuite/ld-cris/tls-err-25.d @@ -1,6 +1,6 @@ #source: tls-le-12.s #source: tls-z.s -#as: --no-underscore --em=criself +#as: --no-underscore --emulation=criself #ld: --shared -m crislinux #error: \A[^\n]*\.o, [^\n]*\n[^\n]*mixup[^\n]*\n[^\n]*invalid operation\Z diff --git a/ld/testsuite/ld-cris/tls-err-26.d b/ld/testsuite/ld-cris/tls-err-26.d index 45ebfe2..e8f18a3 100644 --- a/ld/testsuite/ld-cris/tls-err-26.d +++ b/ld/testsuite/ld-cris/tls-err-26.d @@ -1,6 +1,6 @@ #source: tls-ld-4.s #source: tls-x.s -#as: --no-underscore --em=criself --pic +#as: --no-underscore --emulation=criself --pic #ld: --shared -m crislinux #error: \A[^\n]*\.o,[^\n]*mixup[^\n]*\n[^\n]*bad value\Z diff --git a/ld/testsuite/ld-cris/tls-err-27.d b/ld/testsuite/ld-cris/tls-err-27.d index ce55924..876e5ad 100644 --- a/ld/testsuite/ld-cris/tls-err-27.d +++ b/ld/testsuite/ld-cris/tls-err-27.d @@ -1,6 +1,6 @@ #source: tls-ld-6.s #source: tls-x.s -#as: --no-underscore --em=criself --pic +#as: --no-underscore --emulation=criself --pic #ld: --shared -m crislinux #error: \A[^\n]*\.o,[^\n]*mixup[^\n]*\n[^\n]*bad value\Z diff --git a/ld/testsuite/ld-cris/tls-err-28.d b/ld/testsuite/ld-cris/tls-err-28.d index 8ccd40b..4edf9f9 100644 --- a/ld/testsuite/ld-cris/tls-err-28.d +++ b/ld/testsuite/ld-cris/tls-err-28.d @@ -1,6 +1,6 @@ #source: tls-gd-3.s #source: tls-x.s -#as: --no-underscore --em=criself +#as: --no-underscore --emulation=criself #ld: --shared -m crislinux #error: \A[^\n]*\.o, [^\n]*\n[^\n]*mixup[^\n]*\n[^\n]*invalid operation\Z diff --git a/ld/testsuite/ld-cris/tls-err-29.d b/ld/testsuite/ld-cris/tls-err-29.d index e0d7327..d5c9d75 100644 --- a/ld/testsuite/ld-cris/tls-err-29.d +++ b/ld/testsuite/ld-cris/tls-err-29.d @@ -1,6 +1,6 @@ #source: init.s #source: tls-gdgotrelm.s --defsym r=8192 -#as: --no-underscore --em=criself --pic +#as: --no-underscore --emulation=criself --pic #ld: --shared -m crislinux #error: \A[^\n]*\.o: in function[^\n]*\n[^\n]*truncated[^\n]*\n[^\n]*too many[^\n]*\Z diff --git a/ld/testsuite/ld-cris/tls-err-31.d b/ld/testsuite/ld-cris/tls-err-31.d index b7484ad..ccc5027 100644 --- a/ld/testsuite/ld-cris/tls-err-31.d +++ b/ld/testsuite/ld-cris/tls-err-31.d @@ -1,5 +1,5 @@ #source: tls-dtprelm.s --defsym r=32768 -#as: --no-underscore --em=criself --pic +#as: --no-underscore --emulation=criself --pic #ld: --shared -m crislinux #error: \A[^\n]*\.o: in function[^\n]*\n[^\n]*truncated[^\n]*\n[^\n]*too big[^\n]*\Z diff --git a/ld/testsuite/ld-cris/tls-err-33.d b/ld/testsuite/ld-cris/tls-err-33.d index 329fae1..d3fb231 100644 --- a/ld/testsuite/ld-cris/tls-err-33.d +++ b/ld/testsuite/ld-cris/tls-err-33.d @@ -1,5 +1,5 @@ #source: tls-gottprelm.s --defsym r=8190 -#as: --no-underscore --em=criself --pic +#as: --no-underscore --emulation=criself --pic #ld: --shared -m crislinux #error: \A[^\n]*\.o: in function[^\n]*\n[^\n]*truncated[^\n]*\n[^\n]*too many[^\n]*\Z diff --git a/ld/testsuite/ld-cris/tls-err-35.d b/ld/testsuite/ld-cris/tls-err-35.d index b203e35..7d7a371 100644 --- a/ld/testsuite/ld-cris/tls-err-35.d +++ b/ld/testsuite/ld-cris/tls-err-35.d @@ -1,6 +1,6 @@ #source: start1.s #source: tls-tprelm.s --defsym r=32768 -#as: --no-underscore --em=criself +#as: --no-underscore --emulation=criself #ld: -m crislinux #error: \A[^\n]*\.o: in function[^\n]*\n[^\n]*truncated[^\n]*\n[^\n]*too big[^\n]*\Z diff --git a/ld/testsuite/ld-cris/tls-err-37.d b/ld/testsuite/ld-cris/tls-err-37.d index a41dd0a..10a2cc2 100644 --- a/ld/testsuite/ld-cris/tls-err-37.d +++ b/ld/testsuite/ld-cris/tls-err-37.d @@ -1,6 +1,6 @@ #source: start1.s #source: tls-gd-2.s --pic -#as: --no-underscore --em=criself +#as: --no-underscore --emulation=criself #ld: -m crislinux #error: \A[^\n]*\.o: in function[^\n]*\n[^\n]*undefined reference[^\n]*\Z diff --git a/ld/testsuite/ld-cris/tls-err-39.d b/ld/testsuite/ld-cris/tls-err-39.d index fbdc698..a666fcb 100644 --- a/ld/testsuite/ld-cris/tls-err-39.d +++ b/ld/testsuite/ld-cris/tls-err-39.d @@ -1,6 +1,6 @@ #source: start1.s #source: tls-ld-6.s --pic -#as: --no-underscore --em=criself +#as: --no-underscore --emulation=criself #ld: -m crislinux #error: \A[^\n]*\.o: in function[^\n]*\n[^\n]*undefined reference[^\n]*\Z diff --git a/ld/testsuite/ld-cris/tls-err-40.d b/ld/testsuite/ld-cris/tls-err-40.d index 91b4165..8bcd356 100644 --- a/ld/testsuite/ld-cris/tls-err-40.d +++ b/ld/testsuite/ld-cris/tls-err-40.d @@ -1,5 +1,5 @@ #source: tls-ld-6.s --pic -#as: --no-underscore --em=criself +#as: --no-underscore --emulation=criself #ld: -m crislinux --shared #error: \A[^\n]*\.o[^\n]*undefined reference[^\n]*\n[^\n]*bad value\Z diff --git a/ld/testsuite/ld-cris/tls-err-41.d b/ld/testsuite/ld-cris/tls-err-41.d index 0c4705f..b74bbb8 100644 --- a/ld/testsuite/ld-cris/tls-err-41.d +++ b/ld/testsuite/ld-cris/tls-err-41.d @@ -1,6 +1,6 @@ #source: start1.s #source: tls-ie-10.s --pic -#as: --no-underscore --em=criself +#as: --no-underscore --emulation=criself #ld: -m crislinux #error: \A[^\n]*\.o: in function[^\n]*\n[^\n]*undefined reference[^\n]*\Z diff --git a/ld/testsuite/ld-cris/tls-err-43.d b/ld/testsuite/ld-cris/tls-err-43.d index bb3abb4..de5eb4c 100644 --- a/ld/testsuite/ld-cris/tls-err-43.d +++ b/ld/testsuite/ld-cris/tls-err-43.d @@ -1,6 +1,6 @@ #source: start1.s #source: tls-le-12.s -#as: --no-underscore --em=criself +#as: --no-underscore --emulation=criself #ld: -m crislinux #error: \A[^\n]*\.o: in function[^\n]*\n[^\n]*undefined reference[^\n]*\Z diff --git a/ld/testsuite/ld-cris/tls-err-44.d b/ld/testsuite/ld-cris/tls-err-44.d index 941e21c..f70a965 100644 --- a/ld/testsuite/ld-cris/tls-err-44.d +++ b/ld/testsuite/ld-cris/tls-err-44.d @@ -1,5 +1,5 @@ #source: tls-le-12.s -#as: --no-underscore --em=criself +#as: --no-underscore --emulation=criself #ld: -m crislinux --shared #error: \A[^\n]*\.o, [^\n]*\n[^\n]*mixup[^\n]*\n[^\n]*invalid operation\Z diff --git a/ld/testsuite/ld-cris/tls-err-45.d b/ld/testsuite/ld-cris/tls-err-45.d index 28faa30..dedab8f 100644 --- a/ld/testsuite/ld-cris/tls-err-45.d +++ b/ld/testsuite/ld-cris/tls-err-45.d @@ -1,6 +1,6 @@ #source: start1.s #source: tls-gd-1.s --pic -#as: --no-underscore --em=criself +#as: --no-underscore --emulation=criself #ld: -m crislinux #error: \A[^\n]*\.o: in function[^\n]*\n[^\n]*undefined reference[^\n]*\Z diff --git a/ld/testsuite/ld-cris/tls-err-47.d b/ld/testsuite/ld-cris/tls-err-47.d index 4f7139b..035ca1e 100644 --- a/ld/testsuite/ld-cris/tls-err-47.d +++ b/ld/testsuite/ld-cris/tls-err-47.d @@ -1,6 +1,6 @@ #source: start1.s #source: tls-ld-4.s --pic -#as: --no-underscore --em=criself +#as: --no-underscore --emulation=criself #ld: -m crislinux #error: \A[^\n]*\.o: in function[^\n]*\n[^\n]*undefined reference[^\n]*\Z diff --git a/ld/testsuite/ld-cris/tls-err-48.d b/ld/testsuite/ld-cris/tls-err-48.d index 756f1b5..5530c34 100644 --- a/ld/testsuite/ld-cris/tls-err-48.d +++ b/ld/testsuite/ld-cris/tls-err-48.d @@ -1,5 +1,5 @@ #source: tls-ld-4.s --pic -#as: --no-underscore --em=criself +#as: --no-underscore --emulation=criself #ld: -m crislinux --shared #error: \A[^\n]*\.o[^\n]*undefined reference[^\n]*\n[^\n]*bad value\Z diff --git a/ld/testsuite/ld-cris/tls-err-49.d b/ld/testsuite/ld-cris/tls-err-49.d index 5d8a9c9..6509560 100644 --- a/ld/testsuite/ld-cris/tls-err-49.d +++ b/ld/testsuite/ld-cris/tls-err-49.d @@ -1,6 +1,6 @@ #source: start1.s #source: tls-ie-8.s --pic -#as: --no-underscore --em=criself +#as: --no-underscore --emulation=criself #ld: -m crislinux #error: \A[^\n]*\.o: in function[^\n]*\n[^\n]*undefined reference[^\n]*\Z diff --git a/ld/testsuite/ld-cris/tls-err-51.d b/ld/testsuite/ld-cris/tls-err-51.d index 3891aac..efe5f3c 100644 --- a/ld/testsuite/ld-cris/tls-err-51.d +++ b/ld/testsuite/ld-cris/tls-err-51.d @@ -1,6 +1,6 @@ #source: start1.s #source: tls-le-12s.s -#as: --no-underscore --em=criself +#as: --no-underscore --emulation=criself #ld: -m crislinux #error: \A[^\n]*\.o: in function[^\n]*\n[^\n]*undefined reference[^\n]*\Z diff --git a/ld/testsuite/ld-cris/tls-err-52.d b/ld/testsuite/ld-cris/tls-err-52.d index b2f85cf..9aeb260 100644 --- a/ld/testsuite/ld-cris/tls-err-52.d +++ b/ld/testsuite/ld-cris/tls-err-52.d @@ -1,5 +1,5 @@ #source: tls-le-12s.s -#as: --no-underscore --em=criself +#as: --no-underscore --emulation=criself #ld: -m crislinux --shared #error: \A[^\n]*\.o, [^\n]*\n[^\n]*mixup[^\n]*\n[^\n]*invalid operation\Z diff --git a/ld/testsuite/ld-cris/tls-err-53.d b/ld/testsuite/ld-cris/tls-err-53.d index 89884be..31f3a3c 100644 --- a/ld/testsuite/ld-cris/tls-err-53.d +++ b/ld/testsuite/ld-cris/tls-err-53.d @@ -1,6 +1,6 @@ #source: start1.s #source: tls-ld-4.s -#as: --no-underscore --em=criself --pic +#as: --no-underscore --emulation=criself --pic #ld: -m crislinux tmpdir/tls-dso-xz-1.so #error: \A[^\n]*\.o,[^\n]*mixup[^\n]*\n[^\n]*bad value\Z diff --git a/ld/testsuite/ld-cris/tls-err-55.d b/ld/testsuite/ld-cris/tls-err-55.d index 32f0517..10a8016 100644 --- a/ld/testsuite/ld-cris/tls-err-55.d +++ b/ld/testsuite/ld-cris/tls-err-55.d @@ -1,5 +1,5 @@ #source: tls-err-55.s -#as: --pic --no-underscore --em=criself -I$srcdir/$subdir +#as: --pic --no-underscore --emulation=criself -I$srcdir/$subdir #ld: --shared -m crislinux #error: \A[^\n]*\.o[^\n]*relocation R_CRIS_32_GOT_GD with non-zero addend 42 against symbol `tls128'[^\n]*\n[^\n]*bad value\Z diff --git a/ld/testsuite/ld-cris/tls-err-56.d b/ld/testsuite/ld-cris/tls-err-56.d index 8a68dd1..d46e27e 100644 --- a/ld/testsuite/ld-cris/tls-err-56.d +++ b/ld/testsuite/ld-cris/tls-err-56.d @@ -1,5 +1,5 @@ #source: tls-err-56.s -#as: --pic --no-underscore --em=criself -I$srcdir/$subdir +#as: --pic --no-underscore --emulation=criself -I$srcdir/$subdir #ld: --shared -m crislinux #error: \A[^\n]*\.o[^\n]*relocation R_CRIS_32_GOT_GD with non-zero addend 42 against symbol `tls128'[^\n]*\n[^\n]*bad value\Z diff --git a/ld/testsuite/ld-cris/tls-err-62.d b/ld/testsuite/ld-cris/tls-err-62.d index da64d1c..1e18000 100644 --- a/ld/testsuite/ld-cris/tls-err-62.d +++ b/ld/testsuite/ld-cris/tls-err-62.d @@ -1,5 +1,5 @@ #source: tls-err-62.s -#as: --pic --no-underscore --em=criself -I$srcdir/$subdir +#as: --pic --no-underscore --emulation=criself -I$srcdir/$subdir #ld: --shared -m crislinux #error: \A[^\n]*\.o[^\n]*relocation R_CRIS_32_GOT_TPREL with non-zero addend 42 against symbol `tls128'[^\n]*\n[^\n]*bad value\Z diff --git a/ld/testsuite/ld-cris/tls-err-65.d b/ld/testsuite/ld-cris/tls-err-65.d index 62958a2..0de5e51 100644 --- a/ld/testsuite/ld-cris/tls-err-65.d +++ b/ld/testsuite/ld-cris/tls-err-65.d @@ -1,6 +1,6 @@ #source: start1.s #source: tls-le-12s.s -#as: --no-underscore --em=criself +#as: --no-underscore --emulation=criself #ld: -m crislinux tmpdir/tls-dso-xz-1.so #error: \A[^\n]*\.o,[^\n]*mixup[^\n]*\n[^\n]*bad value\Z diff --git a/ld/testsuite/ld-cris/tls-err-67.d b/ld/testsuite/ld-cris/tls-err-67.d index 6a010e1..a1493e5 100644 --- a/ld/testsuite/ld-cris/tls-err-67.d +++ b/ld/testsuite/ld-cris/tls-err-67.d @@ -1,6 +1,6 @@ #source: init.s #source: tls-gdgotrelm.s --defsym r=8203 -#as: --no-underscore --em=criself --pic +#as: --no-underscore --emulation=criself --pic #ld: --shared -m crislinux #error: \A[^\n]*\.o: in[^\n]*\n[^\n]*truncated[^\n]*\n[^\n]*too many[^\n]*\n[^\n]*\.o: in[^\n]*\n[^\n]*truncated[^\n]*\n[^\n]*too many[^\n]*\n[^\n]*\.o: in[^\n]*\n[^\n]*truncated[^\n]*\n[^\n]*too many[^\n]*\n[^\n]*\.o: in[^\n]*\n[^\n]*truncated[^\n]*\n[^\n]*too many[^\n]*\n[^\n]*\.o: in[^\n]*\n[^\n]*truncated[^\n]*\n[^\n]*too many[^\n]*\n[^\n]*\.o: in[^\n]*\n[^\n]*truncated[^\n]*\n[^\n]*too many[^\n]*\n[^\n]*\.o: in[^\n]*\n[^\n]*truncated[^\n]*\n[^\n]*too many[^\n]*\n[^\n]*\.o: in[^\n]*\n[^\n]*truncated[^\n]*\n[^\n]*too many[^\n]*\n[^\n]*\.o: in[^\n]*\n[^\n]*truncated[^\n]*\n[^\n]*too many[^\n]*\n[^\n]*\.o: in[^\n]*\n[^\n]*truncated[^\n]*\n[^\n]*too many[^\n]*\n[^\n]*\.o: in[^\n]*\n[^\n]*omitted[^\n]*\Z diff --git a/ld/testsuite/ld-cris/tls-err-77.d b/ld/testsuite/ld-cris/tls-err-77.d index 6b7696b..2888da3 100644 --- a/ld/testsuite/ld-cris/tls-err-77.d +++ b/ld/testsuite/ld-cris/tls-err-77.d @@ -1,6 +1,6 @@ #source: tls-ie-8e.s #source: tls-x.s -#as: --no-underscore --em=criself +#as: --no-underscore --emulation=criself #ld: --shared -m crislinux #error: \A[^\n]*\.o, [^\n]*\n[^\n]*mixup[^\n]*\n[^\n]*invalid operation\Z diff --git a/ld/testsuite/ld-cris/tls-gc-68.d b/ld/testsuite/ld-cris/tls-gc-68.d index c1a7d25..a2c04f1 100644 --- a/ld/testsuite/ld-cris/tls-gc-68.d +++ b/ld/testsuite/ld-cris/tls-gc-68.d @@ -1,7 +1,7 @@ #source: start1.s #source: tls-x.s #source: tls-local-58.s -#as: --pic --no-underscore --em=criself -I$srcdir/$subdir +#as: --pic --no-underscore --emulation=criself -I$srcdir/$subdir #ld: -m crislinux --gc-sections #objdump: -s -t -r -p diff --git a/ld/testsuite/ld-cris/tls-gc-69.d b/ld/testsuite/ld-cris/tls-gc-69.d index ef02437..3714efb 100644 --- a/ld/testsuite/ld-cris/tls-gc-69.d +++ b/ld/testsuite/ld-cris/tls-gc-69.d @@ -1,7 +1,7 @@ #source: start1.s #source: tls-x.s #source: tls-local-59.s -#as: --pic --no-underscore --em=criself -I$srcdir/$subdir +#as: --pic --no-underscore --emulation=criself -I$srcdir/$subdir #ld: -m crislinux --gc-sections #objdump: -s -t -r -p diff --git a/ld/testsuite/ld-cris/tls-gc-70.d b/ld/testsuite/ld-cris/tls-gc-70.d index 74d0d13..b6c5c76 100644 --- a/ld/testsuite/ld-cris/tls-gc-70.d +++ b/ld/testsuite/ld-cris/tls-gc-70.d @@ -2,7 +2,7 @@ #source: tls128.s #source: tls-gd-3.s #source: tls-x.s -#as: --no-underscore --em=criself +#as: --no-underscore --emulation=criself #ld: -m crislinux --gc-sections #objdump: -s -t -r -p diff --git a/ld/testsuite/ld-cris/tls-gc-71.d b/ld/testsuite/ld-cris/tls-gc-71.d index 343204e..c6f35ca 100644 --- a/ld/testsuite/ld-cris/tls-gc-71.d +++ b/ld/testsuite/ld-cris/tls-gc-71.d @@ -2,7 +2,7 @@ #source: init.s #source: tls128g.s #source: tls-hx.s -#as: --pic --no-underscore --em=criself -I$srcdir/$subdir +#as: --pic --no-underscore --emulation=criself -I$srcdir/$subdir #ld: --shared -m crislinux --gc-sections --hash-style=sysv #objdump: -s -t -R -p -T diff --git a/ld/testsuite/ld-cris/tls-gc-75.d b/ld/testsuite/ld-cris/tls-gc-75.d index f377dc2..2ce0fcf 100644 --- a/ld/testsuite/ld-cris/tls-gc-75.d +++ b/ld/testsuite/ld-cris/tls-gc-75.d @@ -4,7 +4,7 @@ #source: tls-ie-10.s #source: tls-gd-1.s #source: tls-ie-8.s -#as: --pic --no-underscore --em=criself -I$srcdir/$subdir +#as: --pic --no-underscore --emulation=criself -I$srcdir/$subdir #ld: -m crislinux --gc-sections #objdump: -s -t -r -p diff --git a/ld/testsuite/ld-cris/tls-gc-76.d b/ld/testsuite/ld-cris/tls-gc-76.d index 2bcf25c..01d37c9 100644 --- a/ld/testsuite/ld-cris/tls-gc-76.d +++ b/ld/testsuite/ld-cris/tls-gc-76.d @@ -1,4 +1,4 @@ -#as: --pic --no-underscore --em=criself -I$srcdir/$subdir +#as: --pic --no-underscore --emulation=criself -I$srcdir/$subdir #ld: -m crislinux --gc-sections -u gc76fn #source: start1.s #source: tls-gc-76.s diff --git a/ld/testsuite/ld-cris/tls-gc-79.d b/ld/testsuite/ld-cris/tls-gc-79.d index a5bd7ff..92fce15 100644 --- a/ld/testsuite/ld-cris/tls-gc-79.d +++ b/ld/testsuite/ld-cris/tls-gc-79.d @@ -2,7 +2,7 @@ #source: tls128.s #source: tls-ie-8e.s #source: tls-x.s -#as: --no-underscore --em=criself +#as: --no-underscore --emulation=criself #ld: -m crislinux --gc-sections #objdump: -s -t -r -p diff --git a/ld/testsuite/ld-cris/tls-gd-1.d b/ld/testsuite/ld-cris/tls-gd-1.d index 5156a27..61d5804 100644 --- a/ld/testsuite/ld-cris/tls-gd-1.d +++ b/ld/testsuite/ld-cris/tls-gd-1.d @@ -1,4 +1,4 @@ -#as: --pic --no-underscore --em=criself +#as: --pic --no-underscore --emulation=criself #ld: --shared -m crislinux --hash-style=sysv #source: tls-gd-1.s #source: tls128.s diff --git a/ld/testsuite/ld-cris/tls-gd-1h.d b/ld/testsuite/ld-cris/tls-gd-1h.d index e012304..242f3ac 100644 --- a/ld/testsuite/ld-cris/tls-gd-1h.d +++ b/ld/testsuite/ld-cris/tls-gd-1h.d @@ -1,4 +1,4 @@ -#as: --pic --no-underscore --em=criself +#as: --pic --no-underscore --emulation=criself #ld: --shared -m crislinux --hash-style=sysv #source: tls-gd-1.s #source: tls128g.s diff --git a/ld/testsuite/ld-cris/tls-gd-2.d b/ld/testsuite/ld-cris/tls-gd-2.d index 107687c..989fa56 100644 --- a/ld/testsuite/ld-cris/tls-gd-2.d +++ b/ld/testsuite/ld-cris/tls-gd-2.d @@ -1,4 +1,4 @@ -#as: --pic --no-underscore --em=criself +#as: --pic --no-underscore --emulation=criself #ld: --shared -m crislinux --hash-style=sysv #source: tls-gd-2.s #source: tls128g.s diff --git a/ld/testsuite/ld-cris/tls-gd-2h.d b/ld/testsuite/ld-cris/tls-gd-2h.d index f5eaa8b..1041de4 100644 --- a/ld/testsuite/ld-cris/tls-gd-2h.d +++ b/ld/testsuite/ld-cris/tls-gd-2h.d @@ -1,4 +1,4 @@ -#as: --pic --no-underscore --em=criself +#as: --pic --no-underscore --emulation=criself #ld: --shared -m crislinux --hash-style=sysv #source: tls-gd-2.s #source: tls128g.s diff --git a/ld/testsuite/ld-cris/tls-gd-3.d b/ld/testsuite/ld-cris/tls-gd-3.d index b2de851..d9ed9de 100644 --- a/ld/testsuite/ld-cris/tls-gd-3.d +++ b/ld/testsuite/ld-cris/tls-gd-3.d @@ -2,7 +2,7 @@ #source: tls128.s #source: tls-gd-3.s #source: tls-x.s -#as: --no-underscore --em=criself +#as: --no-underscore --emulation=criself #ld: -m crislinux #objdump: -d -s -t -r -p diff --git a/ld/testsuite/ld-cris/tls-gd-3h.d b/ld/testsuite/ld-cris/tls-gd-3h.d index 898a670..69455e6 100644 --- a/ld/testsuite/ld-cris/tls-gd-3h.d +++ b/ld/testsuite/ld-cris/tls-gd-3h.d @@ -2,7 +2,7 @@ #source: tls128.s #source: tls-gd-3.s #source: tls-hx.s -#as: --no-underscore --em=criself +#as: --no-underscore --emulation=criself #ld: -m crislinux #objdump: -d -s -t -r -p diff --git a/ld/testsuite/ld-cris/tls-global-74.d b/ld/testsuite/ld-cris/tls-global-74.d index b70c6a9..e0b9859 100644 --- a/ld/testsuite/ld-cris/tls-global-74.d +++ b/ld/testsuite/ld-cris/tls-global-74.d @@ -4,7 +4,7 @@ #source: tls-ie-10.s #source: tls-gd-1.s #source: tls-ie-8.s -#as: --pic --no-underscore --em=criself -I$srcdir/$subdir +#as: --pic --no-underscore --emulation=criself -I$srcdir/$subdir #ld: -m crislinux #objdump: -s -t -r -p diff --git a/ld/testsuite/ld-cris/tls-ie-10.d b/ld/testsuite/ld-cris/tls-ie-10.d index 0df1e9d..bf010f0 100644 --- a/ld/testsuite/ld-cris/tls-ie-10.d +++ b/ld/testsuite/ld-cris/tls-ie-10.d @@ -1,4 +1,4 @@ -#as: --pic --no-underscore --em=criself +#as: --pic --no-underscore --emulation=criself #ld: --shared -m crislinux --hash-style=sysv #source: tls-ie-10.s #source: tls128g.s diff --git a/ld/testsuite/ld-cris/tls-ie-11.d b/ld/testsuite/ld-cris/tls-ie-11.d index 3bd727a..8a43359 100644 --- a/ld/testsuite/ld-cris/tls-ie-11.d +++ b/ld/testsuite/ld-cris/tls-ie-11.d @@ -1,4 +1,4 @@ -#as: --pic --no-underscore --em=criself +#as: --pic --no-underscore --emulation=criself #ld: --shared -m crislinux --hash-style=sysv #source: tls-ie-11.s #source: tls128g.s diff --git a/ld/testsuite/ld-cris/tls-ie-78.d b/ld/testsuite/ld-cris/tls-ie-78.d index ae9862c..7e477490 100644 --- a/ld/testsuite/ld-cris/tls-ie-78.d +++ b/ld/testsuite/ld-cris/tls-ie-78.d @@ -1,7 +1,7 @@ #source: start1.s #source: tls128.s #source: tls-ie-8e.s -#as: --no-underscore --em=criself +#as: --no-underscore --emulation=criself #ld: -m crislinux --hash-style=sysv #ld_after_inputfiles: tmpdir/tls-dso-xz-1.so #objdump: -s -h -t -T -R -r -p diff --git a/ld/testsuite/ld-cris/tls-ie-8.d b/ld/testsuite/ld-cris/tls-ie-8.d index 4af78fb..deed73f 100644 --- a/ld/testsuite/ld-cris/tls-ie-8.d +++ b/ld/testsuite/ld-cris/tls-ie-8.d @@ -1,4 +1,4 @@ -#as: --pic --no-underscore --em=criself +#as: --pic --no-underscore --emulation=criself #ld: --shared -m crislinux --hash-style=sysv #source: tls-ie-8.s #source: tls128g.s diff --git a/ld/testsuite/ld-cris/tls-ie-8e1.d b/ld/testsuite/ld-cris/tls-ie-8e1.d index 0093935..2666e3e 100644 --- a/ld/testsuite/ld-cris/tls-ie-8e1.d +++ b/ld/testsuite/ld-cris/tls-ie-8e1.d @@ -1,4 +1,4 @@ -#as: --no-underscore --em=criself +#as: --no-underscore --emulation=criself #ld: -m crislinux #source: start1.s #source: tls-ie-8e.s diff --git a/ld/testsuite/ld-cris/tls-ie-9.d b/ld/testsuite/ld-cris/tls-ie-9.d index c1b5b1a..5334dc5 100644 --- a/ld/testsuite/ld-cris/tls-ie-9.d +++ b/ld/testsuite/ld-cris/tls-ie-9.d @@ -1,4 +1,4 @@ -#as: --pic --no-underscore --em=criself +#as: --pic --no-underscore --emulation=criself #ld: --shared -m crislinux --hash-style=sysv #source: tls-ie-9.s #source: tls128g.s diff --git a/ld/testsuite/ld-cris/tls-js1.d b/ld/testsuite/ld-cris/tls-js1.d index f007ea4..099d046 100644 --- a/ld/testsuite/ld-cris/tls-js1.d +++ b/ld/testsuite/ld-cris/tls-js1.d @@ -4,7 +4,7 @@ #source: expdyn1.s #source: tls-hx.s #source: dso-1.s -#as: --pic --no-underscore --em=criself --march=v32 +#as: --pic --no-underscore --emulation=criself --march=v32 #ld: --shared -m crislinux --hash-style=sysv #readelf: -a diff --git a/ld/testsuite/ld-cris/tls-ld-4.d b/ld/testsuite/ld-cris/tls-ld-4.d index ea1fc29..2d2c7c5 100644 --- a/ld/testsuite/ld-cris/tls-ld-4.d +++ b/ld/testsuite/ld-cris/tls-ld-4.d @@ -1,4 +1,4 @@ -#as: --pic --no-underscore --em=criself +#as: --pic --no-underscore --emulation=criself #ld: --shared -m crislinux --hash-style=sysv #source: tls-ld-4.s #source: tls128g.s diff --git a/ld/testsuite/ld-cris/tls-ld-5.d b/ld/testsuite/ld-cris/tls-ld-5.d index 5d423aa..f2bb06e 100644 --- a/ld/testsuite/ld-cris/tls-ld-5.d +++ b/ld/testsuite/ld-cris/tls-ld-5.d @@ -1,4 +1,4 @@ -#as: --pic --no-underscore --em=criself +#as: --pic --no-underscore --emulation=criself #ld: --shared -m crislinux --hash-style=sysv #source: tls-ld-5.s #source: tls128g.s diff --git a/ld/testsuite/ld-cris/tls-ld-6.d b/ld/testsuite/ld-cris/tls-ld-6.d index 21dbabe..db00c15 100644 --- a/ld/testsuite/ld-cris/tls-ld-6.d +++ b/ld/testsuite/ld-cris/tls-ld-6.d @@ -1,4 +1,4 @@ -#as: --pic --no-underscore --em=criself -I$srcdir/$subdir +#as: --pic --no-underscore --emulation=criself -I$srcdir/$subdir #ld: --shared -m crislinux --hash-style=sysv #source: tls128g.s #source: tls-ld-6.s diff --git a/ld/testsuite/ld-cris/tls-ld-7.d b/ld/testsuite/ld-cris/tls-ld-7.d index e0fb31e..7f89a90 100644 --- a/ld/testsuite/ld-cris/tls-ld-7.d +++ b/ld/testsuite/ld-cris/tls-ld-7.d @@ -1,4 +1,4 @@ -#as: --pic --no-underscore --em=criself +#as: --pic --no-underscore --emulation=criself #ld: --shared -m crislinux --hash-style=sysv #source: tls-ld-7.s #source: tls128g.s diff --git a/ld/testsuite/ld-cris/tls-ldgd-14.d b/ld/testsuite/ld-cris/tls-ldgd-14.d index 0c1d486..1a93a47 100644 --- a/ld/testsuite/ld-cris/tls-ldgd-14.d +++ b/ld/testsuite/ld-cris/tls-ldgd-14.d @@ -5,7 +5,7 @@ #source: tls-x.s #source: tls-z.s #source: tls-hx1x2.s -#as: --pic --no-underscore --em=criself +#as: --pic --no-underscore --emulation=criself #ld: --shared -m crislinux --hash-style=sysv #objdump: -s -t -R -p -T diff --git a/ld/testsuite/ld-cris/tls-ldgd-15.d b/ld/testsuite/ld-cris/tls-ldgd-15.d index 7916d31..a51e8ff 100644 --- a/ld/testsuite/ld-cris/tls-ldgd-15.d +++ b/ld/testsuite/ld-cris/tls-ldgd-15.d @@ -5,7 +5,7 @@ #source: tls-x.s #source: tls-z.s #source: tls-hx1x2.s -#as: --pic --no-underscore --em=criself +#as: --pic --no-underscore --emulation=criself #ld: --shared -m crislinux --hash-style=sysv #objdump: -s -t -R -p -T diff --git a/ld/testsuite/ld-cris/tls-ldgde-14.d b/ld/testsuite/ld-cris/tls-ldgde-14.d index 9eada3e..0f2d90d 100644 --- a/ld/testsuite/ld-cris/tls-ldgde-14.d +++ b/ld/testsuite/ld-cris/tls-ldgde-14.d @@ -6,7 +6,7 @@ #source: tls-x.s #source: tls-z.s #source: tls-hx1x2.s -#as: --pic --no-underscore --em=criself +#as: --pic --no-underscore --emulation=criself #ld: -m crislinux #objdump: -d -s -h -t -r -p diff --git a/ld/testsuite/ld-cris/tls-ldgde-15.d b/ld/testsuite/ld-cris/tls-ldgde-15.d index d5e993d..8b3c6ed 100644 --- a/ld/testsuite/ld-cris/tls-ldgde-15.d +++ b/ld/testsuite/ld-cris/tls-ldgde-15.d @@ -6,7 +6,7 @@ #source: tls-x.s #source: tls-z.s #source: tls-hx1x2.s -#as: --pic --no-underscore --em=criself +#as: --pic --no-underscore --emulation=criself #ld: -m crislinux #objdump: -d -s -h -t -r -p diff --git a/ld/testsuite/ld-cris/tls-ldgdex-14.d b/ld/testsuite/ld-cris/tls-ldgdex-14.d index 86a8d4e..b96e6de 100644 --- a/ld/testsuite/ld-cris/tls-ldgdex-14.d +++ b/ld/testsuite/ld-cris/tls-ldgdex-14.d @@ -4,7 +4,7 @@ #source: tls-gd-1.s #source: tls-ldgd-14.s #source: tls-hx1x2.s -#as: --pic --no-underscore --em=criself +#as: --pic --no-underscore --emulation=criself #ld: -m crislinux tmpdir/tls-dso-xz-1.so --hash-style=sysv #objdump: -s -h -t -T -R -r -p diff --git a/ld/testsuite/ld-cris/tls-ldgdex-15.d b/ld/testsuite/ld-cris/tls-ldgdex-15.d index 0a4e527..0589a35 100644 --- a/ld/testsuite/ld-cris/tls-ldgdex-15.d +++ b/ld/testsuite/ld-cris/tls-ldgdex-15.d @@ -4,7 +4,7 @@ #source: tls-gd-2.s #source: tls-ldgd-15.s #source: tls-hx1x2.s -#as: --pic --no-underscore --em=criself +#as: --pic --no-underscore --emulation=criself #ld: -m crislinux tmpdir/tls-dso-xz-1.so --hash-style=sysv #objdump: -s -h -t -T -R -r -p diff --git a/ld/testsuite/ld-cris/tls-ldgdx-14.d b/ld/testsuite/ld-cris/tls-ldgdx-14.d index a773522..d9d229e 100644 --- a/ld/testsuite/ld-cris/tls-ldgdx-14.d +++ b/ld/testsuite/ld-cris/tls-ldgdx-14.d @@ -3,7 +3,7 @@ #source: tls-gd-1.s #source: tls-ldgd-14.s #source: tls-hx1x2.s -#as: --pic --no-underscore --em=criself +#as: --pic --no-underscore --emulation=criself #ld: --shared -m crislinux --hash-style=sysv tmpdir/tls-dso-xz-1.so #objdump: -s -h -t -T -R -r -p diff --git a/ld/testsuite/ld-cris/tls-ldgdx-15.d b/ld/testsuite/ld-cris/tls-ldgdx-15.d index e0b9a53..ac3dfd6 100644 --- a/ld/testsuite/ld-cris/tls-ldgdx-15.d +++ b/ld/testsuite/ld-cris/tls-ldgdx-15.d @@ -3,7 +3,7 @@ #source: tls-gd-2.s #source: tls-ldgd-15.s #source: tls-hx1x2.s -#as: --pic --no-underscore --em=criself +#as: --pic --no-underscore --emulation=criself #ld: --shared -m crislinux --hash-style=sysv tmpdir/tls-dso-xz-1.so #objdump: -s -h -t -T -R -r -p diff --git a/ld/testsuite/ld-cris/tls-le-12.d b/ld/testsuite/ld-cris/tls-le-12.d index d24b21b..b5d8abf 100644 --- a/ld/testsuite/ld-cris/tls-le-12.d +++ b/ld/testsuite/ld-cris/tls-le-12.d @@ -2,7 +2,7 @@ #source: tls128.s #source: tls-le-12.s #source: tls-z.s -#as: --no-underscore --em=criself -I$srcdir/$subdir +#as: --no-underscore --emulation=criself -I$srcdir/$subdir #ld: -m crislinux #objdump: -d -s -t -r -p -h diff --git a/ld/testsuite/ld-cris/tls-le-12s.d b/ld/testsuite/ld-cris/tls-le-12s.d index 96570e9..b69b871 100644 --- a/ld/testsuite/ld-cris/tls-le-12s.d +++ b/ld/testsuite/ld-cris/tls-le-12s.d @@ -2,7 +2,7 @@ #source: tls-le-12s.s #source: tls-z.s #source: tls128.s -#as: --no-underscore --em=criself -I$srcdir/$subdir +#as: --no-underscore --emulation=criself -I$srcdir/$subdir #ld: -m crislinux #objdump: -d -s -t -r -p -h diff --git a/ld/testsuite/ld-cris/tls-le-13.d b/ld/testsuite/ld-cris/tls-le-13.d index 3d969ac..c04de57 100644 --- a/ld/testsuite/ld-cris/tls-le-13.d +++ b/ld/testsuite/ld-cris/tls-le-13.d @@ -2,7 +2,7 @@ #source: tls128.s #source: tls-le-13.s #source: tls-x1x2.s -#as: --no-underscore --em=criself -I$srcdir/$subdir +#as: --no-underscore --emulation=criself -I$srcdir/$subdir #ld: -m crislinux #objdump: -d -s -t -r -p -h diff --git a/ld/testsuite/ld-cris/tls-le-13s.d b/ld/testsuite/ld-cris/tls-le-13s.d index 146c913..dc5720e 100644 --- a/ld/testsuite/ld-cris/tls-le-13s.d +++ b/ld/testsuite/ld-cris/tls-le-13s.d @@ -2,7 +2,7 @@ #source: tls128.s #source: tls-le-13s.s #source: tls-x1x2.s -#as: --no-underscore --em=criself -I$srcdir/$subdir +#as: --no-underscore --emulation=criself -I$srcdir/$subdir #ld: -m crislinux #objdump: -d -s -t -r -p -h diff --git a/ld/testsuite/ld-cris/tls-legd-16.d b/ld/testsuite/ld-cris/tls-legd-16.d index 092d39e..b5fc3d7 100644 --- a/ld/testsuite/ld-cris/tls-legd-16.d +++ b/ld/testsuite/ld-cris/tls-legd-16.d @@ -6,7 +6,7 @@ #source: tls-x.s #source: tls-z.s #source: tls-x1x2.s -#as: --no-underscore --em=criself +#as: --no-underscore --emulation=criself #ld: -m crislinux #objdump: -d -s -h -t -r -p diff --git a/ld/testsuite/ld-cris/tls-legd-17.d b/ld/testsuite/ld-cris/tls-legd-17.d index 49f2d45..f7f4421 100644 --- a/ld/testsuite/ld-cris/tls-legd-17.d +++ b/ld/testsuite/ld-cris/tls-legd-17.d @@ -6,7 +6,7 @@ #source: tls-x.s #source: tls-z.s #source: tls-x1x2.s -#as: --no-underscore --em=criself +#as: --no-underscore --emulation=criself #ld: -m crislinux #objdump: -d -s -h -t -r -p diff --git a/ld/testsuite/ld-cris/tls-legdx-16.d b/ld/testsuite/ld-cris/tls-legdx-16.d index badbeb3..11816cc 100644 --- a/ld/testsuite/ld-cris/tls-legdx-16.d +++ b/ld/testsuite/ld-cris/tls-legdx-16.d @@ -4,7 +4,7 @@ #source: tls-gd-3.s #source: tls-legd-16.s #source: tls-x1x2.s -#as: --no-underscore --em=criself +#as: --no-underscore --emulation=criself #ld: -m crislinux tmpdir/tls-dso-xz-1.so --hash-style=sysv #objdump: -s -h -t -T -R -r -p diff --git a/ld/testsuite/ld-cris/tls-legdx-17.d b/ld/testsuite/ld-cris/tls-legdx-17.d index 5b2c7ec..9eba531 100644 --- a/ld/testsuite/ld-cris/tls-legdx-17.d +++ b/ld/testsuite/ld-cris/tls-legdx-17.d @@ -4,7 +4,7 @@ #source: tls-gd-2.s --pic #source: tls-ldgd-14.s --pic #source: tls-x1x2.s -#as: --no-underscore --em=criself +#as: --no-underscore --emulation=criself #ld: -m crislinux tmpdir/tls-dso-xz-1.so --hash-style=sysv #objdump: -s -h -t -T -R -r -p diff --git a/ld/testsuite/ld-cris/tls-leie-18.d b/ld/testsuite/ld-cris/tls-leie-18.d index edff43c..2285f46 100644 --- a/ld/testsuite/ld-cris/tls-leie-18.d +++ b/ld/testsuite/ld-cris/tls-leie-18.d @@ -3,7 +3,7 @@ #source: tls-le-13s.s #source: tls-ie-9.s --pic #source: tls-x1x2.s -#as: --no-underscore --em=criself +#as: --no-underscore --emulation=criself #ld: -m crislinux #objdump: -d -s -h -t -r -p diff --git a/ld/testsuite/ld-cris/tls-leie-19.d b/ld/testsuite/ld-cris/tls-leie-19.d index 859e2e6..09f5cf6 100644 --- a/ld/testsuite/ld-cris/tls-leie-19.d +++ b/ld/testsuite/ld-cris/tls-leie-19.d @@ -6,7 +6,7 @@ #source: tls-hx1x2.s #source: tls-x.s #source: tls-z.s -#as: --no-underscore --em=criself +#as: --no-underscore --emulation=criself #ld: -m crislinux #objdump: -d -s -h -t -r -p diff --git a/ld/testsuite/ld-cris/tls-local-54.d b/ld/testsuite/ld-cris/tls-local-54.d index 0098e56..1209cfd 100644 --- a/ld/testsuite/ld-cris/tls-local-54.d +++ b/ld/testsuite/ld-cris/tls-local-54.d @@ -1,5 +1,5 @@ #source: tls-local-54.s -#as: --pic --no-underscore --em=criself -I$srcdir/$subdir +#as: --pic --no-underscore --emulation=criself -I$srcdir/$subdir #ld: --shared -m crislinux --hash-style=sysv #objdump: -s -t -R -p -T diff --git a/ld/testsuite/ld-cris/tls-local-57.d b/ld/testsuite/ld-cris/tls-local-57.d index cce2486..ed74fe0 100644 --- a/ld/testsuite/ld-cris/tls-local-57.d +++ b/ld/testsuite/ld-cris/tls-local-57.d @@ -1,7 +1,7 @@ #source: start1.s #source: tls-x.s #source: tls-local-57.s -#as: --pic --no-underscore --em=criself -I$srcdir/$subdir +#as: --pic --no-underscore --emulation=criself -I$srcdir/$subdir #ld: -m crislinux #objdump: -s -t -r -p diff --git a/ld/testsuite/ld-cris/tls-local-58.d b/ld/testsuite/ld-cris/tls-local-58.d index d7926bd..e22b393 100644 --- a/ld/testsuite/ld-cris/tls-local-58.d +++ b/ld/testsuite/ld-cris/tls-local-58.d @@ -1,7 +1,7 @@ #source: start1.s #source: tls-x.s #source: tls-local-58.s -#as: --pic --no-underscore --em=criself -I$srcdir/$subdir +#as: --pic --no-underscore --emulation=criself -I$srcdir/$subdir #ld: -m crislinux #objdump: -s -t -r -p diff --git a/ld/testsuite/ld-cris/tls-local-59.d b/ld/testsuite/ld-cris/tls-local-59.d index c37584b..ee68c3a 100644 --- a/ld/testsuite/ld-cris/tls-local-59.d +++ b/ld/testsuite/ld-cris/tls-local-59.d @@ -1,7 +1,7 @@ #source: start1.s #source: tls-x.s #source: tls-local-59.s -#as: --pic --no-underscore --em=criself -I$srcdir/$subdir +#as: --pic --no-underscore --emulation=criself -I$srcdir/$subdir #ld: -m crislinux #objdump: -s -t -r -p diff --git a/ld/testsuite/ld-cris/tls-local-60.d b/ld/testsuite/ld-cris/tls-local-60.d index ce64203..acbed26 100644 --- a/ld/testsuite/ld-cris/tls-local-60.d +++ b/ld/testsuite/ld-cris/tls-local-60.d @@ -1,6 +1,6 @@ #source: tls-x.s #source: tls-local-59.s -#as: --pic --no-underscore --em=criself -I$srcdir/$subdir +#as: --pic --no-underscore --emulation=criself -I$srcdir/$subdir #ld: -m crislinux --shared --hash-style=sysv #objdump: -s -t -r -p -R -T diff --git a/ld/testsuite/ld-cris/tls-local-61.d b/ld/testsuite/ld-cris/tls-local-61.d index c902a87..1a47880 100644 --- a/ld/testsuite/ld-cris/tls-local-61.d +++ b/ld/testsuite/ld-cris/tls-local-61.d @@ -1,5 +1,5 @@ #source: tls-local-59.s -#as: --pic --no-underscore --em=criself -I$srcdir/$subdir +#as: --pic --no-underscore --emulation=criself -I$srcdir/$subdir #ld: -m crislinux --shared --hash-style=sysv #objdump: -s -t -r -p -R -T diff --git a/ld/testsuite/ld-cris/tls-local-63.d b/ld/testsuite/ld-cris/tls-local-63.d index 7fde60a..d0841fb 100644 --- a/ld/testsuite/ld-cris/tls-local-63.d +++ b/ld/testsuite/ld-cris/tls-local-63.d @@ -1,19 +1,16 @@ #source: tls-ie-8.s --pic #source: tls-hx.s -#as: --no-underscore --em=criself +#as: --no-underscore --emulation=criself #ld: -m crislinux --shared --hash-style=sysv -#readelf: -a -x 6 -x 8 -x 5 +#readelf: -r -s -x 6 -x 8 -x 5 # A R_CRIS_16_GOT_TPREL in a DSO against a hidden symbol. Make sure # the relocation, GOT, .text and .tdata have the right contents. -#... Relocation section '.rela.dyn' at offset 0x.* contains 1 entry: Offset Info Type Sym.Value Sym. Name \+ Addend 000021a0 0000001c R_CRIS_32_TPREL[ ]+0 -The decoding of unwind sections for machine type Axis Communications 32-bit embedded processor is not currently supported. - Symbol table '.dynsym' contains 3 entries: Num: Value Size Type Bind Vis Ndx Name #... @@ -23,9 +20,9 @@ Symbol table '.symtab' contains 13 entries: #... Hex dump of section '.text': 0x00000114 5fae0c00 .* -#... + Hex dump of section '.tdata': 0x00002118 280+ .* -#... + Hex dump of section '.got': 0x0+2194 1c210000 0+ 0+ 0+ .* diff --git a/ld/testsuite/ld-cris/tls-local-64.d b/ld/testsuite/ld-cris/tls-local-64.d index ec0b0ea..68989d3 100644 --- a/ld/testsuite/ld-cris/tls-local-64.d +++ b/ld/testsuite/ld-cris/tls-local-64.d @@ -1,21 +1,18 @@ #source: tls-ie-8.s --pic #source: tls128.s #source: tls-hx.s -#as: --no-underscore --em=criself +#as: --no-underscore --emulation=criself #ld: -m crislinux --shared --hash-style=sysv -#readelf: -a -x 6 -x 8 -x 5 +#readelf: -r -s -x 6 -x 8 -x 5 # A R_CRIS_16_GOT_TPREL in a DSO against a hidden symbol, at an offset # into .data. Make sure the relocation, GOT, .text and .tdata have # the right contents. -#... Relocation section '.rela.dyn' at offset 0x.* contains 1 entry: Offset Info Type Sym.Value Sym. Name \+ Addend 00002220 0000001c R_CRIS_32_TPREL[ ]+80 -The decoding of unwind sections for machine type Axis Communications 32-bit embedded processor is not currently supported. - Symbol table '.dynsym' contains 3 entries: Num: Value Size Type Bind Vis Ndx Name #... @@ -25,13 +22,13 @@ Symbol table '.symtab' contains [0-9]+ entries: #... Hex dump of section '.text': 0x00000114 5fae0c00 .* -#... + Hex dump of section '.tdata': 0x00002118 2f0+ 0+ 0+ 0+ .* 0x00002128 0+ 0+ 0+ 0+ .* #... 0x00002188 0+ 0+ 0+ 0+ .* 0x00002198 280+ .* -#... + Hex dump of section '.got': 0x0+2214 9c210000 0+ 0+ 80+ .* diff --git a/ld/testsuite/ld-cris/tls-ok-30.d b/ld/testsuite/ld-cris/tls-ok-30.d index b5f0f56..3e1cbcb 100644 --- a/ld/testsuite/ld-cris/tls-ok-30.d +++ b/ld/testsuite/ld-cris/tls-ok-30.d @@ -1,5 +1,5 @@ #source: tls-gdgotrelm.s --defsym r=8191 -#as: --no-underscore --em=criself --pic +#as: --no-underscore --emulation=criself --pic #ld: --shared -m crislinux --hash-style=sysv #objdump: -s -j .got -R diff --git a/ld/testsuite/ld-cris/tls-ok-32.d b/ld/testsuite/ld-cris/tls-ok-32.d index 6f7dab0..64e4e07 100644 --- a/ld/testsuite/ld-cris/tls-ok-32.d +++ b/ld/testsuite/ld-cris/tls-ok-32.d @@ -1,5 +1,5 @@ #source: tls-dtprelm.s --defsym r=32767 -#as: --no-underscore --em=criself --pic +#as: --no-underscore --emulation=criself --pic #ld: --shared -m crislinux --hash-style=sysv #objdump: -s -j .got -j .text -j .tdata -R diff --git a/ld/testsuite/ld-cris/tls-ok-34.d b/ld/testsuite/ld-cris/tls-ok-34.d index ec2f7ee..c5cf66f 100644 --- a/ld/testsuite/ld-cris/tls-ok-34.d +++ b/ld/testsuite/ld-cris/tls-ok-34.d @@ -1,5 +1,5 @@ #source: tls-gottprelm.s --defsym r=8189 -#as: --no-underscore --em=criself --pic +#as: --no-underscore --emulation=criself --pic #ld: --shared -m crislinux --hash-style=sysv #objdump: -s -j .got -R diff --git a/ld/testsuite/ld-cris/tls-ok-36.d b/ld/testsuite/ld-cris/tls-ok-36.d index fcfecb9..fac6746 100644 --- a/ld/testsuite/ld-cris/tls-ok-36.d +++ b/ld/testsuite/ld-cris/tls-ok-36.d @@ -1,6 +1,6 @@ #source: start1.s #source: tls-tprelm.s --defsym r=32767 -#as: --no-underscore --em=criself +#as: --no-underscore --emulation=criself #ld: -m crislinux #objdump: -s -j .got -j .text -j .tdata diff --git a/ld/testsuite/ld-cris/tls-und-38.d b/ld/testsuite/ld-cris/tls-und-38.d index fefe386..1174658 100644 --- a/ld/testsuite/ld-cris/tls-und-38.d +++ b/ld/testsuite/ld-cris/tls-und-38.d @@ -1,20 +1,17 @@ #source: tls-gd-2.s --pic -#as: --no-underscore --em=criself +#as: --no-underscore --emulation=criself #ld: -m crislinux --shared --hash-style=sysv -#readelf: -a -x 7 +#readelf: -r -s -x 7 # Undefined reference for a R_CRIS_32_GOT_GD in a DSO. Not an error; # it's ok for a DSO to have undefined references upon creation for # global symbols that can be overridden. Just make sure GOT, dynsyms # and dynrelocs look right. -#... Relocation section '.rela.dyn' at offset 0x.* contains 1 entry: Offset +Info +Type +Sym.Value +Sym. Name \+ Addend 00002190 +00000217 R_CRIS_DTP +00000000 +x \+ 0 -The decoding of unwind sections for machine type Axis Communications 32-bit embedded processor is not currently supported. - Symbol table '.dynsym' contains . entries: +Num: +Value +Size +Type +Bind +Vis +Ndx +Name #... diff --git a/ld/testsuite/ld-cris/tls-und-42.d b/ld/testsuite/ld-cris/tls-und-42.d index 6446077..0fe1dfa 100644 --- a/ld/testsuite/ld-cris/tls-und-42.d +++ b/ld/testsuite/ld-cris/tls-und-42.d @@ -1,20 +1,17 @@ #source: tls-ie-10.s --pic -#as: --no-underscore --em=criself +#as: --no-underscore --emulation=criself #ld: -m crislinux --shared --hash-style=sysv -#readelf: -a -x 7 +#readelf: -r -s -x 7 # Undefined reference for a R_CRIS_32_GOT_TPREL in a DSO. Not an # error; it's ok for a DSO to have undefined references upon creation # for global symbols that can be overridden. Just make sure GOT, # dynsyms and dynrelocs look right. -#... Relocation section '.rela.dyn' at offset 0x.* contains 1 entry: Offset +Info +Type +Sym.Value +Sym. Name \+ Addend 00002198 +0000021c R_CRIS_32_TPREL +0+ +x \+ 0 -The decoding of unwind sections for machine type Axis Communications 32-bit embedded processor is not currently supported. - Symbol table '.dynsym' contains . entries: +Num: +Value +Size +Type +Bind +Vis +Ndx +Name #... diff --git a/ld/testsuite/ld-cris/tls-und-46.d b/ld/testsuite/ld-cris/tls-und-46.d index ab62cde..d536844 100644 --- a/ld/testsuite/ld-cris/tls-und-46.d +++ b/ld/testsuite/ld-cris/tls-und-46.d @@ -1,20 +1,17 @@ #source: tls-gd-1.s --pic -#as: --no-underscore --em=criself +#as: --no-underscore --emulation=criself #ld: -m crislinux --shared --hash-style=sysv -#readelf: -a -x 7 +#readelf: -r -s -x 7 # Undefined reference for a R_CRIS_16_GOT_GD in a DSO. Not an error; # it's ok for a DSO to have undefined references upon creation for # global symbols that can be overridden. Just make sure GOT, dynsyms # and dynrelocs look right. -#... Relocation section '.rela.dyn' at offset 0x.* contains 1 entry: Offset +Info +Type +Sym.Value +Sym. Name \+ Addend 0000218c +00000217 R_CRIS_DTP +00000000 +x \+ 0 -The decoding of unwind sections for machine type Axis Communications 32-bit embedded processor is not currently supported. - Symbol table '.dynsym' contains . entries: +Num: +Value +Size +Type +Bind +Vis +Ndx +Name #... diff --git a/ld/testsuite/ld-cris/tls-und-50.d b/ld/testsuite/ld-cris/tls-und-50.d index ed35e42..fd6ff4c 100644 --- a/ld/testsuite/ld-cris/tls-und-50.d +++ b/ld/testsuite/ld-cris/tls-und-50.d @@ -1,20 +1,17 @@ #source: tls-ie-8.s --pic -#as: --no-underscore --em=criself +#as: --no-underscore --emulation=criself #ld: -m crislinux --shared --hash-style=sysv -#readelf: -a -x 7 +#readelf: -r -s -x 7 # Undefined reference for a R_CRIS_16_GOT_TPREL in a DSO. Not an # error; it's ok for a DSO to have undefined references upon creation # for global symbols that can be overridden. Just make sure GOT, # dynsyms and dynrelocs look right. -#... Relocation section '.rela.dyn' at offset 0x.* contains 1 entry: Offset +Info +Type +Sym.Value +Sym. Name \+ Addend 00002190 +0000021c R_CRIS_32_TPREL +0+ +x \+ 0 -The decoding of unwind sections for machine type Axis Communications 32-bit embedded processor is not currently supported. - Symbol table '.dynsym' contains . entries: +Num: +Value +Size +Type +Bind +Vis +Ndx +Name #... diff --git a/ld/testsuite/ld-cris/undef1.d b/ld/testsuite/ld-cris/undef1.d index cec00cb..7940c77 100644 --- a/ld/testsuite/ld-cris/undef1.d +++ b/ld/testsuite/ld-cris/undef1.d @@ -1,6 +1,6 @@ #source: dso-1.s #source: gotrel1.s --pic -#as: --no-underscore --em=criself +#as: --no-underscore --emulation=criself #ld: -m crislinux tmpdir/libdso-4.so #objdump: -T diff --git a/ld/testsuite/ld-cris/undef2.d b/ld/testsuite/ld-cris/undef2.d index cd2c43e..a8e6e86 100644 --- a/ld/testsuite/ld-cris/undef2.d +++ b/ld/testsuite/ld-cris/undef2.d @@ -1,6 +1,6 @@ #source: start1.s #source: stabs1.s #target: cris-*-*elf* cris-*-*aout* -#as: --em=crisaout +#as: --emulation=crisaout #ld: -mcrisaout #error: .o:/blah/foo.c:96:\(.*\): undefined reference to `globsym1'$ diff --git a/ld/testsuite/ld-cris/undef3.d b/ld/testsuite/ld-cris/undef3.d index e21456b..92c348f 100644 --- a/ld/testsuite/ld-cris/undef3.d +++ b/ld/testsuite/ld-cris/undef3.d @@ -1,6 +1,6 @@ #source: start1.s #source: stabs1.s #target: cris-*-*elf* cris-*-*aout* -#as: --em=criself +#as: --emulation=criself #ld: -mcriself #error: .o:/blah/foo.c:96:\(.*\): undefined reference to `globsym1'$ diff --git a/ld/testsuite/ld-cris/v10-v32.d b/ld/testsuite/ld-cris/v10-v32.d index d692926..0c41946 100644 --- a/ld/testsuite/ld-cris/v10-v32.d +++ b/ld/testsuite/ld-cris/v10-v32.d @@ -1,7 +1,7 @@ # notarget: cris*-*-linux-gnu # source: start1.s --march=v32 # source: move-1.s --march=v0_v10 -# as: --em=criself +# as: --emulation=criself # ld: -m criself # error: contains non-CRIS-v32 code diff --git a/ld/testsuite/ld-cris/v10-va.d b/ld/testsuite/ld-cris/v10-va.d index c6db037..f5288bb 100644 --- a/ld/testsuite/ld-cris/v10-va.d +++ b/ld/testsuite/ld-cris/v10-va.d @@ -1,7 +1,7 @@ # notarget: cris*-*-linux-gnu # source: start1.s --march=common_v10_v32 # source: move-1.s --march=v0_v10 -# as: --em=criself +# as: --emulation=criself # ld: -m criself # objdump: -p diff --git a/ld/testsuite/ld-cris/v32-ba-1.d b/ld/testsuite/ld-cris/v32-ba-1.d index b4ce78d..24c9ed8 100644 --- a/ld/testsuite/ld-cris/v32-ba-1.d +++ b/ld/testsuite/ld-cris/v32-ba-1.d @@ -1,5 +1,5 @@ # notarget: cris*-*-linux-gnu -# as: --march=v32 --em=criself +# as: --march=v32 --emulation=criself # ld: -m criself # objdump: -d diff --git a/ld/testsuite/ld-cris/v32-bin-1.d b/ld/testsuite/ld-cris/v32-bin-1.d index 3a8714b..3eb94b7 100644 --- a/ld/testsuite/ld-cris/v32-bin-1.d +++ b/ld/testsuite/ld-cris/v32-bin-1.d @@ -1,5 +1,5 @@ #notarget: cris*-*-linux-gnu -#as: --em=criself --march=v32 +#as: --emulation=criself --march=v32 #ld: -m criself --oformat binary --defsym ext1=0x4000 --defsym ext2=0x6000 #objdump: -s -b binary diff --git a/ld/testsuite/ld-cris/v32-v10.d b/ld/testsuite/ld-cris/v32-v10.d index a96120f..23995b2 100644 --- a/ld/testsuite/ld-cris/v32-v10.d +++ b/ld/testsuite/ld-cris/v32-v10.d @@ -1,7 +1,7 @@ # notarget: cris*-*-linux-gnu # source: start1.s --march=v0_v10 # source: move-1.s --march=v32 -# as: --em=criself +# as: --emulation=criself # ld: -m criself # error: contains CRIS v32 code diff --git a/ld/testsuite/ld-cris/v32-va.d b/ld/testsuite/ld-cris/v32-va.d index 526d3c3..28d1c9e 100644 --- a/ld/testsuite/ld-cris/v32-va.d +++ b/ld/testsuite/ld-cris/v32-va.d @@ -1,7 +1,7 @@ # notarget: cris*-*-linux-gnu # source: start1.s --march=common_v10_v32 # source: move-1.s --march=v32 -# as: --em=criself +# as: --emulation=criself # ld: -m criself # objdump: -p diff --git a/ld/testsuite/ld-cris/va-v10.d b/ld/testsuite/ld-cris/va-v10.d index d6bda58..94579f3 100644 --- a/ld/testsuite/ld-cris/va-v10.d +++ b/ld/testsuite/ld-cris/va-v10.d @@ -1,7 +1,7 @@ # notarget: cris*-*-linux-gnu # source: start1.s --march=v0_v10 # source: move-1.s --march=common_v10_v32 -# as: --em=criself +# as: --emulation=criself # ld: -m criself # objdump: -p diff --git a/ld/testsuite/ld-cris/va-v32.d b/ld/testsuite/ld-cris/va-v32.d index b598ff5..8c16b05 100644 --- a/ld/testsuite/ld-cris/va-v32.d +++ b/ld/testsuite/ld-cris/va-v32.d @@ -1,7 +1,7 @@ # notarget: cris*-*-linux-gnu # source: start1.s --march=v32 # source: move-1.s --march=common_v10_v32 -# as: --em=criself +# as: --emulation=criself # ld: -m criself # objdump: -p diff --git a/ld/testsuite/ld-cris/warn1.d b/ld/testsuite/ld-cris/warn1.d index ecdf19e..7ba9225 100644 --- a/ld/testsuite/ld-cris/warn1.d +++ b/ld/testsuite/ld-cris/warn1.d @@ -2,7 +2,7 @@ #source: globsym1ref.s #source: globsymw1.s #target: cris-*-*elf* cris-*-*aout* -#as: --em=crisaout +#as: --emulation=crisaout #ld: -mcrisaout #objdump: -p # There should be no warning, since the symbol warned about is diff --git a/ld/testsuite/ld-cris/warn2.d b/ld/testsuite/ld-cris/warn2.d index 96f089e..dd48f8c 100644 --- a/ld/testsuite/ld-cris/warn2.d +++ b/ld/testsuite/ld-cris/warn2.d @@ -2,7 +2,7 @@ #source: globsym1ref.s #source: globsymw1.s #target: cris-*-*elf* cris-*-*aout* -#as: --em=criself +#as: --emulation=criself #ld: -mcriself #objdump: -p # There should be no warning, since the symbol warned about is diff --git a/ld/testsuite/ld-cris/warn3.d b/ld/testsuite/ld-cris/warn3.d index 8cd1435..3f87fcc 100644 --- a/ld/testsuite/ld-cris/warn3.d +++ b/ld/testsuite/ld-cris/warn3.d @@ -2,7 +2,7 @@ #source: globsym1ref.s #source: globsymw2.s #target: cris-*-*elf* cris-*-*aout* -#as: --em=crisaout +#as: --emulation=crisaout #ld: -mcrisaout #warning: warning: isatty is not implemented, will always fail$ #objdump: -p diff --git a/ld/testsuite/ld-cris/warn4.d b/ld/testsuite/ld-cris/warn4.d index dc096b6..cc1ebb5 100644 --- a/ld/testsuite/ld-cris/warn4.d +++ b/ld/testsuite/ld-cris/warn4.d @@ -2,7 +2,7 @@ #source: globsym1ref.s #source: globsymw2.s #target: cris-*-*elf* cris-*-*aout* -#as: --em=criself +#as: --emulation=criself #ld: -mcriself #warning: warning: isatty is not implemented and will always fail$ #objdump: -p diff --git a/ld/testsuite/ld-cris/weakhiddso.d b/ld/testsuite/ld-cris/weakhiddso.d index f4776d6..41d21a7 100644 --- a/ld/testsuite/ld-cris/weakhiddso.d +++ b/ld/testsuite/ld-cris/weakhiddso.d @@ -1,5 +1,5 @@ #source: weakhid.s -#as: --pic --no-underscore --em=criself +#as: --pic --no-underscore --emulation=criself #ld: --shared -m crislinux -z nocombreloc --hash-style=sysv #objdump: -s -R -T diff --git a/ld/testsuite/ld-cris/weakref1.d b/ld/testsuite/ld-cris/weakref1.d index 6dab5e4..53697e2 100644 --- a/ld/testsuite/ld-cris/weakref1.d +++ b/ld/testsuite/ld-cris/weakref1.d @@ -1,5 +1,5 @@ #source: gotrel2.s -#as: --pic --no-underscore --em=criself +#as: --pic --no-underscore --emulation=criself #ld: -m crislinux tmpdir/libdso-1.so #objdump: -R diff --git a/ld/testsuite/ld-cris/weakref2.d b/ld/testsuite/ld-cris/weakref2.d index fa9689b..00ac443 100644 --- a/ld/testsuite/ld-cris/weakref2.d +++ b/ld/testsuite/ld-cris/weakref2.d @@ -1,5 +1,5 @@ #source: gotrel2.s -#as: --pic --no-underscore --em=criself +#as: --pic --no-underscore --emulation=criself #ld: -m crislinux tmpdir/libdso-1.so --hash-style=sysv #objdump: -s -j .got diff --git a/ld/testsuite/ld-cris/weakref3.d b/ld/testsuite/ld-cris/weakref3.d index 46ac80c..ffb9955 100644 --- a/ld/testsuite/ld-cris/weakref3.d +++ b/ld/testsuite/ld-cris/weakref3.d @@ -1,9 +1,9 @@ #source: start1.s #source: expdref3.s -#as: --no-underscore --em=criself +#as: --no-underscore --emulation=criself #ld: -m crislinux --hash-style=sysv #ld_after_inputfiles: tmpdir/libdso-15.so -#readelf: -a -x 10 +#readelf: -S -r -s -x 10 # Like libdso-15b.d, but referencing the weak symbol and function from # a program. At some time we broke emitting a copy reloc for the @@ -22,8 +22,6 @@ Relocation section '.rela.plt' at offset 0x... contains 1 entry: Offset +Info +Type +Sym.Value +Sym. Name \+ Addend .* R_CRIS_JUMP_SLOT .* expfn2@TST3 \+ 0 -The decoding of unwind sections for machine type Axis Communications 32-bit embedded processor is not currently supported. - Symbol table '.dynsym' contains . entries: #... +.: [0-9a-f]* +4 +OBJECT +GLOBAL +DEFAULT +13 __expobj2@TST3 \(2\) diff --git a/ld/testsuite/ld-cris/weakref4.d b/ld/testsuite/ld-cris/weakref4.d index 520191f..a52f86a 100644 --- a/ld/testsuite/ld-cris/weakref4.d +++ b/ld/testsuite/ld-cris/weakref4.d @@ -1,9 +1,9 @@ #source: start1.s #source: expdref4.s -#as: --no-underscore --em=criself +#as: --no-underscore --emulation=criself #ld: -m crislinux --hash-style=sysv #ld_after_inputfiles: tmpdir/libdso-15.so -#readelf: -a -x 11 +#readelf: -S -r -s -x 11 # Like weakref3.d, but just the expobj2 referenced from .data. We # should avoid a copy reloc (instead emitting a R_CRIS_GLOB_DAT or @@ -19,8 +19,6 @@ Relocation section '.rela.dyn' at offset 0x... contains 1 entry: #... .* R_CRIS_COPY .* __expobj2@TST3 \+ 0 -The decoding of unwind sections for machine type Axis Communications 32-bit embedded processor is not currently supported. - Symbol table '.dynsym' contains . entries: #... +.: [0-9a-f]* +4 +OBJECT +GLOBAL +DEFAULT +12 __expobj2@TST3 \(2\) diff --git a/ld/testsuite/ld-ctf/ctf.exp b/ld/testsuite/ld-ctf/ctf.exp index c314f29..3ce5e1e 100644 --- a/ld/testsuite/ld-ctf/ctf.exp +++ b/ld/testsuite/ld-ctf/ctf.exp @@ -38,6 +38,11 @@ if {[info exists env(LC_ALL)]} { } set env(LC_ALL) "C" +set saved_ASFLAGS "$ASFLAGS" +if [istarget "sparc-*-*"] { + append ASFLAGS " -Av8plus" +} + set ctf_test_list [lsort [glob -nocomplain $srcdir/$subdir/*.d]] foreach ctf_test $ctf_test_list { @@ -50,6 +55,8 @@ foreach ctf_test $ctf_test_list { run_dump_test [file rootname $ctf_test] { { cc "-gctf -fPIC" } } } +set ASFLAGS "$saved_ASFLAGS" + if {[info exists old_lc_all]} { set env(LC_ALL) $old_lc_all } else { diff --git a/ld/testsuite/ld-elf/binutils.exp b/ld/testsuite/ld-elf/binutils.exp index 578b639..4fd2eab 100644 --- a/ld/testsuite/ld-elf/binutils.exp +++ b/ld/testsuite/ld-elf/binutils.exp @@ -25,7 +25,6 @@ if { !([istarget *-*-linux*] || [istarget arm*-*-uclinuxfdpiceabi] - || [istarget *-*-nacl*] || [istarget *-*-gnu*]) || [istarget *ecoff] } then { return } diff --git a/ld/testsuite/ld-elf/build-id.exp b/ld/testsuite/ld-elf/build-id.exp index 3c83743..1b97e24 100644 --- a/ld/testsuite/ld-elf/build-id.exp +++ b/ld/testsuite/ld-elf/build-id.exp @@ -31,7 +31,6 @@ if { [istarget frv-*-*] || [istarget lm32-*-*] } { if { !([istarget *-*-linux*] || [istarget arm*-*-uclinuxfdpiceabi] - || [istarget *-*-nacl*] || [istarget *-*-gnu*]) } then { return } diff --git a/ld/testsuite/ld-elf/dwarf.exp b/ld/testsuite/ld-elf/dwarf.exp index c7b2915..4f79635 100644 --- a/ld/testsuite/ld-elf/dwarf.exp +++ b/ld/testsuite/ld-elf/dwarf.exp @@ -69,11 +69,11 @@ set run_tests { } # Disable all sanitizers. -set old_CFLAGS "$CFLAGS_FOR_TARGET" -append CFLAGS_FOR_TARGET " $NOSANITIZE_CFLAGS" +set old_CFLAGS "$CFLAGS_FOR_TARGET_TEST" +append CFLAGS_FOR_TARGET_TEST " $NOSANITIZE_CFLAGS" run_cc_link_tests $build_tests run_ld_link_exec_tests $run_tests -set CFLAGS_FOR_TARGET "$old_CFLAGS" +set CFLAGS_FOR_TARGET_TEST "$old_CFLAGS" proc strip_test {} { global ld diff --git a/ld/testsuite/ld-elf/eh-group.exp b/ld/testsuite/ld-elf/eh-group.exp index 1656c2e..c157141 100644 --- a/ld/testsuite/ld-elf/eh-group.exp +++ b/ld/testsuite/ld-elf/eh-group.exp @@ -40,6 +40,11 @@ if ![is_elf_format] { return } +set as_gsframe "" +if { [gas_sframe_check] } { + set as_gsframe "--gsframe" +} + # alpha-linux-gnu does not support 64-bit relocations: # relocation truncated to fit: REFLONG against `.gcc_except_table' # arm-eabi does not support 64-bit relocations: @@ -58,7 +63,7 @@ if [is_elf64 "tmpdir/eh-group1size.o"] { set build_tests_ld [list \ [list "Build eh-group1.o" \ - "-r" "" "$as_options" \ + "-r" "" "$as_options $as_gsframe" \ {eh-group1.s eh-group2.s} {} "eh-group.o"] \ ] diff --git a/ld/testsuite/ld-elf/ehdr_start-missing.d b/ld/testsuite/ld-elf/ehdr_start-missing.d index 3fb85e0..2374696 100644 --- a/ld/testsuite/ld-elf/ehdr_start-missing.d +++ b/ld/testsuite/ld-elf/ehdr_start-missing.d @@ -1,5 +1,5 @@ #source: ehdr_start-strongref.s #ld: -e _start -T ehdr_start-missing.t --no-dynamic-linker #error: .*: undefined reference to `__ehdr_start' -#target: *-*-linux* *-*-gnu* *-*-nacl* arm*-*-uclinuxfdpiceabi +#target: *-*-linux* *-*-gnu* arm*-*-uclinuxfdpiceabi #xfail: bfin-*-* diff --git a/ld/testsuite/ld-elf/ehdr_start-shared.d b/ld/testsuite/ld-elf/ehdr_start-shared.d index a2a4dcc..319cd93 100644 --- a/ld/testsuite/ld-elf/ehdr_start-shared.d +++ b/ld/testsuite/ld-elf/ehdr_start-shared.d @@ -1,7 +1,7 @@ #source: ehdr_start.s #ld: -e _start -shared -z notext #nm: -n -#target: *-*-linux* *-*-gnu* *-*-nacl* arm*-*-uclinuxfdpiceabi +#target: *-*-linux* *-*-gnu* arm*-*-uclinuxfdpiceabi #xfail: bfin-*-* cris*-*-* frv-*-* lm32-*-* ![check_shared_lib_support] #... diff --git a/ld/testsuite/ld-elf/ehdr_start-userdef.d b/ld/testsuite/ld-elf/ehdr_start-userdef.d index 93ed0d8..b41436e 100644 --- a/ld/testsuite/ld-elf/ehdr_start-userdef.d +++ b/ld/testsuite/ld-elf/ehdr_start-userdef.d @@ -1,7 +1,7 @@ #source: ehdr_start-strongref.s #ld: -e _start -T ehdr_start-userdef.t #readelf: -Ws -#target: *-*-linux* *-*-gnu* *-*-nacl* arm*-*-uclinuxfdpiceabi +#target: *-*-linux* *-*-gnu* arm*-*-uclinuxfdpiceabi #xfail: bfin-*-* frv-*-* #... diff --git a/ld/testsuite/ld-elf/ehdr_start-weak.d b/ld/testsuite/ld-elf/ehdr_start-weak.d index c4f9072..d77a464 100644 --- a/ld/testsuite/ld-elf/ehdr_start-weak.d +++ b/ld/testsuite/ld-elf/ehdr_start-weak.d @@ -1,7 +1,7 @@ #source: ehdr_start.s #ld: -e _start -T ehdr_start-missing.t --no-dynamic-linker #nm: -n -#target: *-*-linux* *-*-gnu* *-*-nacl* arm*-*-uclinuxfdpiceabi +#target: *-*-linux* *-*-gnu* arm*-*-uclinuxfdpiceabi #xfail: bfin-*-* frv-*-* #failif diff --git a/ld/testsuite/ld-elf/ehdr_start.d b/ld/testsuite/ld-elf/ehdr_start.d index 0ec3b13..2e9a2fa 100644 --- a/ld/testsuite/ld-elf/ehdr_start.d +++ b/ld/testsuite/ld-elf/ehdr_start.d @@ -1,7 +1,7 @@ #source: ehdr_start.s #ld: -e _start --build-id #nm: -n -#target: *-*-linux* *-*-gnu* *-*-nacl* arm*-*-uclinuxfdpiceabi +#target: *-*-linux* *-*-gnu* arm*-*-uclinuxfdpiceabi #xfail: bfin-*-* frv-*-* lm32-*-* #... diff --git a/ld/testsuite/ld-elf/elf.exp b/ld/testsuite/ld-elf/elf.exp index 7e69940..098e712 100644 --- a/ld/testsuite/ld-elf/elf.exp +++ b/ld/testsuite/ld-elf/elf.exp @@ -86,6 +86,9 @@ run_ld_link_tests [list \ if [is_elf64 tmpdir/symbol3w.a] { set ASFLAGS "$ASFLAGS --defsym ALIGN=3" + if { [istarget powerpc*-*-linux*] } { + set LDFLAGS "$LDFLAGS --no-ld-generated-unwind-info" + } set pr23900_1_exp "pr23900-1-64.rd" set pr25490_2_exp "pr25490-2-64.rd" set pr25490_3_exp "pr25490-3-64.rd" @@ -229,7 +232,6 @@ proc target_defaults_to_execstack {} { } if { [istarget *-*-*linux*] - || [istarget *-*-nacl*] || [istarget *-*-gnu*] } { run_ld_link_tests [list \ [list "stack exec" \ @@ -286,6 +288,13 @@ if { [istarget *-*-*linux*] {pr29072-a.s} \ {{ld pr29072.a.warn}} \ "pr29072-a.exe"] \ + [list "Test --error-execstack with an executable .note.GNU-stack" \ + "--warn-execstack --error-execstack" \ + "" \ + "" \ + {pr29072-a.s} \ + {{ld gnu_execstack.err}} \ + "gnu_execstack.exe"] \ [list "PR 29072 (warn about -z execstack)" \ "-z execstack --warn-execstack --no-error-execstack" \ "" \ @@ -293,6 +302,13 @@ if { [istarget *-*-*linux*] {stack.s} \ {{ld pr29072.c.warn}} \ "pr29072-c.exe"] \ + [list "Test --error-execstack with -z execstack" \ + "-z execstack --warn-execstack --error-execstack" \ + "" \ + "" \ + {stack.s} \ + {{ld z_execstack.err}} \ + "execstack.exe"] \ [list "PR ld/29072 (suppress warnings about executable stack)" \ "-e 0 --no-warn-execstack" \ "" \ @@ -300,13 +316,20 @@ if { [istarget *-*-*linux*] {pr29072-a.s} \ {} \ "pr29072-d.exe"] \ - [list "Ensure that a warning issued when creating a segment with RWX permissions" \ + [list "Ensure that a warning is issued when creating a segment with RWX permissions" \ "-e 0 -Tnobits-1.t --warn-rwx-segments --no-error-rwx-segments" \ "" \ "" \ {nobits-1.s} \ {{ld rwx-segments-1.l}} \ "rwx-segments-1.exe"] \ + [list "Ensure that a error can be issued when creating a segment with RWX permissions" \ + "-e 0 -Tnobits-1.t --warn-rwx-segments --error-rwx-segments" \ + "" \ + "" \ + {nobits-1.s} \ + {{ld rwx-segments-3.err}} \ + "rwx-segments-3.exe"] \ [list "Ensure that a warning issued when creating a TLS segment with execute permission" \ "-e 0 -T rwx-segments-2.t --warn-rwx-segments --no-error-rwx-segments" \ "" \ @@ -314,6 +337,13 @@ if { [istarget *-*-*linux*] {size-2.s} \ {{ld rwx-segments-2.l}} \ "rwx-segments-2.exe"] \ + [list "Ensure that an error cn be issued when creating a TLS segment with execute permission" \ + "-e 0 -T rwx-segments-2.t --warn-rwx-segments --error-rwx-segments" \ + "" \ + "" \ + {size-2.s} \ + {{ld rwx-segments-4.err}} \ + "rwx-segments-4.exe"] \ [list "Ensure that the RWX warning can be suppressed" \ "-e 0 -Tnobits-1.t --no-warn-rwx-segments" \ "" \ @@ -335,6 +365,16 @@ if { [istarget *-*-*linux*] {{ld pr29072.b.warn}} \ "pr29072-b.exe"] \ ] + + run_ld_link_tests [list \ + [list "error when .note.GNU-stack is absent" \ + "-e 0 -z stack-size=0x123400 --warn-execstack --error-execstack" \ + "" \ + "" \ + {pr29072-b.s} \ + {{ld missing-execstack.err}} \ + "missing-execstack.exe"] \ + ] } else { run_ld_link_tests [list \ [list "PR ld/29072 (ignore absent .note.GNU-stack)" \ @@ -445,7 +485,6 @@ set xfails "*-*-netbsd*" run_ld_link_exec_tests $array_tests $xfails if { [istarget *-*-linux*] - || [istarget *-*-nacl*] || [istarget *-*-gnu*] } { run_ld_link_exec_tests $array_tests_pie $xfails diff --git a/ld/testsuite/ld-elf/export-class.exp b/ld/testsuite/ld-elf/export-class.exp index 7a84755..f4a0634 100644 --- a/ld/testsuite/ld-elf/export-class.exp +++ b/ld/testsuite/ld-elf/export-class.exp @@ -33,7 +33,6 @@ if { ![is_elf_format] || ![check_shared_lib_support] } { # if you like. if { ![istarget *-*-linux*] && ![istarget arm*-*-uclinuxfdpiceabi] - && ![istarget *-*-nacl*] && ![istarget *-*-gnu*] } { return } diff --git a/ld/testsuite/ld-elf/fatal-warnings-1a.d b/ld/testsuite/ld-elf/fatal-warnings-1a.d index 7afee53..a8632ba 100644 --- a/ld/testsuite/ld-elf/fatal-warnings-1a.d +++ b/ld/testsuite/ld-elf/fatal-warnings-1a.d @@ -3,4 +3,4 @@ #ld: --no-dynamic-linker --fatal-warnings -z dynamic-undefined-weak #readelf: -r -x .data.rel.ro #error: unsupported option: -z dynamic-undefined-weak -#target: *-*-linux* *-*-gnu* *-*-nacl* arm*-*-uclinuxfdpiceabi +#target: *-*-linux* *-*-gnu* arm*-*-uclinuxfdpiceabi diff --git a/ld/testsuite/ld-elf/fatal-warnings-1b.d b/ld/testsuite/ld-elf/fatal-warnings-1b.d index 70862b2..34aaf10 100644 --- a/ld/testsuite/ld-elf/fatal-warnings-1b.d +++ b/ld/testsuite/ld-elf/fatal-warnings-1b.d @@ -3,4 +3,4 @@ #ld: --no-dynamic-linker -z dynamic-undefined-weak --fatal-warnings #readelf: -r -x .data.rel.ro #error: unsupported option: -z dynamic-undefined-weak -#target: *-*-linux* *-*-gnu* *-*-nacl* arm*-*-uclinuxfdpiceabi +#target: *-*-linux* *-*-gnu* arm*-*-uclinuxfdpiceabi diff --git a/ld/testsuite/ld-elf/gnu_execstack.err b/ld/testsuite/ld-elf/gnu_execstack.err new file mode 100644 index 0000000..be70b63 --- /dev/null +++ b/ld/testsuite/ld-elf/gnu_execstack.err @@ -0,0 +1,3 @@ +#... +.*: error: .*: is triggering the generation of an executable stack \(because it has an executable .note.GNU-stack section\) +#... diff --git a/ld/testsuite/ld-elf/indirect.exp b/ld/testsuite/ld-elf/indirect.exp index 9a0bcb2..3d9cc2a 100644 --- a/ld/testsuite/ld-elf/indirect.exp +++ b/ld/testsuite/ld-elf/indirect.exp @@ -189,14 +189,21 @@ set run_tests [list \ {check-ptr-eq.c} "pr18720d" "pr18720.out"] \ [list "Run with libpr19553b.so" \ "-Wl,--no-as-needed tmpdir/libpr19553b.so tmpdir/libpr19553d.so -Wl,-rpath-link,." "" \ - {pr19553a.c} "pr19553b" "pr19553b.out"] \ + {pr19553a.c} "pr19553b" "pr19553b.out"] +] + +# This test relies on versioned symbols, which Solaris ld.so.1 doesn't support. +if { ![istarget *-*-solaris2*] } { + lappend run_tests \ [list "Run with libpr19553c.so" \ "-Wl,--no-as-needed tmpdir/libpr19553c.so tmpdir/libpr19553b.so tmpdir/libpr19553d.so" "" \ - {pr19553a.c} "pr19553c" "pr19553c.out"] \ + {pr19553a.c} "pr19553c" "pr19553c.out"] +} + +lappend run_tests \ [list "Run with libpr19553d.so" \ "-Wl,--no-as-needed tmpdir/libpr19553d.so tmpdir/libpr19553b.so -Wl,-rpath-link,." "" \ - {pr19553a.c} "pr19553d" "pr19553d.out"] \ -] + {pr19553a.c} "pr19553d" "pr19553d.out"] run_ld_link_exec_tests $run_tests diff --git a/ld/testsuite/ld-elf/linkonce1.d b/ld/testsuite/ld-elf/linkonce1.d index e4f9a70..3920f25 100644 --- a/ld/testsuite/ld-elf/linkonce1.d +++ b/ld/testsuite/ld-elf/linkonce1.d @@ -2,11 +2,10 @@ #source: linkonce1b.s #ld: -r #objdump: -r +#notarget: [is_generic] .*: file format .* #... -RELOCATION RECORDS FOR \[.debug_frame\]: -OFFSET[ ]+TYPE[ ]+VALUE[ ]* -.*(NONE|unused|UNUSED).*\*ABS\* +RELOCATION RECORDS FOR \[.debug_frame\]: \(none\) #pass diff --git a/ld/testsuite/ld-elf/linkonce3.d b/ld/testsuite/ld-elf/linkonce3.d new file mode 100644 index 0000000..25306d2 --- /dev/null +++ b/ld/testsuite/ld-elf/linkonce3.d @@ -0,0 +1,13 @@ +#source: linkonce1a.s +#source: linkonce1b.s +#ld: -r +#objdump: -r +#target: [is_generic] + +.*: file format .* +#... +RELOCATION RECORDS FOR \[.debug_frame\]: +OFFSET[ ]+TYPE[ ]+VALUE[ ]* +.*(NONE|unused|UNUSED).*\*ABS\* + +#pass diff --git a/ld/testsuite/ld-elf/linux-x86.exp b/ld/testsuite/ld-elf/linux-x86.exp index 27173b9..a4dfc8a 100644 --- a/ld/testsuite/ld-elf/linux-x86.exp +++ b/ld/testsuite/ld-elf/linux-x86.exp @@ -84,9 +84,9 @@ run_cc_link_tests [list \ ] \ [list \ "Build indirect-extern-access-1a without PIE" \ - "$NOPIE_LDFLAGS -Wl,--no-as-needed -z noexecstack \ + "$NOPIE_LDFLAGS $DIRECT_EXTERN_ACCESS_CFLAGS -Wl,--no-as-needed -z noexecstack \ tmpdir/indirect-extern-access-1.so" \ - "$NOPIE_CFLAGS" \ + "$NOPIE_CFLAGS $DIRECT_EXTERN_ACCESS_CFLAGS" \ { indirect-extern-access.S indirect-extern-access-1b.c } \ {{readelf -rn indirect-extern-access-1.rd}} \ "indirect-extern-access-1a" \ @@ -101,9 +101,9 @@ run_cc_link_tests [list \ ] \ [list \ "Build indirect-extern-access-2a without PIE" \ - "$NOPIE_LDFLAGS -Wl,--no-as-needed -z noexecstack \ + "$NOPIE_LDFLAGS $DIRECT_EXTERN_ACCESS_CFLAGS -Wl,--no-as-needed -z noexecstack \ tmpdir/indirect-extern-access-2.so" \ - "$NOPIE_CFLAGS" \ + "$NOPIE_CFLAGS $DIRECT_EXTERN_ACCESS_CFLAGS" \ { indirect-extern-access.S indirect-extern-access-1b.c } \ {{readelf -rn indirect-extern-access-2.rd}} \ "indirect-extern-access-2a" \ @@ -375,11 +375,11 @@ proc check_pr25749a {testname srcfilea srcfileb cflags ldflags lderror} { check_pr25749a "pr25749-1a" "pr25749-1.c" "pr25749-1a.c" "$NOPIE_CFLAGS" "$NOPIE_LDFLAGS" "" check_pr25749a "pr25749-1a" "pr25749-1.c" "pr25749-1a.c" "-fPIE" "-pie" "" -check_pr25749a "pr25749-1b" "pr25749-1.c" "pr25749-1b.c" "$NOPIE_CFLAGS" "$NOPIE_LDFLAGS" "" +check_pr25749a "pr25749-1b" "pr25749-1.c" "pr25749-1b.c" "$NOPIE_CFLAGS $DIRECT_EXTERN_ACCESS_CFLAGS" "$NOPIE_LDFLAGS" "" if { [istarget "i?86-*-linux*"] || ![at_least_gcc_version 5 1] } { - check_pr25749a "pr25749-1b" "pr25749-1.c" "pr25749-1b.c" "-fPIE" "-pie" "" + check_pr25749a "pr25749-1b" "pr25749-1.c" "pr25749-1b.c" "-fPIE $DIRECT_EXTERN_ACCESS_CFLAGS" "-pie" "" } else { - check_pr25749a "pr25749-1b" "pr25749-1.c" "pr25749-1b.c" "-fPIE" "-pie" "pr25749-1b.err" + check_pr25749a "pr25749-1b" "pr25749-1.c" "pr25749-1b.c" "-fPIE $DIRECT_EXTERN_ACCESS_CFLAGS" "-pie" "pr25749-1b.err" } check_pr25749a "pr25749-1c" "pr25749-1.c" "pr25749-1c.c" "-fPIC" "-shared" "pr25749-1b.err" check_pr25749a "pr25749-2a" "pr25749-2.c" "pr25749-2a.s" "$NOPIE_CFLAGS" "$NOPIE_LDFLAGS" "" diff --git a/ld/testsuite/ld-elf/missing-execstack.err b/ld/testsuite/ld-elf/missing-execstack.err new file mode 100644 index 0000000..9549cf5 --- /dev/null +++ b/ld/testsuite/ld-elf/missing-execstack.err @@ -0,0 +1,3 @@ +#... +.*: error: .*\.o: is triggering the generation of an executable stack because it does not have a .note.GNU-stack section +#... diff --git a/ld/testsuite/ld-elf/no-section-header.exp b/ld/testsuite/ld-elf/no-section-header.exp index 2a4575b..7461fdd 100644 --- a/ld/testsuite/ld-elf/no-section-header.exp +++ b/ld/testsuite/ld-elf/no-section-header.exp @@ -21,7 +21,7 @@ # Written by H.J. Lu (hongjiu.lu@intel.com) # -if { ![is_elf_format] } { +if { ![istarget *-*-gnu*] } { return } diff --git a/ld/testsuite/ld-elf/orphan-region.d b/ld/testsuite/ld-elf/orphan-region.d index 3f5bfd7..ef21ec3 100644 --- a/ld/testsuite/ld-elf/orphan-region.d +++ b/ld/testsuite/ld-elf/orphan-region.d @@ -1,9 +1,9 @@ #source: orphan-region.s #ld: -T orphan-region.ld -N -z stack-size=0 --no-warn-rwx-segments #readelf: -S -l --wide -#xfail: [uses_genelf] hppa*64*-*-* spu-*-* *-*-nacl* +#xfail: [uses_genelf] hppa*64*-*-* spu-*-* # if not using elf.em, you don't get fancy orphan handling -# spu twiddles LOAD range, hppa64 adds PHDR, nacl splits to two segments +# spu twiddles LOAD range, hppa64 adds PHDR #... \[[ 0-9]+\] \.text[ \t]+PROGBITS[ \t]+0*40000000[ \t]+.* diff --git a/ld/testsuite/ld-elf/package-note.exp b/ld/testsuite/ld-elf/package-note.exp index 5ad3cf5..7249cb7 100644 --- a/ld/testsuite/ld-elf/package-note.exp +++ b/ld/testsuite/ld-elf/package-note.exp @@ -27,7 +27,6 @@ if ![is_elf_format] { if { !([istarget *-*-linux*] || [istarget arm*-*-uclinuxfdpiceabi] - || [istarget *-*-nacl*] || [istarget *-*-gnu*]) } then { return } diff --git a/ld/testsuite/ld-elf/pr16322.d b/ld/testsuite/ld-elf/pr16322.d index 1e9175c..914d631 100644 --- a/ld/testsuite/ld-elf/pr16322.d +++ b/ld/testsuite/ld-elf/pr16322.d @@ -1,6 +1,6 @@ #ld: -shared -z relro -z noseparate-code #readelf: -l --wide -#target: *-*-linux-gnu *-*-gnu* *-*-nacl* arm*-*-uclinuxfdpiceabi +#target: *-*-linux-gnu *-*-gnu* arm*-*-uclinuxfdpiceabi #xfail: ![check_shared_lib_support] #xfail: ![check_relro_support] diff --git a/ld/testsuite/ld-elf/pr16498a.d b/ld/testsuite/ld-elf/pr16498a.d index de68389..8690aaf 100644 --- a/ld/testsuite/ld-elf/pr16498a.d +++ b/ld/testsuite/ld-elf/pr16498a.d @@ -1,6 +1,6 @@ #ld: -shared -T pr16498a.t #readelf: -l --wide -#target: *-*-linux* *-*-gnu* *-*-nacl* arm*-*-uclinuxfdpiceabi +#target: *-*-linux* *-*-gnu* arm*-*-uclinuxfdpiceabi #xfail: ![check_shared_lib_support] #... diff --git a/ld/testsuite/ld-elf/pr16498b.d b/ld/testsuite/ld-elf/pr16498b.d index aceb307..433e281 100644 --- a/ld/testsuite/ld-elf/pr16498b.d +++ b/ld/testsuite/ld-elf/pr16498b.d @@ -1,7 +1,7 @@ #source: pr16498a.s #ld: -shared -T pr16498b.t #readelf: -l --wide -#target: *-*-linux* *-*-gnu* *-*-nacl* arm*-*-uclinuxfdpiceabi +#target: *-*-linux* *-*-gnu* arm*-*-uclinuxfdpiceabi #xfail: ![check_shared_lib_support] #... diff --git a/ld/testsuite/ld-elf/pr19162.d b/ld/testsuite/ld-elf/pr19162.d index 1e7c1a9..bb5af3b 100644 --- a/ld/testsuite/ld-elf/pr19162.d +++ b/ld/testsuite/ld-elf/pr19162.d @@ -2,7 +2,7 @@ #source: pr19162b.s #ld: -shared -z max-page-size=0x200000 -z noseparate-code #readelf: -l --wide -#target: *-*-linux* *-*-gnu* *-*-nacl* arm*-*-uclinuxfdpiceabi +#target: *-*-linux* *-*-gnu* arm*-*-uclinuxfdpiceabi #xfail: hppa*-*-* ![check_shared_lib_support] # hppa fails due to PR 12376. diff --git a/ld/testsuite/ld-elf/pr22269a.d b/ld/testsuite/ld-elf/pr22269a.d index 8644d0e..a4af8fe 100644 --- a/ld/testsuite/ld-elf/pr22269a.d +++ b/ld/testsuite/ld-elf/pr22269a.d @@ -2,7 +2,7 @@ #source: pr22269.s #ld: -pie --no-dynamic-linker #readelf: -r -x .data.rel.ro -#target: *-*-linux* *-*-gnu* *-*-nacl* arm*-*-uclinuxfdpiceabi +#target: *-*-linux* *-*-gnu* arm*-*-uclinuxfdpiceabi # The BFIN target always generates a relocation. #xfail: ![check_pie_support] || bfin-*-* diff --git a/ld/testsuite/ld-elf/pr22269b.d b/ld/testsuite/ld-elf/pr22269b.d index 1d8e7bd..f3cedc4 100644 --- a/ld/testsuite/ld-elf/pr22269b.d +++ b/ld/testsuite/ld-elf/pr22269b.d @@ -3,7 +3,7 @@ #ld: -pie --no-dynamic-linker -z dynamic-undefined-weak #readelf: -r -x .data.rel.ro #warning: -z dynamic-undefined-weak ignored -#target: *-*-linux* *-*-gnu* *-*-nacl* arm*-*-uclinuxfdpiceabi +#target: *-*-linux* *-*-gnu* arm*-*-uclinuxfdpiceabi # The BFIN target always generates a relocation. #xfail: ![check_pie_support] || bfin-*-* diff --git a/ld/testsuite/ld-elf/pr22393-1a.d b/ld/testsuite/ld-elf/pr22393-1a.d index 2bfa403..c832cc1 100644 --- a/ld/testsuite/ld-elf/pr22393-1a.d +++ b/ld/testsuite/ld-elf/pr22393-1a.d @@ -1,7 +1,7 @@ #source: pr22393-1.s #ld: -shared -z separate-code -z relro #readelf: -l --wide -#target: *-*-linux-gnu *-*-gnu* *-*-nacl* arm*-*-uclinuxfdpiceabi +#target: *-*-linux-gnu *-*-gnu* arm*-*-uclinuxfdpiceabi #xfail: ![check_shared_lib_support] #xfail: ![check_relro_support] diff --git a/ld/testsuite/ld-elf/pr22393-1b.d b/ld/testsuite/ld-elf/pr22393-1b.d index 96d8bc0..f624014 100644 --- a/ld/testsuite/ld-elf/pr22393-1b.d +++ b/ld/testsuite/ld-elf/pr22393-1b.d @@ -1,7 +1,7 @@ #source: pr22393-1.s #ld: -shared -z relro -z separate-code #readelf: -l --wide -#target: *-*-linux-gnu *-*-gnu* *-*-nacl* arm*-*-uclinuxfdpiceabi +#target: *-*-linux-gnu *-*-gnu* arm*-*-uclinuxfdpiceabi #xfail: ![check_shared_lib_support] #xfail: ![check_relro_support] diff --git a/ld/testsuite/ld-elf/pr22393-1c.d b/ld/testsuite/ld-elf/pr22393-1c.d index c34dab3..648200d 100644 --- a/ld/testsuite/ld-elf/pr22393-1c.d +++ b/ld/testsuite/ld-elf/pr22393-1c.d @@ -1,7 +1,7 @@ #source: pr22393-1.s #ld: -pie -z separate-code #readelf: -l --wide -#target: *-*-linux-gnu *-*-gnu* *-*-nacl* arm*-*-uclinuxfdpiceabi +#target: *-*-linux-gnu *-*-gnu* arm*-*-uclinuxfdpiceabi #xfail: ![check_pie_support] #failif diff --git a/ld/testsuite/ld-elf/pr22393-1d.d b/ld/testsuite/ld-elf/pr22393-1d.d index 4723e53..1191883 100644 --- a/ld/testsuite/ld-elf/pr22393-1d.d +++ b/ld/testsuite/ld-elf/pr22393-1d.d @@ -1,7 +1,7 @@ #source: pr22393-1.s #ld: -pie -z separate-code #readelf: -l --wide -#target: *-*-linux-gnu *-*-gnu* *-*-nacl* arm*-*-uclinuxfdpiceabi +#target: *-*-linux-gnu *-*-gnu* arm*-*-uclinuxfdpiceabi #xfail: ![check_pie_support] #failif diff --git a/ld/testsuite/ld-elf/pr22393-1e.d b/ld/testsuite/ld-elf/pr22393-1e.d index 55f7e9a..3f3516b 100644 --- a/ld/testsuite/ld-elf/pr22393-1e.d +++ b/ld/testsuite/ld-elf/pr22393-1e.d @@ -1,7 +1,7 @@ #source: pr22393-1.s #ld: -z separate-code #readelf: -l --wide -#target: *-*-linux-gnu *-*-gnu* *-*-nacl* arm*-*-uclinuxfdpiceabi +#target: *-*-linux-gnu *-*-gnu* arm*-*-uclinuxfdpiceabi #xfail: rx-*-linux* #failif diff --git a/ld/testsuite/ld-elf/pr22393-1f.d b/ld/testsuite/ld-elf/pr22393-1f.d index bc61b63..97be4f6 100644 --- a/ld/testsuite/ld-elf/pr22393-1f.d +++ b/ld/testsuite/ld-elf/pr22393-1f.d @@ -1,7 +1,7 @@ #source: pr22393-1.s #ld: -z separate-code #readelf: -l --wide -#target: *-*-linux-gnu *-*-gnu* *-*-nacl* arm*-*-uclinuxfdpiceabi +#target: *-*-linux-gnu *-*-gnu* arm*-*-uclinuxfdpiceabi #xfail: rx-*-linux* #failif diff --git a/ld/testsuite/ld-elf/pr22393-2a.rd b/ld/testsuite/ld-elf/pr22393-2a.rd index a9c5478..4027ed3 100644 --- a/ld/testsuite/ld-elf/pr22393-2a.rd +++ b/ld/testsuite/ld-elf/pr22393-2a.rd @@ -1,7 +1,7 @@ #source: pr22393-1.s #ld: -shared -z separate-code --no-rosegment #readelf: -l --wide -#target: *-*-linux-gnu *-*-gnu* *-*-nacl* +#target: *-*-linux-gnu *-*-gnu* #failif #... diff --git a/ld/testsuite/ld-elf/pr22393-2b.rd b/ld/testsuite/ld-elf/pr22393-2b.rd index a9c5478..4027ed3 100644 --- a/ld/testsuite/ld-elf/pr22393-2b.rd +++ b/ld/testsuite/ld-elf/pr22393-2b.rd @@ -1,7 +1,7 @@ #source: pr22393-1.s #ld: -shared -z separate-code --no-rosegment #readelf: -l --wide -#target: *-*-linux-gnu *-*-gnu* *-*-nacl* +#target: *-*-linux-gnu *-*-gnu* #failif #... diff --git a/ld/testsuite/ld-elf/pr23161c.rd b/ld/testsuite/ld-elf/pr23161c.rd index be99655..9b19b36 100644 --- a/ld/testsuite/ld-elf/pr23161c.rd +++ b/ld/testsuite/ld-elf/pr23161c.rd @@ -1,6 +1,3 @@ -There are no relocations in this file. - -Symbol table '\.dynsym' contains [0-9]+ entries: - +Num: +Value +Size Type +Bind +Vis +Ndx Name - +0: 0+ +0 +NOTYPE +LOCAL +DEFAULT +UND + - +1: +[a-f0-9]+ +[0-9]+ +FUNC +GLOBAL +DEFAULT +[0-9]+ +foo +#failif +#... +.* _?_(end|edata|_bss_start) diff --git a/ld/testsuite/ld-elf/pr23161d.rd b/ld/testsuite/ld-elf/pr23161d.rd deleted file mode 100644 index e7756b3..0000000 --- a/ld/testsuite/ld-elf/pr23161d.rd +++ /dev/null @@ -1,8 +0,0 @@ -Relocation section '\.rel(a|)\.plt' at offset 0x[0-9a-f]+ contains 1 entry: - +Offset +Info +Type +Sym.* Value +Sym.* Name( \+ Addend|) -[a-f0-9]+ +[0-9a-f]+ +R_.*_JUMP_SLOT +[a-f0-9]+ +foo( \+ [a-f0-9]+|) - -Symbol table '\.dynsym' contains [0-9]+ entries: - +Num: +Value +Size Type +Bind +Vis +Ndx Name - +0: 0+ +0 +NOTYPE +LOCAL +DEFAULT +UND + - +[0-9]+: +[a-f0-9]+ +0 +FUNC +GLOBAL +DEFAULT +UND +foo diff --git a/ld/testsuite/ld-elf/pr23900-1-32.rd b/ld/testsuite/ld-elf/pr23900-1-32.rd index 953095a..810f9a6 100644 --- a/ld/testsuite/ld-elf/pr23900-1-32.rd +++ b/ld/testsuite/ld-elf/pr23900-1-32.rd @@ -1,7 +1,7 @@ #source: pr23900-1.s #ld: #readelf: -l --wide -#target: *-*-linux* *-*-gnu* *-*-nacl* +#target: *-*-linux* *-*-gnu* #... GNU_PROPERTY .* +0x4 diff --git a/ld/testsuite/ld-elf/pr23900-1-64.rd b/ld/testsuite/ld-elf/pr23900-1-64.rd index 62cd63c..7904767 100644 --- a/ld/testsuite/ld-elf/pr23900-1-64.rd +++ b/ld/testsuite/ld-elf/pr23900-1-64.rd @@ -1,7 +1,7 @@ #source: pr23900-1.s #ld: #readelf: -l --wide -#target: *-*-linux* *-*-gnu* *-*-nacl* +#target: *-*-linux* *-*-gnu* #... GNU_PROPERTY .* +0x8 diff --git a/ld/testsuite/ld-elf/pr23900-1.d b/ld/testsuite/ld-elf/pr23900-1.d index da0fcbb..246cfac 100644 --- a/ld/testsuite/ld-elf/pr23900-1.d +++ b/ld/testsuite/ld-elf/pr23900-1.d @@ -1,6 +1,6 @@ #ld: #readelf: --notes --wide -l -#target: *-*-linux* *-*-gnu* *-*-nacl* +#target: *-*-linux* *-*-gnu* #... GNU_PROPERTY .* diff --git a/ld/testsuite/ld-elf/pr23900-2a.d b/ld/testsuite/ld-elf/pr23900-2a.d index 836606d..6806acd 100644 --- a/ld/testsuite/ld-elf/pr23900-2a.d +++ b/ld/testsuite/ld-elf/pr23900-2a.d @@ -1,7 +1,7 @@ #source: pr23900-2.s #ld: #readelf: --notes --wide -#target: *-*-linux* *-*-gnu* *-*-nacl* +#target: *-*-linux* *-*-gnu* #... Displaying notes found in: \.note diff --git a/ld/testsuite/ld-elf/pr23900-2b.d b/ld/testsuite/ld-elf/pr23900-2b.d index 2aa04d7..5b27fe5 100644 --- a/ld/testsuite/ld-elf/pr23900-2b.d +++ b/ld/testsuite/ld-elf/pr23900-2b.d @@ -1,7 +1,7 @@ #source: pr23900-2.s #ld: #readelf: -l --wide -#target: *-*-linux* *-*-gnu* *-*-nacl* +#target: *-*-linux* *-*-gnu* #failif #... diff --git a/ld/testsuite/ld-elf/pr30508.d b/ld/testsuite/ld-elf/pr30508.d index 1692780..d59b9e9 100644 --- a/ld/testsuite/ld-elf/pr30508.d +++ b/ld/testsuite/ld-elf/pr30508.d @@ -1,7 +1,7 @@ #ld: -z separate-code --no-rosegment #objcopy_linked_file: -R .foo #readelf: -lW -#target: *-*-linux-gnu *-*-gnu* *-*-nacl* arm*-*-uclinuxfdpiceabi +#target: *-*-linux-gnu *-*-gnu* arm*-*-uclinuxfdpiceabi #xfail: mips*-*-* rx-*-linux* #... diff --git a/ld/testsuite/ld-elf/pr30907-1.d b/ld/testsuite/ld-elf/pr30907-1.d index ee72bf8..d5d8125 100644 --- a/ld/testsuite/ld-elf/pr30907-1.d +++ b/ld/testsuite/ld-elf/pr30907-1.d @@ -2,7 +2,7 @@ #source: pr22393-1.s #ld: -shared -z separate-code -z relro --rosegment #readelf: -l --wide -#target: *-*-linux-gnu *-*-gnu* *-*-nacl* arm*-*-uclinuxfdpiceabi +#target: *-*-linux-gnu *-*-gnu* arm*-*-uclinuxfdpiceabi #xfail: ![check_shared_lib_support] #xfail: ![check_relro_support] diff --git a/ld/testsuite/ld-elf/pr30907-2.d b/ld/testsuite/ld-elf/pr30907-2.d index 7312da9..fed957e 100644 --- a/ld/testsuite/ld-elf/pr30907-2.d +++ b/ld/testsuite/ld-elf/pr30907-2.d @@ -2,7 +2,7 @@ #source: pr22393-1.s #ld: -shared -z separate-code -z relro --rosegment #readelf: -l --wide -#target: *-*-linux-gnu *-*-gnu* *-*-nacl* arm*-*-uclinuxfdpiceabi +#target: *-*-linux-gnu *-*-gnu* arm*-*-uclinuxfdpiceabi #xfail: ![check_shared_lib_support] #xfail: ![check_relro_support] diff --git a/ld/testsuite/ld-elf/pr32341.d b/ld/testsuite/ld-elf/pr32341.d index eb76c3a..45777d4 100644 --- a/ld/testsuite/ld-elf/pr32341.d +++ b/ld/testsuite/ld-elf/pr32341.d @@ -1,6 +1,6 @@ #ld: --build-id -z separate-code -z relro --rosegment #readelf: -l --wide -#target: *-*-linux-gnu *-*-gnu* *-*-nacl* arm*-*-uclinuxfdpiceabi +#target: *-*-linux-gnu *-*-gnu* arm*-*-uclinuxfdpiceabi #xfail: ![check_relro_support] #failif diff --git a/ld/testsuite/ld-elf/pr33291.d b/ld/testsuite/ld-elf/pr33291.d new file mode 100644 index 0000000..22a8336 --- /dev/null +++ b/ld/testsuite/ld-elf/pr33291.d @@ -0,0 +1,9 @@ +#source: pr33291a.s +#source: pr33291b.s +#ld: -shared +#readelf: -S --wide +#xfail: ![check_shared_lib_support] + +#... + \[[ 0-9]+\] \.rodata[ ]+PROGBITS[ ]+[0-9a-f]+ [0-9a-f]+ 0+9 00 +A +0 +0 +8 +#... diff --git a/ld/testsuite/ld-elf/pr33291a.s b/ld/testsuite/ld-elf/pr33291a.s new file mode 100644 index 0000000..587c0fb --- /dev/null +++ b/ld/testsuite/ld-elf/pr33291a.s @@ -0,0 +1,8 @@ + .globl foo + .section .rodata.cst8,"aM",%progbits,8 + .p2align 3 + .type foo, %object + .size foo, 8 +foo: + .quad 131073 + .section .note.GNU-stack,"",%progbits diff --git a/ld/testsuite/ld-elf/pr33291b.s b/ld/testsuite/ld-elf/pr33291b.s new file mode 100644 index 0000000..69f6b3d --- /dev/null +++ b/ld/testsuite/ld-elf/pr33291b.s @@ -0,0 +1,7 @@ + .globl bar + .section .rodata.cst1,"aM",%progbits,1 + .type bar, %object + .size bar, 1 +bar: + .byte 1 + .section .note.GNU-stack,"",%progbits diff --git a/ld/testsuite/ld-elf/pr33409a.c b/ld/testsuite/ld-elf/pr33409a.c new file mode 100644 index 0000000..c37a5e6 --- /dev/null +++ b/ld/testsuite/ld-elf/pr33409a.c @@ -0,0 +1,20 @@ +#include <stdio.h> + +extern char *array[]; + +char ** +foo (void) +{ + return array; +} + +extern void bar (void); + +int +main() +{ + char **p = foo (); + bar (); + printf ("%s\n", p[0]); + return 0; +} diff --git a/ld/testsuite/ld-elf/pr33409b.c b/ld/testsuite/ld-elf/pr33409b.c new file mode 100644 index 0000000..db64e13 --- /dev/null +++ b/ld/testsuite/ld-elf/pr33409b.c @@ -0,0 +1,9 @@ +#include <stdio.h> + +char *__array [] = +{ + "PASS", + NULL +}; + +extern __typeof (__array) array __attribute__ ((weak, alias ("__array"))); diff --git a/ld/testsuite/ld-elf/pr33409c.c b/ld/testsuite/ld-elf/pr33409c.c new file mode 100644 index 0000000..7de81b3 --- /dev/null +++ b/ld/testsuite/ld-elf/pr33409c.c @@ -0,0 +1,4 @@ +void +bar (void) +{ +} diff --git a/ld/testsuite/ld-elf/rwx-segments-3.err b/ld/testsuite/ld-elf/rwx-segments-3.err new file mode 100644 index 0000000..5a584db --- /dev/null +++ b/ld/testsuite/ld-elf/rwx-segments-3.err @@ -0,0 +1,3 @@ +#... +.* error: .* has a LOAD segment with RWX permissions +#...
\ No newline at end of file diff --git a/ld/testsuite/ld-elf/rwx-segments-4.err b/ld/testsuite/ld-elf/rwx-segments-4.err new file mode 100644 index 0000000..2603f57 --- /dev/null +++ b/ld/testsuite/ld-elf/rwx-segments-4.err @@ -0,0 +1,3 @@ +#... +.*: error: .* has a TLS segment with execute permission +#... diff --git a/ld/testsuite/ld-elf/shared.exp b/ld/testsuite/ld-elf/shared.exp index 09669b5..fad3812 100644 --- a/ld/testsuite/ld-elf/shared.exp +++ b/ld/testsuite/ld-elf/shared.exp @@ -516,7 +516,6 @@ run_ld_link_tests { if { [istarget *-*-linux*] || [istarget kvx-*-*] - || [istarget *-*-nacl*] || [istarget *-*-gnu*] } { run_ld_link_tests { {"Weak symbols in dynamic objects 1 (support)" @@ -973,7 +972,13 @@ append build_tests { {pr26580-b.c} {} "libpr26580-2.so"} } +set old_CFLAGS "$CFLAGS_FOR_TARGET_TEST" +set old_CXXFLAGS "$CXXFLAGS_FOR_TARGET_TEST" +append CFLAGS_FOR_TARGET_TEST " $NOSANITIZE_CFLAGS" +append CXXFLAGS_FOR_TARGET_TEST " $NOSANITIZE_CFLAGS" run_cc_link_tests $build_tests +set CFLAGS_FOR_TARGET_TEST "$old_CFLAGS" +set CXXFLAGS_FOR_TARGET_TEST "$old_CXXFLAGS" run_cc_link_tests [list \ [list \ @@ -1011,6 +1016,20 @@ run_cc_link_tests [list \ {nm {-u -D --with-symbol-versions} pr26302.nd}} \ "pr26302b.so" \ ] \ + [list \ + "Build pr33409a.o" \ + "" \ + "$DIRECT_EXTERN_ACCESS_CFLAGS" \ + {pr33409a.c} \ + ] \ + [list \ + "Build pr33409.so" \ + "-shared" \ + "-fPIC" \ + {pr33409b.c} \ + {} \ + "pr33409.so" \ + ] \ ] run_ld_link_tests [list \ @@ -1201,6 +1220,17 @@ set run_tests [list \ "tmpdir/pr31482b-no-lto.so tmpdir/pr31482c-no-lto.a \ tmpdir/pr31482d-no-lto.a" \ ] \ + [list "Run pr33409" \ + "-Wl,-z,text" \ + "" \ + {pr33409c.c} \ + "pr33409" \ + "pass.out" \ + "$NO_DIRECT_EXTERN_ACCESS_CFLAGS" \ + "c" \ + "" \ + "tmpdir/pr33409a.o tmpdir/pr33409.so" \ + ] \ ] # NetBSD ELF systems do not currently support the .*_array sections. @@ -1260,10 +1290,10 @@ if [check_libdl_available] { # XFAIL on NetBSD ELF systems as they do not currently support the .*_array # sections. # Disable all sanitizers. - set old_CFLAGS "$CFLAGS_FOR_TARGET" - append CFLAGS_FOR_TARGET " $NOSANITIZE_CFLAGS" + set old_CFLAGS "$CFLAGS_FOR_TARGET_TEST" + append CFLAGS_FOR_TARGET_TEST " $NOSANITIZE_CFLAGS" run_ld_link_exec_tests $dlopen_run_tests "*-*-netbsd*" - set CFLAGS_FOR_TARGET "$old_CFLAGS" + set CFLAGS_FOR_TARGET_TEST "$old_CFLAGS" } # Check --no-add-needed and --no-copy-dt-needed-entries @@ -1374,7 +1404,6 @@ run_cc_link_tests $build_cxx_tests run_ld_link_exec_tests $run_cxx_tests if { [istarget *-*-linux*] - || [istarget *-*-nacl*] || [istarget *-*-gnu*] } { run_cc_link_tests [list \ [list \ @@ -1707,7 +1736,6 @@ if [istarget "sparc*-*-*"] { } if { ([istarget "*-*-linux*"] - || [istarget "*-*-nacl*"] || [istarget "*-*-gnu*"]) && ![istarget "mips*-*-*"] } { run_ld_link_tests [list \ @@ -1767,7 +1795,7 @@ if { ([istarget "*-*-linux*"] "" \ $AFLAGS_PIE \ { pr23161b.c } \ - {{readelf {--dyn-syms -rW} pr23161b.rd}} \ + {{readelf {--dyn-syms -W} pr23161b.rd}} \ "pr23161a" \ "-fPIC -O0 $NOSANITIZE_CFLAGS" \ ] \ @@ -1787,23 +1815,17 @@ if { ([istarget "*-*-linux*"] "" \ $AFLAGS_PIE \ { pr23161b.c } \ - {{readelf {--dyn-syms -rW} pr23161b.rd}} \ + {{readelf {--dyn-syms -W} pr23161b.rd}} \ "pr23161b" \ "-fPIC -O0 $NOSANITIZE_CFLAGS" \ ] \ - ] -} - -if { [istarget "i?86-*-*"] - || [istarget "x86_64-*-*"] } { - run_ld_link_tests [list \ [list \ "Build libpr23161c.so" \ "-shared" \ "" \ "$AFLAGS_PIC" \ { pr23161c.c } \ - {{readelf {--dyn-syms -rW} pr23161c.rd}} \ + {{readelf {--dyn-syms -W} pr23161c.rd}} \ "libpr23161c.so" \ "-fPIC -O2 $NOSANITIZE_CFLAGS" \ ] \ @@ -1813,7 +1835,7 @@ if { [istarget "i?86-*-*"] "" \ $AFLAGS_PIE \ { pr23161b.c } \ - {{readelf {--dyn-syms -rW} pr23161d.rd}} \ + {{readelf {--dyn-syms -W} pr23161c.rd}} \ "pr23161c" \ "-fPIC -O0 $NOSANITIZE_CFLAGS" \ ] \ diff --git a/ld/testsuite/ld-elf/tbss4.d b/ld/testsuite/ld-elf/tbss4.d new file mode 100644 index 0000000..336ed8f --- /dev/null +++ b/ld/testsuite/ld-elf/tbss4.d @@ -0,0 +1,13 @@ +#ld: -e _start -Ttext=0x1000 -z max-page-size=0x1000 -z common-page-size=0x1000 -z noseparate-code +#readelf: -lSW +#target: *-linux* *-gnu* +#notarget: hppa64-*-* ia64-*-* + +#... +.* \.tbss +NOBITS +0+1014 +0+1014 +0+4 +0+ +WAT +0 +0 +4 + +#... + +TLS +0x0*1014 +0x0+1014 +0x0+1014 +0x0+ +0x0+4 R +0x4 +#... +.* \.tbss +#pass diff --git a/ld/testsuite/ld-elf/tbss4.s b/ld/testsuite/ld-elf/tbss4.s new file mode 100644 index 0000000..f49491e --- /dev/null +++ b/ld/testsuite/ld-elf/tbss4.s @@ -0,0 +1,25 @@ +# Writeable gcc_except_table is required in order to put this section after +# the DATA_SEGMENT_ALIGN directive in the default linker script (and hence +# in the same PT_LOAD as the PT_TLS segment, and hence so that the +# gcc_except_table can affect the .tbss section location). + .section .gcc_except_table,"aw",%progbits +# Alignment is needed -- otherwise gcc_except_table start position seems to +# be adjusted so that the tbss section is fully aligned. + .balign 4 + .ascii "Odd number of chars" + + .section .tbss,"awT",%nobits + .balign 4 + .type xyz, %object + .size xyz, 4 +xyz: + .zero 4 + + .data +dataval: + .balign 4 + .ascii "x" + + .text + .global _start +_start: diff --git a/ld/testsuite/ld-elf/tls.exp b/ld/testsuite/ld-elf/tls.exp index e53762d..1768399 100644 --- a/ld/testsuite/ld-elf/tls.exp +++ b/ld/testsuite/ld-elf/tls.exp @@ -23,7 +23,6 @@ if { !([istarget *-*-linux*] || [istarget arm*-*-uclinuxfdpiceabi] - || [istarget *-*-nacl*] || [istarget *-*-gnu*]) || [istarget *ecoff] } then { return } diff --git a/ld/testsuite/ld-elf/tls_common.exp b/ld/testsuite/ld-elf/tls_common.exp index 31f36ef..deb22c6 100644 --- a/ld/testsuite/ld-elf/tls_common.exp +++ b/ld/testsuite/ld-elf/tls_common.exp @@ -25,7 +25,6 @@ if { !([istarget *-*-linux*] || [istarget arm*-*-uclinuxfdpiceabi] - || [istarget *-*-nacl*] || [istarget *-*-gnu*]) || [istarget *ecoff] } then { return } diff --git a/ld/testsuite/ld-elf/z_execstack.err b/ld/testsuite/ld-elf/z_execstack.err new file mode 100644 index 0000000..703b42a --- /dev/null +++ b/ld/testsuite/ld-elf/z_execstack.err @@ -0,0 +1,4 @@ +#... +.*: error: creating an executable stack because of -z execstack command line option +#... + diff --git a/ld/testsuite/ld-elfvers/vers.exp b/ld/testsuite/ld-elfvers/vers.exp index d5cfc75..80faaa0 100644 --- a/ld/testsuite/ld-elfvers/vers.exp +++ b/ld/testsuite/ld-elfvers/vers.exp @@ -35,7 +35,8 @@ if { ![check_shared_lib_support] } { # This test can only be run on a couple of ELF platforms. # Square bracket expressions seem to confuse istarget. # This is similar to the test that is used in ld-shared, BTW. -if { ![istarget hppa*64*-*-hpux*] +if { ![istarget *-*-solaris2*] + && ![istarget hppa*64*-*-hpux*] && ![istarget hppa*-*-linux*] && ![istarget i?86-*-elf*] && ![istarget i?86-*-linux*] @@ -48,7 +49,6 @@ if { ![istarget hppa*64*-*-hpux*] && ![istarget powerpc*-*-linux*] && ![istarget powerpc*-*-sysv4*] && ![istarget sparc*-*-elf] - && ![istarget sparc*-*-solaris2*] && ![istarget sparc*-*-linux*] && ![istarget aarch64*-*-linux*] && ![istarget arm*-*-linux*] @@ -60,6 +60,13 @@ if { ![istarget hppa*64*-*-hpux*] return } +set need_direct_extern_access "" +if { [istarget i?86-*-linux*] + || [istarget i?86-*-gnu*] } then { + # These targets need direct extern access in some tests. + set need_direct_extern_access "$DIRECT_EXTERN_ACCESS_CFLAGS" +} + set diff diff set tmpdir tmpdir set VOBJDUMP_FLAGS --private-headers @@ -558,7 +565,8 @@ proc build_vers_lib_no_pic { test source libname other mapfile verexp versymexp global shared # Make sure that PLT is used since PLT is expected. global PLT_CFLAGS - build_binary "$shared -z notext" $PLT_CFLAGS $test $source $libname $other $mapfile $verexp $versymexp $symexp "" + global need_direct_extern_access + build_binary "$shared -z notext" "$PLT_CFLAGS $need_direct_extern_access" $test $source $libname $other $mapfile $verexp $versymexp $symexp "" } proc build_vers_lib_pic { test source libname other mapfile verexp versymexp symexp } { @@ -961,7 +969,10 @@ if [string match "yes" $pic] then { build_vers_lib_pic "vers26a" vers26a.c vers26a "" vers26a.map vers26a.ver vers26a.dsym "" build_vers_lib_pic "vers26b1" vers26b.c vers26b1 "" "" vers26b.ver vers26b.dsym "" build_vers_lib_pic "vers26b2" vers26b.c vers26b2 "vers26a.so vers26b1.so vers26a.o" "" vers26b.ver vers26b.dsym "" -if [string match "yes" $pic] then { +if { [istarget x86_64-*-linux*] || [istarget x86_64-*-solaris2*] } then { + # gcc -fPIC generates code that ld rejects. + unsupported "vers26b3" +} elseif [string match "yes" $pic] then { xfail "vers26b3" } else { build_vers_lib_no_pic "vers26b3" vers26b.c vers26b3 "vers26a.so vers26b1.so vers26a.o" "" vers26b.ver vers26b.dsym "" diff --git a/ld/testsuite/ld-elfvers/vers7.c b/ld/testsuite/ld-elfvers/vers7.c index 54316c9..a4fb254 100644 --- a/ld/testsuite/ld-elfvers/vers7.c +++ b/ld/testsuite/ld-elfvers/vers7.c @@ -2,8 +2,8 @@ * Test program that goes with test7.so */ -extern int hide_a(); -extern int show_b(); +extern int hide_a(int e); +extern int show_b(int e); int main() diff --git a/ld/testsuite/ld-elfweak/elfweak.exp b/ld/testsuite/ld-elfweak/elfweak.exp index 6e18d93..4e5ac42 100644 --- a/ld/testsuite/ld-elfweak/elfweak.exp +++ b/ld/testsuite/ld-elfweak/elfweak.exp @@ -35,7 +35,8 @@ if { ![check_shared_lib_support] } { # This test can only be run on a couple of ELF platforms. # Square bracket expressions seem to confuse istarget. # This is similar to the test that is used in ld-shared, BTW. -if { ![istarget alpha*-*-linux*] +if { ![istarget *-*-solaris2*] + && ![istarget alpha*-*-linux*] && ![istarget arm*-*-linux*] && ![istarget hppa*64*-*-hpux*] && ![istarget hppa*-*-linux*] @@ -52,10 +53,8 @@ if { ![istarget alpha*-*-linux*] && ![istarget powerpc*-*-sysv4*] && ![istarget sh\[34\]*-*-linux*] && ![istarget sparc*-*-elf] - && ![istarget sparc*-*-solaris2*] && ![istarget sparc*-*-linux*] - && ![istarget x86_64-*-linux*] - && ![istarget *-*-nacl*] } { + && ![istarget x86_64-*-linux*] } { return } diff --git a/ld/testsuite/ld-gc/gc.exp b/ld/testsuite/ld-gc/gc.exp index a1c7bd6..556c947 100644 --- a/ld/testsuite/ld-gc/gc.exp +++ b/ld/testsuite/ld-gc/gc.exp @@ -142,7 +142,6 @@ if { [is_elf_format] && [check_shared_lib_support] } then { if { [check_compiler_available] } { if { [istarget "*-*-linux*"] - || [istarget "*-*-nacl*"] || [istarget "*-*-gnu*"] } { ld_compile "$CC_FOR_TARGET -fPIC $cflags" $srcdir/$subdir/pr11218-1.c tmpdir/pr11218-1.o ld_link $ld tmpdir/pr11218-1.so "-shared tmpdir/pr11218-1.o" diff --git a/ld/testsuite/ld-i386/binutils.exp b/ld/testsuite/ld-i386/binutils.exp new file mode 100644 index 0000000..1138448 --- /dev/null +++ b/ld/testsuite/ld-i386/binutils.exp @@ -0,0 +1,49 @@ +# Expect script for ELF/i386 binutils tests on linker outputs. +# Copyright (C) 2025 Free Software Foundation, Inc. +# +# This file is part of the GNU Binutils. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, +# MA 02110-1301, USA. +# + +if ![is_elf_format] { + return +} + +if { ![istarget "i?86-*-*"] && ![istarget "x86_64-*-*"] } { + return +} + +# Tests here need -melf_i386 support. +set status [catch "exec $LD -V -melf_i386" got] +if { $status == 0 } { + run_ld_link_tests [list \ + [list \ + "Build libgot-1-i386.so" \ + "-shared -melf_i386 --no-ld-generated-unwind-info \ + -z noseparate-code -z max-page-size=0x200000 \ + --rosegment --hash-style=sysv $NO_DT_RELR_LDFLAGS" \ + "" \ + "--32 -mx86-used-note=no --generate-missing-build-notes=no" \ + {got-1.s} \ + {{readelf -rW libgot-1a.rd} \ + {readelf -aW libgot-1b.rd} \ + {readelf --got-contents libgot-1c.rd} \ + {readelf {--got-contents -W} libgot-1d.rd}} \ + "libgot-1-i386.so" \ + ] \ + ] +} diff --git a/ld/testsuite/ld-i386/dt-relr-1c.d b/ld/testsuite/ld-i386/dt-relr-1c.d new file mode 100644 index 0000000..b64860f --- /dev/null +++ b/ld/testsuite/ld-i386/dt-relr-1c.d @@ -0,0 +1,26 @@ +#source: dt-relr-1.s +#as: --32 +#ld: -shared -melf_i386 $DT_RELR_LDFLAGS --hash-style=sysv +#readelf: -D -r -s --wide +#target: x86_64-*-linux* i?86-*-linux-gnu i?86-*-gnu* + +'REL' relocation section at offset [0x0-9a-f]+ contains 16 bytes: + +Offset +Info +Type +Sym. Value +Symbol's Name +[0-9a-f]+ +[0-9a-f]+ +R_386_32 +0+ +data1 +[0-9a-f]+ +[0-9a-f]+ +R_386_32 +0+ +data1 + +'RELR' relocation section at offset 0x[a-f0-9]+ contains 8 bytes: +#... +0000: +[0-9a-f]+ [0-9a-f]+ +.* +0001: +[0-9a-f]+ [0-9a-f]+ +.* + +[0-9a-f]+ +.* +#... +'PLT' relocation section at offset 0x[0-9a-f]+ contains 8 bytes: + +Offset +Info +Type +Sym. Value +Symbol's Name +[0-9a-f]+ +[0-9a-f]+ +R_386_JUMP_SLOT +0+ +func1 + +Symbol table for image contains [0-9]+ entries: + Num: Value Size Type Bind Vis Ndx Name +#... + +[0-9]+: 0+ +0 +NOTYPE +GLOBAL +DEFAULT +UND +func1 +#pass diff --git a/ld/testsuite/ld-i386/dt-relr-1d.d b/ld/testsuite/ld-i386/dt-relr-1d.d new file mode 100644 index 0000000..37df7c5 --- /dev/null +++ b/ld/testsuite/ld-i386/dt-relr-1d.d @@ -0,0 +1,26 @@ +#source: dt-relr-1.s +#as: --32 +#ld: -shared -melf_i386 $DT_RELR_LDFLAGS -z nocombreloc --hash-style=sysv +#readelf: -D -r -s --wide +#target: x86_64-*-linux* i?86-*-linux-gnu i?86-*-gnu* + +'REL' relocation section at offset [0x0-9a-f]+ contains 16 bytes: + +Offset +Info +Type +Sym. Value +Symbol's Name +[0-9a-f]+ +[0-9a-f]+ +R_386_32 +0+ +data1 +[0-9a-f]+ +[0-9a-f]+ +R_386_32 +0+ +data1 + +'RELR' relocation section at offset 0x[a-f0-9]+ contains 8 bytes: +#... +0000: +[0-9a-f]+ [0-9a-f]+ +.* +0001: +[0-9a-f]+ [0-9a-f]+ +.* + +[0-9a-f]+ +.* +#... +'PLT' relocation section at offset 0x[0-9a-f]+ contains 8 bytes: + +Offset +Info +Type +Sym. Value +Symbol's Name +[0-9a-f]+ +[0-9a-f]+ +R_386_JUMP_SLOT +0+ +func1 + +Symbol table for image contains [0-9]+ entries: + Num: Value Size Type Bind Vis Ndx Name +#... + +[0-9]+: 0+ +0 +NOTYPE +GLOBAL +DEFAULT +UND +func1 +#pass diff --git a/ld/testsuite/ld-i386/dt-relr-2.d b/ld/testsuite/ld-i386/dt-relr-2.d new file mode 100644 index 0000000..7b07d6c --- /dev/null +++ b/ld/testsuite/ld-i386/dt-relr-2.d @@ -0,0 +1,21 @@ +#source: dt-relr-2.s +#as: --32 +#ld: -shared -melf_i386 $DT_RELR_LDFLAGS --hash-style=sysv +#readelf: -D -r --wide +#target: x86_64-*-linux* i?86-*-linux-gnu i?86-*-gnu* + +'REL' relocation section at offset [0x0-9a-f]+ contains 16 bytes: + +Offset +Info +Type +Sym. Value +Symbol's Name +[0-9a-f]+ +[0-9a-f]+ +R_386_32 +0+ +data1 +[0-9a-f]+ +[0-9a-f]+ +R_386_32 +0+ +data1 + +'RELR' relocation section at offset 0x[a-f0-9]+ contains 8 bytes: +#... +0000: +[0-9a-f]+ [0-9a-f]+ +.* +0001: +[0-9a-f]+ [0-9a-f]+ +.* + +[0-9a-f]+ +.* +#... +'PLT' relocation section at offset 0x[0-9a-f]+ contains 16 bytes: + +Offset +Info +Type +Sym. Value +Symbol's Name +[0-9a-f]+ +[0-9a-f]+ +R_386_JUMP_SLOT +[0-9a-f]+ +func1 +[0-9a-f]+ +[0-9a-f]+ +R_386_JUMP_SLOT +[0-9a-f]+ +func2 diff --git a/ld/testsuite/ld-i386/dt-relr-2.s b/ld/testsuite/ld-i386/dt-relr-2.s new file mode 100644 index 0000000..4c2eb1f --- /dev/null +++ b/ld/testsuite/ld-i386/dt-relr-2.s @@ -0,0 +1,23 @@ + .text + .globl func1 +func1: + ret +foo: + call func1@PLT + call func2@PLT + pushl __ehdr_start@GOT(%ebx) + .globl func2 +func2: + ret + .globl func3 +func3: + ret + .section .bar,"aw",@progbits + .p2align 2 + .dc.a data1 + .dc.a __ehdr_start + + .section .foo,"aw",@progbits + .p2align 2 + .dc.a data1 + .dc.a __ehdr_start diff --git a/ld/testsuite/ld-i386/export-class.exp b/ld/testsuite/ld-i386/export-class.exp index a06a091..919925e 100644 --- a/ld/testsuite/ld-i386/export-class.exp +++ b/ld/testsuite/ld-i386/export-class.exp @@ -31,8 +31,9 @@ if { ![is_elf_format] } { # Exclude some more targets; feel free to include your favorite one # if you like. -if { !([istarget i?86-*-linux*] - || [istarget i?86-*-gnu*]) } { +if { !([istarget "i?86-*-linux*"] + || [istarget "i?86-*-gnu*"] + || [istarget "x86_64-*-linux*"]) } { return } @@ -43,8 +44,9 @@ set testname "i386 symbol export class test" run_ld_link_tests [list \ [list \ "$testname (auxiliary shared object)" \ - "-shared -version-script ../ld-elf/export-class-lib.ver" "" \ + "-melf_i386 -shared -version-script ../ld-elf/export-class-lib.ver" \ "" \ + "--32" \ { ../ld-elf/export-class-lib.s } \ {} \ "i386-export-class-lib.so" \ @@ -57,8 +59,8 @@ run_ld_link_tests [list \ run_ld_link_tests [list \ [list \ "$testname (initial static object)" \ - "-r" "" \ - "" \ + "-r -melf_i386" "" \ + "--32" \ { ../ld-elf/export-class-ref.s } \ {} \ "i386-export-class-ref-r.o" \ @@ -74,8 +76,9 @@ run_ld_link_tests [list \ run_ld_link_tests [list \ [list \ "$testname (final shared object)" \ - "-shared $NO_DT_RELR_LDFLAGS -Tdata=0x12340000 tmpdir/i386-export-class-ref-r.o tmpdir/i386-export-class-lib.so" "" \ + "-shared -melf_i386 $NO_DT_RELR_LDFLAGS -Tdata=0x12340000 tmpdir/i386-export-class-ref-r.o tmpdir/i386-export-class-lib.so" \ "" \ + "--32" \ { ../ld-elf/export-class-dep.s ../ld-elf/export-class-def.s } \ { \ { readelf -r i386-export-class.rd } \ diff --git a/ld/testsuite/ld-i386/gnu-tls-1.s b/ld/testsuite/ld-i386/gnu-tls-1.s new file mode 100644 index 0000000..02ae207 --- /dev/null +++ b/ld/testsuite/ld-i386/gnu-tls-1.s @@ -0,0 +1,9 @@ + .text + .p2align 4 + .globl func + .type func, @function +func: + leal foo@tlsgd(,%ebx,1), %eax + call ___tls_get_addr@PLT + ret + .section .note.GNU-stack,"",@progbits diff --git a/ld/testsuite/ld-i386/gnu-tls-1a.rd b/ld/testsuite/ld-i386/gnu-tls-1a.rd new file mode 100644 index 0000000..65d889d --- /dev/null +++ b/ld/testsuite/ld-i386/gnu-tls-1a.rd @@ -0,0 +1,7 @@ +#... +Version needs section '.gnu.version_r' contains [0-9]+ entries: + Addr: 0x[0-9a-f]+ +Offset: 0x[0-9a-f]+ +Link: +[0-9]+ +\(.dynstr\) + +0+: Version: 1 +File: libc\.so\.6(|\.1) +Cnt: +[0-9]+ +#... + 0x[a-f0-9]+: Name: GLIBC_ABI_GNU_TLS Flags: none Version: [0-9]+ +#pass diff --git a/ld/testsuite/ld-i386/gnu-tls-1b.rd b/ld/testsuite/ld-i386/gnu-tls-1b.rd new file mode 100644 index 0000000..02006e4 --- /dev/null +++ b/ld/testsuite/ld-i386/gnu-tls-1b.rd @@ -0,0 +1,4 @@ +#failif +#... + 0x[a-f0-9]+: Name: GLIBC_ABI_GNU_TLS Flags: none Version: [0-9]+ +#... diff --git a/ld/testsuite/ld-i386/gnu2-tls-1.s b/ld/testsuite/ld-i386/gnu2-tls-1.s new file mode 100644 index 0000000..e3841c7 --- /dev/null +++ b/ld/testsuite/ld-i386/gnu2-tls-1.s @@ -0,0 +1,11 @@ + .section .text.startup,"ax",@progbits + .p2align 4 + .globl main + .type main, @function +main: + leal ld@TLSDESC(%ebx), %eax + call *ld@TLSCALL(%eax) + addl %gs:0, %eax + ret + .size main, .-main + .section .note.GNU-stack,"",@progbits diff --git a/ld/testsuite/ld-i386/gnu2-tls-1a.rd b/ld/testsuite/ld-i386/gnu2-tls-1a.rd new file mode 100644 index 0000000..3eb926a --- /dev/null +++ b/ld/testsuite/ld-i386/gnu2-tls-1a.rd @@ -0,0 +1,7 @@ +#... +Version needs section '.gnu.version_r' contains 1 entry: + Addr: 0x[0-9a-f]+ +Offset: 0x[0-9a-f]+ +Link: +[0-9]+ +\(.dynstr\) + +0+: Version: 1 +File: libc\.so\.6(|\.1) +Cnt: +[0-9]+ +#... + 0x[a-f0-9]+: Name: GLIBC_ABI_GNU2_TLS Flags: none Version: [0-9]+ +#pass diff --git a/ld/testsuite/ld-i386/gnu2-tls-1b.rd b/ld/testsuite/ld-i386/gnu2-tls-1b.rd new file mode 100644 index 0000000..33ef8ac --- /dev/null +++ b/ld/testsuite/ld-i386/gnu2-tls-1b.rd @@ -0,0 +1,4 @@ +#failif +#... + 0x[a-f0-9]+: Name: GLIBC_ABI_GNU2_TLS Flags: none Version: [0-9]+ +#... diff --git a/ld/testsuite/ld-i386/got-1.s b/ld/testsuite/ld-i386/got-1.s new file mode 100644 index 0000000..30e45f9 --- /dev/null +++ b/ld/testsuite/ld-i386/got-1.s @@ -0,0 +1,7 @@ + .text + .globl func + .type func, @function +func: + call *foo@GOT(%ebx) + jmp bar@PLT + .section .note.GNU-stack,"",@progbits diff --git a/ld/testsuite/ld-i386/i386-export-class.rd b/ld/testsuite/ld-i386/i386-export-class.rd index d7beade..7ec0825 100644 --- a/ld/testsuite/ld-i386/i386-export-class.rd +++ b/ld/testsuite/ld-i386/i386-export-class.rd @@ -1,11 +1,11 @@ Relocation section '\.rel\.dyn' at offset 0x[0-9a-f]+ contains [0-9]+ entries: * Offset * Info * Type * Sym\. *Value * Sym\. * Name +12340000 00000008 R_386_RELATIVE * 12340010 00000008 R_386_RELATIVE * 12340020 00000008 R_386_RELATIVE * +12340040 00000008 R_386_RELATIVE * +12340050 00000008 R_386_RELATIVE * 12340060 00000008 R_386_RELATIVE * 12340070 00000008 R_386_RELATIVE * 12340080 00000008 R_386_RELATIVE * 12340090 00000008 R_386_RELATIVE * -12340000 [0-9a-f]+01 R_386_32 123400a0 protected_baz -12340040 [0-9a-f]+01 R_386_32 123400a0 protected_foo -12340050 [0-9a-f]+01 R_386_32 123400a0 protected_bar diff --git a/ld/testsuite/ld-i386/i386-export-class.xd b/ld/testsuite/ld-i386/i386-export-class.xd index a797f20..31f011f 100644 --- a/ld/testsuite/ld-i386/i386-export-class.xd +++ b/ld/testsuite/ld-i386/i386-export-class.xd @@ -1,10 +1,10 @@ Hex dump of section '\.data': - 0x12340000 00000000 00000000 00000000 00000000 .* + 0x12340000 a0003412 00000000 00000000 00000000 .* 0x12340010 a0003412 00000000 00000000 00000000 .* 0x12340020 a0003412 00000000 00000000 00000000 .* 0x12340030 00000000 00000000 00000000 00000000 .* - 0x12340040 00000000 00000000 00000000 00000000 .* - 0x12340050 00000000 00000000 00000000 00000000 .* + 0x12340040 a0003412 00000000 00000000 00000000 .* + 0x12340050 a0003412 00000000 00000000 00000000 .* 0x12340060 a0003412 00000000 00000000 00000000 .* 0x12340070 a0003412 00000000 00000000 00000000 .* 0x12340080 a0003412 00000000 00000000 00000000 .* diff --git a/ld/testsuite/ld-i386/i386.exp b/ld/testsuite/ld-i386/i386.exp index 6366457..bba0eed 100644 --- a/ld/testsuite/ld-i386/i386.exp +++ b/ld/testsuite/ld-i386/i386.exp @@ -515,11 +515,17 @@ run_dump_test "pr27491-3" run_dump_test "pr27491-4" run_dump_test "dt-relr-1a" run_dump_test "dt-relr-1b" +run_dump_test "dt-relr-1c" +run_dump_test "dt-relr-1d" +run_dump_test "dt-relr-2" run_dump_test "pr28870" run_dump_test "pr28894" run_dump_test "pr30787" run_dump_test "pr31047" run_dump_test "pr32191" +run_dump_test "pr33260" +run_dump_test "pr33260-2" +run_dump_test "pr28387" if { !([istarget "i?86-*-linux*"] || [istarget "i?86-*-gnu*"] @@ -710,7 +716,7 @@ if { [isnative] [list \ "Build pr17689.so" \ "-shared" \ - "-fPIC -Wa,-mrelax-relocations=yes" \ + "-fPIC $DIRECT_EXTERN_ACCESS_CFLAGS -Wa,-mrelax-relocations=yes" \ { pr17689a.c } \ {} \ "pr17689.so" \ @@ -734,7 +740,7 @@ if { [isnative] [list \ "Build pr17689.a" \ "" \ - "-Wa,-mrelax-relocations=yes" \ + "$DIRECT_EXTERN_ACCESS_CFLAGS -Wa,-mrelax-relocations=yes" \ { pr17689b.S } \ {} \ "pr17689.a" \ @@ -742,7 +748,7 @@ if { [isnative] [list \ "Build pr17689 with PIE and GOTOFF" \ "tmpdir/pr17689b.o tmpdir/pr17689.so -pie" \ - "-Wa,-mrelax-relocations=yes" \ + "$DIRECT_EXTERN_ACCESS_CFLAGS -Wa,-mrelax-relocations=yes" \ { dummy.c } \ {{readelf {-Wr} pr17689.rd}} \ "pr17689" \ @@ -750,7 +756,7 @@ if { [isnative] [list \ "Build pr17689 with PIE, -z now and GOTOFF" \ "tmpdir/pr17689b.o tmpdir/pr17689.so -pie -Wl,-z,now" \ - "-Wa,-mrelax-relocations=yes" \ + "$DIRECT_EXTERN_ACCESS_CFLAGS -Wa,-mrelax-relocations=yes" \ { dummy.c } \ {{readelf {-Wr} pr17689now.rd}} \ "pr17689now" \ @@ -758,7 +764,7 @@ if { [isnative] [list \ "Build pr17689ver with PIE and GOTOFF" \ "tmpdir/pr17689b.o tmpdir/pr17689ver.so -pie" \ - "-Wa,-mrelax-relocations=yes" \ + "$DIRECT_EXTERN_ACCESS_CFLAGS -Wa,-mrelax-relocations=yes" \ { dummy.c } \ {{readelf {-Wr} pr17689ver.rd}} \ "pr17689ver" \ @@ -766,7 +772,7 @@ if { [isnative] [list \ "Build pr17827 with PIE and GOTOFF" \ "tmpdir/pr17689b.o tmpdir/pr17689.so -pie" \ - "-Wa,-mrelax-relocations=yes" \ + "$DIRECT_EXTERN_ACCESS_CFLAGS -Wa,-mrelax-relocations=yes" \ { dummy.c } \ {{readelf {-Wr} pr17827.rd}} \ "pr17827" \ @@ -872,7 +878,7 @@ if { [isnative] [list \ "Build property 1 (.o)" \ "-r -nostdlib" \ - "-Wa,-mx86-used-note=yes" \ + "$DIRECT_EXTERN_ACCESS_CFLAGS -Wa,-mx86-used-note=yes" \ {pass.c property-no-copy.S} \ {{readelf {-n} property-1a.r}} \ "property-1.o" \ @@ -896,7 +902,7 @@ if { [isnative] [list \ "Build property 2 (.o)" \ "-r -nostdlib" \ - "-Wa,-mx86-used-note=yes" \ + "$DIRECT_EXTERN_ACCESS_CFLAGS -Wa,-mx86-used-note=yes" \ {pass.c property-stack.S} \ {{readelf {-n} property-2a.r}} \ "property-2.o" \ @@ -920,7 +926,7 @@ if { [isnative] [list \ "Build property 3 (.o)" \ "-r -nostdlib" \ - "-Wa,-mx86-used-note=yes" \ + "$DIRECT_EXTERN_ACCESS_CFLAGS -Wa,-mx86-used-note=yes" \ {pass.c property-x86-1.S property-stack.S} \ {{readelf {-n} property-3a.r}} \ "property-3.o" \ @@ -944,7 +950,7 @@ if { [isnative] [list \ "Build property 4 (.o)" \ "-r -nostdlib" \ - "-Wa,-mx86-used-note=yes" \ + "$DIRECT_EXTERN_ACCESS_CFLAGS -Wa,-mx86-used-note=yes" \ {pass.c property-x86-2.S property-x86-1.S property-stack.S} \ {{readelf {-n} property-4a.r}} \ "property-4.o" \ @@ -976,7 +982,7 @@ if { [isnative] [list \ "Build property 5 (.o)" \ "-r -nostdlib -Wl,-z,stack-size=0x900000" \ - "-Wa,-mx86-used-note=yes" \ + "$DIRECT_EXTERN_ACCESS_CFLAGS -Wa,-mx86-used-note=yes" \ {pass.c property-x86-2.S property-x86-1.S property-stack.S} \ {{readelf {-n} property-5a.r}} \ "property-5.o" \ @@ -1000,7 +1006,7 @@ if { [isnative] [list \ "Build property-6.o" \ "-r -nostdlib" \ - "-Wa,-mx86-used-note=yes" \ + "$DIRECT_EXTERN_ACCESS_CFLAGS -Wa,-mx86-used-note=yes" \ {property-6b.c property-stack.S} \ {{readelf {-n} property-2a.r}} \ "property-6.o" \ @@ -1067,6 +1073,7 @@ if { [isnative] { dummy.c } \ "pr17689" \ "pr17689.out" \ + "$DIRECT_EXTERN_ACCESS_CFLAGS" \ ] \ [list \ "Run pr17689 with PIE, -z now and GOTOFF" \ @@ -1075,6 +1082,7 @@ if { [isnative] { dummy.c } \ "pr17689now" \ "pr17689.out" \ + "$DIRECT_EXTERN_ACCESS_CFLAGS" \ ] \ [list \ "Run pr17689ver with PIE and GOTOFF" \ @@ -1083,6 +1091,7 @@ if { [isnative] { dummy.c } \ "pr17689ver" \ "pr17689.out" \ + "$DIRECT_EXTERN_ACCESS_CFLAGS" \ ] \ [list \ "Run pr18900" \ @@ -1318,7 +1327,7 @@ if { [isnative] [list \ "Build pr28875" \ "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/pr28875.so" \ - "$NOPIE_CFLAGS" \ + "$NOPIE_CFLAGS $DIRECT_EXTERN_ACCESS_CFLAGS" \ { pr28875b.c } \ {{error_output "pr28875.err"}} \ "pr28875" \ @@ -1326,7 +1335,7 @@ if { [isnative] [list \ "Build pr21997-1" \ "$NOPIE_LDFLAGS -Wl,--no-as-needed,-z,notext tmpdir/pr21997-1.so" \ - "$NOPIE_CFLAGS -Wa,-mx86-used-note=yes" \ + "$NOPIE_CFLAGS $DIRECT_EXTERN_ACCESS_CFLAGS -Wa,-mx86-used-note=yes" \ { pr21997-1b.c } \ {{error_output "pr21997-1.err"}} \ "pr21997-1" \ @@ -1514,6 +1523,45 @@ run_ld_link_tests [list \ ] \ ] +# The musl C library does not support --gnu-tls-tag nor --gnu2-tls-tag. +if { ![istarget *-*-musl] + && [check_compiler_available] } { + run_cc_link_tests [list \ + [list \ + "Build gnu-tls-1a.so" \ + "-shared -Wl,--no-as-needed,--gnu-tls-tag" \ + "-fPIC" \ + { gnu-tls-1.s } \ + {{readelf {-W --version-info} gnu-tls-1a.rd}} \ + "gnu-tls-1a.so" \ + ] \ + [list \ + "Build gnu-tls-1b.so" \ + "-shared -Wl,--no-as-needed,--no-gnu-tls-tag" \ + "-fPIC" \ + { gnu-tls-1.s } \ + {{readelf {-W --version-info} gnu-tls-1b.rd}} \ + "gnu-tls-1b.so" \ + ] \ + [list \ + "Build gnu2-tls-1a.so" \ + "-shared -Wl,--no-as-needed,--gnu2-tls-tag" \ + "-fPIC" \ + { gnu2-tls-1.s } \ + {{readelf {-W --version-info} gnu2-tls-1a.rd}} \ + "gnu2-tls-1a.so" \ + ] \ + [list \ + "Build gnu2-tls-1b.so" \ + "-shared -Wl,--no-as-needed,--no-gnu2-tls-tag" \ + "-fPIC" \ + { gnu2-tls-1.s } \ + {{readelf {-W --version-info} gnu2-tls-1b.rd}} \ + "gnu2-tls-1b.so" \ + ] \ + ] +} + # Linux only tests run_dump_test "pltgot-1" run_dump_test "pltgot-2" diff --git a/ld/testsuite/ld-i386/libgot-1a.rd b/ld/testsuite/ld-i386/libgot-1a.rd new file mode 100644 index 0000000..b8609b8 --- /dev/null +++ b/ld/testsuite/ld-i386/libgot-1a.rd @@ -0,0 +1,9 @@ + +Relocation section '.rel.dyn' at offset 0x128 contains 1 entry: + Offset Info Type Sym. Value Symbol's Name +0+2001fc 00000206 R_386_GLOB_DAT 00000000 foo + +Relocation section '.rel.plt' at offset 0x130 contains 1 entry: + Offset Info Type Sym. Value Symbol's Name +0+20020c 00000307 R_386_JUMP_SLOT 00000000 bar +#pass diff --git a/ld/testsuite/ld-i386/libgot-1b.rd b/ld/testsuite/ld-i386/libgot-1b.rd new file mode 100644 index 0000000..faebdb4 --- /dev/null +++ b/ld/testsuite/ld-i386/libgot-1b.rd @@ -0,0 +1,119 @@ +ELF Header: + Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00 + Class: ELF32 + Data: 2's complement, little endian + Version: 1 \(current\) + OS/ABI: UNIX - System V + ABI Version: 0 + Type: DYN \(Shared object file\) + Machine: Intel 80386 + Version: 0x1 + Entry point address: 0x0 + Start of program headers: 52 \(bytes into file\) + Start of section headers: 768 \(bytes into file\) + Flags: 0x0 + Size of this header: 52 \(bytes\) + Size of program headers: 32 \(bytes\) + Number of program headers: 4 + Size of section headers: 40 \(bytes\) + Number of section headers: 14 + Section header string table index: 13 + +Section Headers: + \[Nr\] Name Type Addr Off Size ES Flg Lk Inf Al + \[ 0\] NULL 00000000 000000 000000 00 0 0 0 + \[ 1\] .hash HASH 000000b4 0000b4 000024 04 A 2 0 4 + \[ 2\] .dynsym DYNSYM 000000d8 0000d8 000040 10 A 3 1 4 + \[ 3\] .dynstr STRTAB 00000118 000118 00000e 00 A 0 0 1 + \[ 4\] .rel.dyn REL 00000128 000128 000008 08 A 2 0 4 + \[ 5\] .rel.plt REL 00000130 000130 000008 08 AI 2 10 4 + \[ 6\] .plt PROGBITS 00000140 000140 000020 04 AX 0 0 16 + \[ 7\] .text PROGBITS 00000160 000160 00000b 00 AX 0 0 1 + \[ 8\] .dynamic DYNAMIC 0020016c 00016c 000090 08 WA 3 0 4 + \[ 9\] .got PROGBITS 002001fc 0001fc 000004 04 WA 0 0 4 + \[10\] .got.plt PROGBITS 00200200 000200 000010 04 WA 0 0 4 + \[11\] .symtab SYMTAB 00000000 000210 000060 10 12 3 4 + \[12\] .strtab STRTAB 00000000 000270 00002d 00 0 0 1 + \[13\] .shstrtab STRTAB 00000000 00029d 000060 00 0 0 1 +Key to Flags: + W \(write\), A \(alloc\), X \(execute\), M \(merge\), S \(strings\), I \(info\), + L \(link order\), O \(extra OS processing required\), G \(group\), T \(TLS\), + C \(compressed\), x \(unknown\), o \(OS specific\), E \(exclude\), + D \(mbind\), p \(processor specific\) + +There are no section groups in this file. + +Program Headers: + Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align + LOAD 0x000000 0x00000000 0x00000000 0x0016b 0x0016b R E 0x200000 + LOAD 0x00016c 0x0020016c 0x0020016c 0x000a4 0x000a4 RW 0x200000 + DYNAMIC 0x00016c 0x0020016c 0x0020016c 0x00090 0x00090 RW 0x4 + GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x00000 RW 0x10 + + Section to Segment mapping: + Segment Sections... + 00 .hash .dynsym .dynstr .rel.dyn .rel.plt .plt .text + 01 .dynamic .got .got.plt + 02 .dynamic + 03 + +Dynamic section at offset 0x16c contains 13 entries: + Tag Type Name/Value + 0x00000004 \(HASH\) 0xb4 + 0x00000005 \(STRTAB\) 0x118 + 0x00000006 \(SYMTAB\) 0xd8 + 0x0000000a \(STRSZ\) 14 \(bytes\) + 0x0000000b \(SYMENT\) 16 \(bytes\) + 0x00000003 \(PLTGOT\) 0x200200 + 0x00000002 \(PLTRELSZ\) 8 \(bytes\) + 0x00000014 \(PLTREL\) REL + 0x00000017 \(JMPREL\) 0x130 + 0x00000011 \(REL\) 0x128 + 0x00000012 \(RELSZ\) 8 \(bytes\) + 0x00000013 \(RELENT\) 8 \(bytes\) + 0x00000000 \(NULL\) 0x0 + +Relocation section '.rel.dyn' at offset 0x128 contains 1 entry: + Offset Info Type Sym. Value Symbol's Name +0+2001fc 00000206 R_386_GLOB_DAT 00000000 foo + +Relocation section '.rel.plt' at offset 0x130 contains 1 entry: + Offset Info Type Sym. Value Symbol's Name +0+20020c 00000307 R_386_JUMP_SLOT 00000000 bar +No processor specific unwind information to decode + +Symbol table '.dynsym' contains 4 entries: + Num: Value Size Type Bind Vis Ndx Name + +[a-f0-9]+: 00000000 0 NOTYPE LOCAL DEFAULT UND + +[a-f0-9]+: 00000160 0 FUNC GLOBAL DEFAULT 7 func + +[a-f0-9]+: 00000000 0 NOTYPE GLOBAL DEFAULT UND foo + +[a-f0-9]+: 00000000 0 NOTYPE GLOBAL DEFAULT UND bar + +Symbol table '.symtab' contains 6 entries: + Num: Value Size Type Bind Vis Ndx Name + +[a-f0-9]+: 00000000 0 NOTYPE LOCAL DEFAULT UND + +[a-f0-9]+: 0020016c 0 OBJECT LOCAL DEFAULT 8 _DYNAMIC + +[a-f0-9]+: 00200200 0 OBJECT LOCAL DEFAULT 10 _GLOBAL_OFFSET_TABLE_ + +[a-f0-9]+: 00000160 0 FUNC GLOBAL DEFAULT 7 func + +[a-f0-9]+: 00000000 0 NOTYPE GLOBAL DEFAULT UND foo + +[a-f0-9]+: 00000000 0 NOTYPE GLOBAL DEFAULT UND bar + +Histogram for bucket list length \(total of 3 buckets\): + Length Number % of total Coverage + 0 1 \( 33.3%\) + 1 1 \( 33.3%\) 33.3% + 2 1 \( 33.3%\) 100.0% + +No version information found in this file. + +Global Offset Table '.got' contains 1 entry: + Index: Address Reloc Sym. Name \+ Addend/Value + +[0-9]+: 002001fc R_386_GLOB_DAT foo \+ 0 + +Global Offset Table '.got.plt' contains 4 entries: + Index: Address Reloc Sym. Name \+ Addend/Value + +[0-9]+: 00200200 20016c + +[0-9]+: 00200204 0 + +[0-9]+: 00200208 0 + +[0-9]+: 0020020c R_386_JUMP_SLOT bar \+ 156 +#pass diff --git a/ld/testsuite/ld-i386/libgot-1c.rd b/ld/testsuite/ld-i386/libgot-1c.rd new file mode 100644 index 0000000..374b03f --- /dev/null +++ b/ld/testsuite/ld-i386/libgot-1c.rd @@ -0,0 +1,12 @@ + +Global Offset Table '.got' contains 1 entry: + Index: Address Reloc Sym. Name \+ Addend/Value + +[0-9]+: 002001fc R_386_GLOB_DAT foo \+ 0 + +Global Offset Table '.got.plt' contains 4 entries: + Index: Address Reloc Sym. Name \+ Addend/Value + +[0-9]+: 00200200 20016c + +[0-9]+: 00200204 0 + +[0-9]+: 00200208 0 + +[0-9]+: 0020020c R_386_JUMP_SLOT bar \+ 156 +#pass diff --git a/ld/testsuite/ld-i386/libgot-1d.rd b/ld/testsuite/ld-i386/libgot-1d.rd new file mode 100644 index 0000000..632b47b --- /dev/null +++ b/ld/testsuite/ld-i386/libgot-1d.rd @@ -0,0 +1,12 @@ + +Global Offset Table '.got' contains 1 entry: + Index: Address Reloc Sym. Name \+ Addend/Value + +[0-9]+: 002001fc R_386_GLOB_DAT foo \+ 0 + +Global Offset Table '.got.plt' contains 4 entries: + Index: Address Reloc Sym. Name \+ Addend/Value + +[0-9]+: 00200200 20016c + +[0-9]+: 00200204 0 + +[0-9]+: 00200208 0 + +[0-9]+: 0020020c R_386_JUMP_SLOT bar \+ 156 +#pass diff --git a/ld/testsuite/ld-i386/libno-plt-1b.dd b/ld/testsuite/ld-i386/libno-plt-1b.dd index eec9d4a..d2f3e93 100644 --- a/ld/testsuite/ld-i386/libno-plt-1b.dd +++ b/ld/testsuite/ld-i386/libno-plt-1b.dd @@ -9,11 +9,11 @@ Disassembly of section .text: [0-9a-f]+ <get_func>: +[a-f0-9]+: e8 ([0-9a-f]{2} ){4}[ ]+call +[a-f0-9]+ <__x86.get_pc_thunk.ax> +[a-f0-9]+: 05 ([0-9a-f]{2} ){4}[ ]+add +\$0x[a-f0-9]+,%eax - +[a-f0-9]+: 8b 80 ([0-9a-f]{2} ){4}[ ]+mov +-0x[a-f0-9]+\(%eax\),%eax + +[a-f0-9]+: 8b 80 ([0-9a-f]{2} ){4}[ ]+mov +-?0x[a-f0-9]+\(%eax\),%eax +[a-f0-9]+: c3 ret #... [0-9a-f]+ <call_func>: +[a-f0-9]+: e8 ([0-9a-f]{2} ){4}[ ]+call +[a-f0-9]+ <__x86.get_pc_thunk.ax> +[a-f0-9]+: 05 ([0-9a-f]{2} ){4}[ ]+add +\$0x[a-f0-9]+,%eax - +[a-f0-9]+: ff a0 ([0-9a-f]{2} ){4}[ ]+jmp +\*-0x[0-9a-f]+\(%eax\) + +[a-f0-9]+: ff a0 ([0-9a-f]{2} ){4}[ ]+jmp +\*-?0x[0-9a-f]+\(%eax\) #pass diff --git a/ld/testsuite/ld-i386/no-plt-1a.dd b/ld/testsuite/ld-i386/no-plt-1a.dd index 8c76d9b..9d32b85 100644 --- a/ld/testsuite/ld-i386/no-plt-1a.dd +++ b/ld/testsuite/ld-i386/no-plt-1a.dd @@ -23,14 +23,14 @@ Disassembly of section .text: +[a-f0-9]+: 67 e8 ([0-9a-f]{2} ){4}[ ]+addr16 call [0-9a-f]+ <call_func> +[a-f0-9]+: 3d 78 56 34 12 cmp \$0x12345678,%eax +[a-f0-9]+: 75 15 jne +[0-9a-f]+ <check\+0x[0-9a-f]+> - +[a-f0-9]+: 8d 83 ([0-9a-f]{2} ){4}[ ]+lea +-0x[a-f0-9]+\(%ebx\),%eax + +[a-f0-9]+: 8d 83 ([0-9a-f]{2} ){4}[ ]+lea +-?0x[a-f0-9]+\(%ebx\),%eax +[a-f0-9]+: 83 ec 0c sub \$0xc,%esp +[a-f0-9]+: 50 push %eax - +[a-f0-9]+: ff 93 ([0-9a-f]{2} ){4}[ ]+call +\*-0x[0-9a-f]+\(%ebx\) + +[a-f0-9]+: ff 93 ([0-9a-f]{2} ){4}[ ]+call +\*-?0x[0-9a-f]+\(%ebx\) +[a-f0-9]+: 83 c4 18 add \$0x18,%esp +[a-f0-9]+: 5b pop %ebx +[a-f0-9]+: c3 ret - +[a-f0-9]+: ff 93 ([0-9a-f]{2} ){4}[ ]+call +\*-0x[0-9a-f]+\(%ebx\) + +[a-f0-9]+: ff 93 ([0-9a-f]{2} ){4}[ ]+call +\*-?0x[0-9a-f]+\(%ebx\) #... [0-9a-f]+ <get_func>: +[a-f0-9]+: e8 ([0-9a-f]{2} ){4}[ ]+call +[a-f0-9]+ <__x86.get_pc_thunk.ax> diff --git a/ld/testsuite/ld-i386/no-plt-1b.dd b/ld/testsuite/ld-i386/no-plt-1b.dd index 431011c..1318353 100644 --- a/ld/testsuite/ld-i386/no-plt-1b.dd +++ b/ld/testsuite/ld-i386/no-plt-1b.dd @@ -11,24 +11,24 @@ Disassembly of section .text: +[a-f0-9]+: e8 ([0-9a-f]{2} ){4}[ ]+call [a-f0-9]+ <__x86.get_pc_thunk.bx> +[a-f0-9]+: 81 c3 ([0-9a-f]{2} ){4}[ ]+add +\$0x[a-f0-9]+,%ebx +[a-f0-9]+: 83 ec 08 sub \$0x8,%esp - +[a-f0-9]+: ff 93 ([0-9a-f]{2} ){4}[ ]+call +\*-0x[0-9a-f]+\(%ebx\) - +[a-f0-9]+: 3b 83 ([0-9a-f]{2} ){4}[ ]+cmp +-0x[a-f0-9]+\(%ebx\),%eax + +[a-f0-9]+: ff 93 ([0-9a-f]{2} ){4}[ ]+call +\*-?0x[0-9a-f]+\(%ebx\) + +[a-f0-9]+: 3b 83 ([0-9a-f]{2} ){4}[ ]+cmp +-?0x[a-f0-9]+\(%ebx\),%eax +[a-f0-9]+: 75 39 jne [0-9a-f]+ <check\+0x[0-9a-f]+> - +[a-f0-9]+: 8b 93 ([0-9a-f]{2} ){4}[ ]+mov +-0x[0-9a-f]+\(%ebx\),%edx + +[a-f0-9]+: 8b 93 ([0-9a-f]{2} ){4}[ ]+mov +-?0x[0-9a-f]+\(%ebx\),%edx +[a-f0-9]+: 39 02 cmp %eax,\(%edx\) +[a-f0-9]+: 75 2f jne [0-9a-f]+ <check\+0x[0-9a-f]+> - +[a-f0-9]+: ff 93 ([0-9a-f]{2} ){4}[ ]+call +\*-0x[0-9a-f]+\(%ebx\) + +[a-f0-9]+: ff 93 ([0-9a-f]{2} ){4}[ ]+call +\*-?0x[0-9a-f]+\(%ebx\) +[a-f0-9]+: 3d 78 56 34 12 cmp \$0x12345678,%eax +[a-f0-9]+: 75 22 jne +[0-9a-f]+ <check\+0x[0-9a-f]+> - +[a-f0-9]+: ff 93 ([0-9a-f]{2} ){4}[ ]+call +\*-0x[0-9a-f]+\(%ebx\) + +[a-f0-9]+: ff 93 ([0-9a-f]{2} ){4}[ ]+call +\*-?0x[0-9a-f]+\(%ebx\) +[a-f0-9]+: 3d 78 56 34 12 cmp \$0x12345678,%eax +[a-f0-9]+: 75 15 jne +[0-9a-f]+ <check\+0x[0-9a-f]+> +[a-f0-9]+: 8d 83 ([0-9a-f]{2} ){4}[ ]+lea +-0x[a-f0-9]+\(%ebx\),%eax +[a-f0-9]+: 83 ec 0c sub \$0xc,%esp +[a-f0-9]+: 50 push %eax - +[a-f0-9]+: ff 93 ([0-9a-f]{2} ){4}[ ]+call +\*-0x[0-9a-f]+\(%ebx\) + +[a-f0-9]+: ff 93 ([0-9a-f]{2} ){4}[ ]+call +\*-?0x[0-9a-f]+\(%ebx\) +[a-f0-9]+: 83 c4 18 add \$0x18,%esp +[a-f0-9]+: 5b pop %ebx +[a-f0-9]+: c3 ret - +[a-f0-9]+: ff 93 ([0-9a-f]{2} ){4}[ ]+call +\*-0x[0-9a-f]+\(%ebx\) + +[a-f0-9]+: ff 93 ([0-9a-f]{2} ){4}[ ]+call +\*-?0x[0-9a-f]+\(%ebx\) #pass diff --git a/ld/testsuite/ld-i386/no-plt-1c.dd b/ld/testsuite/ld-i386/no-plt-1c.dd index ae31742..5422040 100644 --- a/ld/testsuite/ld-i386/no-plt-1c.dd +++ b/ld/testsuite/ld-i386/no-plt-1c.dd @@ -11,24 +11,24 @@ Disassembly of section .text: +[a-f0-9]+: e8 ([0-9a-f]{2} ){4}[ ]+call [a-f0-9]+ <__x86.get_pc_thunk.bx> +[a-f0-9]+: 81 c3 ([0-9a-f]{2} ){4}[ ]+add +\$0x[a-f0-9]+,%ebx +[a-f0-9]+: 83 ec 08 sub \$0x8,%esp - +[a-f0-9]+: ff 93 ([0-9a-f]{2} ){4}[ ]+call +\*-0x[0-9a-f]+\(%ebx\) + +[a-f0-9]+: ff 93 ([0-9a-f]{2} ){4}[ ]+call +\*-?0x[0-9a-f]+\(%ebx\) +[a-f0-9]+: 81 f8 ([0-9a-f]{2} ){4}[ ]+cmp +\$0x[0-9a-f]+,%eax +[a-f0-9]+: 75 39 jne [0-9a-f]+ <check\+0x[0-9a-f]+> - +[a-f0-9]+: 8b 93 ([0-9a-f]{2} ){4}[ ]+mov +-0x[0-9a-f]+\(%ebx\),%edx + +[a-f0-9]+: 8b 93 ([0-9a-f]{2} ){4}[ ]+mov +-?0x[0-9a-f]+\(%ebx\),%edx +[a-f0-9]+: 39 02 cmp %eax,\(%edx\) +[a-f0-9]+: 75 2f jne [0-9a-f]+ <check\+0x[0-9a-f]+> +[a-f0-9]+: 67 e8 ([0-9a-f]{2} ){4}[ ]+addr16 call [0-9a-f]+ <func> +[a-f0-9]+: 3d 78 56 34 12 cmp \$0x12345678,%eax +[a-f0-9]+: 75 22 jne +[0-9a-f]+ <check\+0x[0-9a-f]+> - +[a-f0-9]+: ff 93 ([0-9a-f]{2} ){4}[ ]+call +\*-0x[0-9a-f]+\(%ebx\) + +[a-f0-9]+: ff 93 ([0-9a-f]{2} ){4}[ ]+call +\*-?0x[0-9a-f]+\(%ebx\) +[a-f0-9]+: 3d 78 56 34 12 cmp \$0x12345678,%eax +[a-f0-9]+: 75 15 jne +[0-9a-f]+ <check\+0x[0-9a-f]+> +[a-f0-9]+: 8d 83 ([0-9a-f]{2} ){4}[ ]+lea +-0x[a-f0-9]+\(%ebx\),%eax +[a-f0-9]+: 83 ec 0c sub \$0xc,%esp +[a-f0-9]+: 50 push %eax - +[a-f0-9]+: ff 93 ([0-9a-f]{2} ){4}[ ]+call +\*-0x[0-9a-f]+\(%ebx\) + +[a-f0-9]+: ff 93 ([0-9a-f]{2} ){4}[ ]+call +\*-?0x[0-9a-f]+\(%ebx\) +[a-f0-9]+: 83 c4 18 add \$0x18,%esp +[a-f0-9]+: 5b pop %ebx +[a-f0-9]+: c3 ret - +[a-f0-9]+: ff 93 ([0-9a-f]{2} ){4}[ ]+call +\*-0x[0-9a-f]+\(%ebx\) + +[a-f0-9]+: ff 93 ([0-9a-f]{2} ){4}[ ]+call +\*-?0x[0-9a-f]+\(%ebx\) #pass diff --git a/ld/testsuite/ld-i386/no-plt-1e.dd b/ld/testsuite/ld-i386/no-plt-1e.dd index 56b1a76..af7d9d9 100644 --- a/ld/testsuite/ld-i386/no-plt-1e.dd +++ b/ld/testsuite/ld-i386/no-plt-1e.dd @@ -12,7 +12,7 @@ Disassembly of section .text: +[a-f0-9]+: 81 c3 ([0-9a-f]{2} ){4}[ ]+add +\$0x[a-f0-9]+,%ebx +[a-f0-9]+: 83 ec 08 sub \$0x8,%esp +[a-f0-9]+: 67 e8 ([0-9a-f]{2} ){4}[ ]+addr16 call [0-9a-f]+ <get_func> - +[a-f0-9]+: 3b 83 ([0-9a-f]{2} ){4}[ ]+cmp +-0x[a-f0-9]+\(%ebx\),%eax + +[a-f0-9]+: 3b 83 ([0-9a-f]{2} ){4}[ ]+cmp +-?0x[a-f0-9]+\(%ebx\),%eax +[a-f0-9]+: 75 39 jne [0-9a-f]+ <check\+0x[0-9a-f]+> +[a-f0-9]+: 8d 93 ([0-9a-f]{2} ){4}[ ]+lea +0x[a-f0-9]+\(%ebx\),%edx +[a-f0-9]+: 39 02 cmp %eax,\(%edx\) @@ -26,11 +26,11 @@ Disassembly of section .text: +[a-f0-9]+: 8d 83 ([0-9a-f]{2} ){4}[ ]+lea +-0x[a-f0-9]+\(%ebx\),%eax +[a-f0-9]+: 83 ec 0c sub \$0xc,%esp +[a-f0-9]+: 50 push %eax - +[a-f0-9]+: ff 93 ([0-9a-f]{2} ){4}[ ]+call +\*-0x[0-9a-f]+\(%ebx\) + +[a-f0-9]+: ff 93 ([0-9a-f]{2} ){4}[ ]+call +\*-?0x[0-9a-f]+\(%ebx\) +[a-f0-9]+: 83 c4 18 add \$0x18,%esp +[a-f0-9]+: 5b pop %ebx +[a-f0-9]+: c3 ret - +[a-f0-9]+: ff 93 ([0-9a-f]{2} ){4}[ ]+call +\*-0x[0-9a-f]+\(%ebx\) + +[a-f0-9]+: ff 93 ([0-9a-f]{2} ){4}[ ]+call +\*-?0x[0-9a-f]+\(%ebx\) #... [0-9a-f]+ <get_func>: +[a-f0-9]+: e8 ([0-9a-f]{2} ){4}[ ]+call +[a-f0-9]+ <__x86.get_pc_thunk.ax> diff --git a/ld/testsuite/ld-i386/no-plt-1f.dd b/ld/testsuite/ld-i386/no-plt-1f.dd index 431011c..1318353 100644 --- a/ld/testsuite/ld-i386/no-plt-1f.dd +++ b/ld/testsuite/ld-i386/no-plt-1f.dd @@ -11,24 +11,24 @@ Disassembly of section .text: +[a-f0-9]+: e8 ([0-9a-f]{2} ){4}[ ]+call [a-f0-9]+ <__x86.get_pc_thunk.bx> +[a-f0-9]+: 81 c3 ([0-9a-f]{2} ){4}[ ]+add +\$0x[a-f0-9]+,%ebx +[a-f0-9]+: 83 ec 08 sub \$0x8,%esp - +[a-f0-9]+: ff 93 ([0-9a-f]{2} ){4}[ ]+call +\*-0x[0-9a-f]+\(%ebx\) - +[a-f0-9]+: 3b 83 ([0-9a-f]{2} ){4}[ ]+cmp +-0x[a-f0-9]+\(%ebx\),%eax + +[a-f0-9]+: ff 93 ([0-9a-f]{2} ){4}[ ]+call +\*-?0x[0-9a-f]+\(%ebx\) + +[a-f0-9]+: 3b 83 ([0-9a-f]{2} ){4}[ ]+cmp +-?0x[a-f0-9]+\(%ebx\),%eax +[a-f0-9]+: 75 39 jne [0-9a-f]+ <check\+0x[0-9a-f]+> - +[a-f0-9]+: 8b 93 ([0-9a-f]{2} ){4}[ ]+mov +-0x[0-9a-f]+\(%ebx\),%edx + +[a-f0-9]+: 8b 93 ([0-9a-f]{2} ){4}[ ]+mov +-?0x[0-9a-f]+\(%ebx\),%edx +[a-f0-9]+: 39 02 cmp %eax,\(%edx\) +[a-f0-9]+: 75 2f jne [0-9a-f]+ <check\+0x[0-9a-f]+> - +[a-f0-9]+: ff 93 ([0-9a-f]{2} ){4}[ ]+call +\*-0x[0-9a-f]+\(%ebx\) + +[a-f0-9]+: ff 93 ([0-9a-f]{2} ){4}[ ]+call +\*-?0x[0-9a-f]+\(%ebx\) +[a-f0-9]+: 3d 78 56 34 12 cmp \$0x12345678,%eax +[a-f0-9]+: 75 22 jne +[0-9a-f]+ <check\+0x[0-9a-f]+> - +[a-f0-9]+: ff 93 ([0-9a-f]{2} ){4}[ ]+call +\*-0x[0-9a-f]+\(%ebx\) + +[a-f0-9]+: ff 93 ([0-9a-f]{2} ){4}[ ]+call +\*-?0x[0-9a-f]+\(%ebx\) +[a-f0-9]+: 3d 78 56 34 12 cmp \$0x12345678,%eax +[a-f0-9]+: 75 15 jne +[0-9a-f]+ <check\+0x[0-9a-f]+> +[a-f0-9]+: 8d 83 ([0-9a-f]{2} ){4}[ ]+lea +-0x[a-f0-9]+\(%ebx\),%eax +[a-f0-9]+: 83 ec 0c sub \$0xc,%esp +[a-f0-9]+: 50 push %eax - +[a-f0-9]+: ff 93 ([0-9a-f]{2} ){4}[ ]+call +\*-0x[0-9a-f]+\(%ebx\) + +[a-f0-9]+: ff 93 ([0-9a-f]{2} ){4}[ ]+call +\*-?0x[0-9a-f]+\(%ebx\) +[a-f0-9]+: 83 c4 18 add \$0x18,%esp +[a-f0-9]+: 5b pop %ebx +[a-f0-9]+: c3 ret - +[a-f0-9]+: ff 93 ([0-9a-f]{2} ){4}[ ]+call +\*-0x[0-9a-f]+\(%ebx\) + +[a-f0-9]+: ff 93 ([0-9a-f]{2} ){4}[ ]+call +\*-?0x[0-9a-f]+\(%ebx\) #pass diff --git a/ld/testsuite/ld-i386/no-plt-1g.dd b/ld/testsuite/ld-i386/no-plt-1g.dd index 4f18453..cca995b 100644 --- a/ld/testsuite/ld-i386/no-plt-1g.dd +++ b/ld/testsuite/ld-i386/no-plt-1g.dd @@ -11,24 +11,24 @@ Disassembly of section .text: +[a-f0-9]+: e8 ([0-9a-f]{2} ){4}[ ]+call [a-f0-9]+ <__x86.get_pc_thunk.bx> +[a-f0-9]+: 81 c3 ([0-9a-f]{2} ){4}[ ]+add +\$0x[a-f0-9]+,%ebx +[a-f0-9]+: 83 ec 08 sub \$0x8,%esp - +[a-f0-9]+: ff 93 ([0-9a-f]{2} ){4}[ ]+call +\*-0x[0-9a-f]+\(%ebx\) - +[a-f0-9]+: 3b 83 ([0-9a-f]{2} ){4}[ ]+cmp +-0x[a-f0-9]+\(%ebx\),%eax + +[a-f0-9]+: ff 93 ([0-9a-f]{2} ){4}[ ]+call +\*-?0x[0-9a-f]+\(%ebx\) + +[a-f0-9]+: 3b 83 ([0-9a-f]{2} ){4}[ ]+cmp +-?0x[a-f0-9]+\(%ebx\),%eax +[a-f0-9]+: 75 39 jne [0-9a-f]+ <check\+0x[0-9a-f]+> - +[a-f0-9]+: 8b 93 ([0-9a-f]{2} ){4}[ ]+mov +-0x[0-9a-f]+\(%ebx\),%edx + +[a-f0-9]+: 8b 93 ([0-9a-f]{2} ){4}[ ]+mov +-?0x[0-9a-f]+\(%ebx\),%edx +[a-f0-9]+: 39 02 cmp %eax,\(%edx\) +[a-f0-9]+: 75 2f jne [0-9a-f]+ <check\+0x[0-9a-f]+> +[a-f0-9]+: 67 e8 ([0-9a-f]{2} ){4}[ ]+addr16 call [0-9a-f]+ <func> +[a-f0-9]+: 3d 78 56 34 12 cmp \$0x12345678,%eax +[a-f0-9]+: 75 22 jne +[0-9a-f]+ <check\+0x[0-9a-f]+> - +[a-f0-9]+: ff 93 ([0-9a-f]{2} ){4}[ ]+call +\*-0x[0-9a-f]+\(%ebx\) + +[a-f0-9]+: ff 93 ([0-9a-f]{2} ){4}[ ]+call +\*-?0x[0-9a-f]+\(%ebx\) +[a-f0-9]+: 3d 78 56 34 12 cmp \$0x12345678,%eax +[a-f0-9]+: 75 15 jne +[0-9a-f]+ <check\+0x[0-9a-f]+> +[a-f0-9]+: 8d 83 ([0-9a-f]{2} ){4}[ ]+lea +-0x[a-f0-9]+\(%ebx\),%eax +[a-f0-9]+: 83 ec 0c sub \$0xc,%esp +[a-f0-9]+: 50 push %eax - +[a-f0-9]+: ff 93 ([0-9a-f]{2} ){4}[ ]+call +\*-0x[0-9a-f]+\(%ebx\) + +[a-f0-9]+: ff 93 ([0-9a-f]{2} ){4}[ ]+call +\*-?0x[0-9a-f]+\(%ebx\) +[a-f0-9]+: 83 c4 18 add \$0x18,%esp +[a-f0-9]+: 5b pop %ebx +[a-f0-9]+: c3 ret - +[a-f0-9]+: ff 93 ([0-9a-f]{2} ){4}[ ]+call +\*-0x[0-9a-f]+\(%ebx\) + +[a-f0-9]+: ff 93 ([0-9a-f]{2} ){4}[ ]+call +\*-?0x[0-9a-f]+\(%ebx\) #pass diff --git a/ld/testsuite/ld-i386/no-plt.exp b/ld/testsuite/ld-i386/no-plt.exp index e0b00ba..42f6def 100644 --- a/ld/testsuite/ld-i386/no-plt.exp +++ b/ld/testsuite/ld-i386/no-plt.exp @@ -72,7 +72,7 @@ run_cc_link_tests [list \ "libno-plt-1b.so" \ ] \ [list \ - "No PLT (dynamic 1a)" \ + "Build no PLT (dynamic 1a)" \ "$NOPIE_LDFLAGS tmpdir/no-plt-check1a.o tmpdir/no-plt-main1.o \ tmpdir/no-plt-func1.o tmpdir/no-plt-extern1a.o -Wl,-z,lazy" \ "-Wa,-mx86-used-note=yes" \ @@ -81,7 +81,7 @@ run_cc_link_tests [list \ "no-plt-1a" \ ] \ [list \ - "No PLT (dynamic 1b)" \ + "Build no PLT (dynamic 1b)" \ "-Wl,-z,lazy tmpdir/no-plt-check1a.o tmpdir/no-plt-main1.o \ tmpdir/libno-plt-1a.so tmpdir/libno-plt-1b.so" \ "-Wa,-mx86-used-note=yes" \ @@ -90,7 +90,7 @@ run_cc_link_tests [list \ "no-plt-1b" \ ] \ [list \ - "No PLT (dynamic 1c)" \ + "Build no PLT (dynamic 1c)" \ "$NOPIE_LDFLAGS tmpdir/no-plt-check1a.o tmpdir/no-plt-main1.o \ tmpdir/no-plt-func1.o tmpdir/libno-plt-1b.so -Wl,-z,lazy" \ "-Wa,-mx86-used-note=yes" \ @@ -99,7 +99,7 @@ run_cc_link_tests [list \ "no-plt-1c" \ ] \ [list \ - "No PLT (static 1d)" \ + "Build no PLT (static 1d)" \ "-static tmpdir/no-plt-check1a.o tmpdir/no-plt-main1.o \ tmpdir/no-plt-func1.o tmpdir/no-plt-extern1a.o" \ "-Wa,-mx86-used-note=yes" \ @@ -108,7 +108,7 @@ run_cc_link_tests [list \ "no-plt-1d" \ ] \ [list \ - "No PLT (PIE 1e)" \ + "Build no PLT (PIE 1e)" \ "-pie -Wl,-z,lazy tmpdir/no-plt-check1a.o tmpdir/no-plt-main1.o \ tmpdir/no-plt-func1.o tmpdir/no-plt-extern1a.o" \ "-Wa,-mx86-used-note=yes" \ @@ -117,7 +117,7 @@ run_cc_link_tests [list \ "no-plt-1e" \ ] \ [list \ - "No PLT (PIE 1f)" \ + "Build no PLT (PIE 1f)" \ "-pie -Wl,-z,lazy tmpdir/no-plt-check1a.o tmpdir/no-plt-main1.o \ tmpdir/libno-plt-1a.so tmpdir/libno-plt-1b.so" \ "-Wa,-mx86-used-note=yes" \ @@ -126,7 +126,7 @@ run_cc_link_tests [list \ "no-plt-1f" \ ] \ [list \ - "No PLT (PIE 1g)" \ + "Build no PLT (PIE 1g)" \ "-pie -Wl,-z,lazy tmpdir/no-plt-check1a.o tmpdir/no-plt-main1.o \ tmpdir/no-plt-func1.o tmpdir/libno-plt-1b.so" \ "-Wa,-mx86-used-note=yes" \ @@ -135,7 +135,7 @@ run_cc_link_tests [list \ "no-plt-1g" \ ] \ [list \ - "No PLT (dynamic 1h)" \ + "Build no PLT (dynamic 1h)" \ "$NOPIE_LDFLAGS tmpdir/no-plt-check1b.o tmpdir/no-plt-main1.o \ tmpdir/no-plt-func1.o tmpdir/no-plt-extern1b.o" \ "-Wa,-mx86-used-note=yes" \ @@ -144,7 +144,7 @@ run_cc_link_tests [list \ "no-plt-1h" \ ] \ [list \ - "No PLT (dynamic 1i)" \ + "Build no PLT (dynamic 1i)" \ "$NOPIE_LDFLAGS tmpdir/no-plt-check1b.o tmpdir/no-plt-main1.o \ tmpdir/no-plt-extern1b.o tmpdir/libno-plt-1a.so" \ "-Wa,-mx86-used-note=yes" \ @@ -153,7 +153,7 @@ run_cc_link_tests [list \ "no-plt-1i" \ ] \ [list \ - "No PLT (static 1j)" \ + "Build no PLT (static 1j)" \ "-static tmpdir/no-plt-check1b.o tmpdir/no-plt-main1.o \ tmpdir/no-plt-func1.o tmpdir/no-plt-extern1b.o" \ "-Wa,-mx86-used-note=yes" \ @@ -165,7 +165,7 @@ run_cc_link_tests [list \ run_ld_link_exec_tests [list \ [list \ - "No PLT (dynamic 1a)" \ + "Run no PLT (dynamic 1a)" \ "tmpdir/no-plt-check1a.o tmpdir/no-plt-main1.o \ tmpdir/no-plt-func1.o tmpdir/no-plt-extern1a.o" \ "-Wa,-mx86-used-note=yes" \ @@ -174,7 +174,7 @@ run_ld_link_exec_tests [list \ "pass.out" \ ] \ [list \ - "No PLT (dynamic 1b)" \ + "Run no PLT (dynamic 1b)" \ "tmpdir/no-plt-check1a.o tmpdir/no-plt-main1.o \ tmpdir/libno-plt-1a.so tmpdir/libno-plt-1b.so" \ "-Wa,-mx86-used-note=yes" \ @@ -183,7 +183,7 @@ run_ld_link_exec_tests [list \ "pass.out" \ ] \ [list \ - "No PLT (dynamic 1c)" \ + "Run no PLT (dynamic 1c)" \ "tmpdir/no-plt-check1a.o tmpdir/no-plt-main1.o \ tmpdir/no-plt-func1.o tmpdir/libno-plt-1b.so" \ "-Wa,-mx86-used-note=yes" \ @@ -192,7 +192,7 @@ run_ld_link_exec_tests [list \ "pass.out" \ ] \ [list \ - "No PLT (static 1d)" \ + "Run no PLT (static 1d)" \ "-static tmpdir/no-plt-check1a.o tmpdir/no-plt-main1.o \ tmpdir/no-plt-func1.o tmpdir/no-plt-extern1a.o" \ "-Wa,-mx86-used-note=yes" \ @@ -201,7 +201,7 @@ run_ld_link_exec_tests [list \ "pass.out" \ ] \ [list \ - "No PLT (PIE 1e)" \ + "Run no PLT (PIE 1e)" \ "-pie tmpdir/no-plt-check1a.o tmpdir/no-plt-main1.o \ tmpdir/no-plt-func1.o tmpdir/no-plt-extern1a.o" \ "-Wa,-mx86-used-note=yes" \ @@ -210,7 +210,7 @@ run_ld_link_exec_tests [list \ "pass.out" \ ] \ [list \ - "No PLT (PIE 1f)" \ + "Run no PLT (PIE 1f)" \ "-pie tmpdir/no-plt-check1a.o tmpdir/no-plt-main1.o \ tmpdir/libno-plt-1a.so tmpdir/libno-plt-1b.so" \ "-Wa,-mx86-used-note=yes" \ @@ -219,7 +219,7 @@ run_ld_link_exec_tests [list \ "pass.out" \ ] \ [list \ - "No PLT (PIE 1g)" \ + "Run no PLT (PIE 1g)" \ "-pie tmpdir/no-plt-check1a.o tmpdir/no-plt-main1.o \ tmpdir/no-plt-func1.o tmpdir/libno-plt-1b.so" \ "-Wa,-mx86-used-note=yes" \ @@ -228,7 +228,7 @@ run_ld_link_exec_tests [list \ "pass.out" \ ] \ [list \ - "No PLT (dynamic 1h)" \ + "Run no PLT (dynamic 1h)" \ "$NOPIE_LDFLAGS tmpdir/no-plt-check1b.o tmpdir/no-plt-main1.o \ tmpdir/no-plt-func1.o tmpdir/no-plt-extern1b.o" \ "-Wa,-mx86-used-note=yes" \ @@ -237,7 +237,7 @@ run_ld_link_exec_tests [list \ "pass.out" \ ] \ [list \ - "No PLT (dynamic 1i)" \ + "Run no PLT (dynamic 1i)" \ "$NOPIE_LDFLAGS tmpdir/no-plt-check1b.o tmpdir/no-plt-main1.o \ tmpdir/no-plt-extern1b.o tmpdir/libno-plt-1a.so" \ "-Wa,-mx86-used-note=yes" \ @@ -246,7 +246,7 @@ run_ld_link_exec_tests [list \ "pass.out" \ ] \ [list \ - "No PLT (static 1j)" \ + "Run no PLT (static 1j)" \ "-static tmpdir/no-plt-check1b.o tmpdir/no-plt-main1.o \ tmpdir/no-plt-func1.o tmpdir/no-plt-extern1b.o" \ "-Wa,-mx86-used-note=yes" \ diff --git a/ld/testsuite/ld-i386/pr17057.d b/ld/testsuite/ld-i386/pr17057.d index 29cc676..af4e6c9 100644 --- a/ld/testsuite/ld-i386/pr17057.d +++ b/ld/testsuite/ld-i386/pr17057.d @@ -3,7 +3,10 @@ #ld: -shared -melf_i386 #readelf: -r --wide -Relocation section '.rel.plt' at offset 0x[0-9a-f]+ contains 2 entries: +Relocation section '.rel.dyn' at offset 0x[0-9a-f]+ contains 1 entry: Offset Info Type Sym. Value Symbol's Name -[0-9a-f ]+R_386_JUMP_SLOT +0+ +foo [0-9a-f ]+R_386_TLS_DESC +0+ +my_tls + +Relocation section '.rel.plt' at offset 0x[0-9a-f]+ contains 1 entry: + Offset Info Type Sym. Value Symbol's Name +[0-9a-f ]+R_386_JUMP_SLOT +0+ +foo diff --git a/ld/testsuite/ld-i386/pr28387.d b/ld/testsuite/ld-i386/pr28387.d new file mode 100644 index 0000000..fd1e980 --- /dev/null +++ b/ld/testsuite/ld-i386/pr28387.d @@ -0,0 +1,35 @@ +#as: --32 +#ld: -shared -melf_i386 -z nocombreloc -z noseparate-code --no-ld-generated-unwind-info --hash-style=sysv +#readelf: -d -r -S --wide + +There are [0-9]+ section headers, starting at offset 0x[0-9a-f]+: + +Section Headers: + +\[Nr\] Name +Type +Addr +Off +Size +ES Flg Lk Inf Al +#... + +\[[ 0-9]+\] .rel.data +REL +0+128 0+128 0+8 08 +AI +2 +11 +4 + +\[[ 0-9]+\] .rel.tls +REL +0+130 0+130 0+8 08 +AI +2 +10 +4 + +\[[ 0-9]+\] .rel.plt +REL +0+138 0+138 0+8 08 +AI +2 +10 +4 +#... +Dynamic section at offset 0x[0-9a-f]+ contains [0-9]+ entries: + +Tag +Type +Name/Value +#... + 0x[0-9a-f]+ +\(PLTRELSZ\) +8 \(bytes\) + 0x[0-9a-f]+ +\(PLTREL\) +REL + 0x[0-9a-f]+ +\(JMPREL\) +0x138 +#... + 0x[0-9a-f]+ +\(REL\) +0x128 + 0x[0-9a-f]+ +\(RELSZ\) +16 \(bytes\) + 0x[0-9a-f]+ +\(RELENT\) +8 \(bytes\) +#... +Relocation section '.rel.data' at offset 0x[0-9a-f]+ contains 1 entry: + +Offset +Info +Type +Sym.* Value +Symbol's Name +[0-9a-f]+ +[0-9a-f]+ +R_386_32 +0+ +foo + +Relocation section '.rel.tls' at offset 0x[0-9a-f]+ contains 1 entry: + +Offset +Info +Type +Sym.* Value +Symbol's Name +[0-9a-f]+ +[0-9a-f]+ +R_386_TLS_DESC +0+ +foo + +Relocation section '.rel.plt' at offset 0x[0-9a-f]+ contains 1 entry: + +Offset +Info +Type +Sym.* Value +Symbol's Name +[0-9a-f]+ +[0-9a-f]+ +R_386_JUMP_SLOT +0+ +bar diff --git a/ld/testsuite/ld-i386/pr28387.s b/ld/testsuite/ld-i386/pr28387.s new file mode 100644 index 0000000..beb3189 --- /dev/null +++ b/ld/testsuite/ld-i386/pr28387.s @@ -0,0 +1,12 @@ + .text + .p2align 4 + .globl main + .type main, @function +main: + leal foo@TLSDESC(%ebx), %eax + call *foo@TLSCALL(%eax) + call bar@PLT + ret + .data + .dc.a foo + .section .note.GNU-stack,"",@progbits diff --git a/ld/testsuite/ld-i386/pr33260-2.d b/ld/testsuite/ld-i386/pr33260-2.d new file mode 100644 index 0000000..d84442b --- /dev/null +++ b/ld/testsuite/ld-i386/pr33260-2.d @@ -0,0 +1,6 @@ +#source: pr33260-2.s +#as: -mrelax-relocations=yes --32 +#ld: -melf_i386 -shared +#readelf: -r --wide + +There are no relocations in this file. diff --git a/ld/testsuite/ld-i386/pr33260-2.s b/ld/testsuite/ld-i386/pr33260-2.s new file mode 100644 index 0000000..0fcd388 --- /dev/null +++ b/ld/testsuite/ld-i386/pr33260-2.s @@ -0,0 +1,30 @@ + .text + .p2align 4 + .globl my_func + .type my_func, @function +my_func: + .cfi_startproc + call __x86.get_pc_thunk.ax + addl $_GLOBAL_OFFSET_TABLE_, %eax + movl my_data@GOT(%eax), %eax + ret + .cfi_endproc + .size my_func, .-my_func + .protected my_data + .globl my_data + .bss + .align 4 + .type my_data, @object + .size my_data, 4 +my_data: + .zero 4 + .section .text.__x86.get_pc_thunk.ax,"axG",@progbits,__x86.get_pc_thunk.ax,comdat + .globl __x86.get_pc_thunk.ax + .hidden __x86.get_pc_thunk.ax + .type __x86.get_pc_thunk.ax, @function +__x86.get_pc_thunk.ax: + .cfi_startproc + movl (%esp), %eax + ret + .cfi_endproc + .section .note.GNU-stack,"",@progbits diff --git a/ld/testsuite/ld-i386/pr33260.d b/ld/testsuite/ld-i386/pr33260.d new file mode 100644 index 0000000..fc05e4c --- /dev/null +++ b/ld/testsuite/ld-i386/pr33260.d @@ -0,0 +1,9 @@ +#source: pr33260.s +#as: -mrelax-relocations=yes --32 +#ld: -melf_i386 -shared +#readelf: -r --wide + +Relocation section '.rel.dyn' at offset 0x[0-9a-f]+ contains 2 entries: + +Offset +Info +Type +Sym.* Value +Symbol's Name +[0-9a-f]+ +[0-9a-f]+ +R_386_RELATIVE + +[0-9a-f]+ +[0-9a-f]+ +R_386_RELATIVE + diff --git a/ld/testsuite/ld-i386/pr33260.s b/ld/testsuite/ld-i386/pr33260.s new file mode 100644 index 0000000..9d779f2 --- /dev/null +++ b/ld/testsuite/ld-i386/pr33260.s @@ -0,0 +1,46 @@ + .text + .p2align 4 + .globl my_func + .protected my_func + .type my_func, @function +my_func: + .cfi_startproc + ret + .cfi_endproc + .size my_func, .-my_func + .p2align 4 + .globl f + .type f, @function +f: + .cfi_startproc + call __x86.get_pc_thunk.ax + addl $_GLOBAL_OFFSET_TABLE_, %eax + leal vtable@GOTOFF(%eax), %eax + ret + .cfi_endproc + .size f, .-f + .section .data.rel,"aw" + .align 4 + .type vtable, @object + .size vtable, 8 +vtable: + .long my_func + .long my_data + .protected my_data + .globl my_data + .bss + .align 4 + .type my_data, @object + .size my_data, 4 +my_data: + .zero 4 + .section .text.__x86.get_pc_thunk.ax,"axG",@progbits,__x86.get_pc_thunk.ax,comdat + .globl __x86.get_pc_thunk.ax + .hidden __x86.get_pc_thunk.ax + .type __x86.get_pc_thunk.ax, @function +__x86.get_pc_thunk.ax: + .cfi_startproc + movl (%esp), %eax + ret + .cfi_endproc + .section .note.GNU-stack,"",@progbits diff --git a/ld/testsuite/ld-i386/tlsdesc.rd b/ld/testsuite/ld-i386/tlsdesc.rd index ec418d1..ebd80b1 100644 --- a/ld/testsuite/ld-i386/tlsdesc.rd +++ b/ld/testsuite/ld-i386/tlsdesc.rd @@ -14,7 +14,6 @@ Section Headers: +\[[ 0-9]+\] \.dynsym +.* +\[[ 0-9]+\] \.dynstr +.* +\[[ 0-9]+\] \.rel.dyn +.* - +\[[ 0-9]+\] \.rel.plt +.* +\[[ 0-9]+\] \.text +.* +\[[ 0-9]+\] \.tdata +PROGBITS +[0-9a-f]+ [0-9a-f]+ 000060 00 WAT +0 +0 +1 +\[[ 0-9]+\] \.tbss +NOBITS +[0-9aa-f]+ [0-9a-f]+ 000020 00 WAT +0 +0 +1 @@ -40,12 +39,12 @@ Program Headers: Section to Segment mapping: +Segment Sections... - +00 +.hash .dynsym .dynstr .rel.dyn .rel.plt .text * + +00 +.hash .dynsym .dynstr .rel.dyn .text * +01 +.tdata .dynamic .got .got.plt * +02 +.dynamic * +03 +.tdata .tbss * -Relocation section '.rel.dyn' at offset 0x[0-9a-f]+ contains 20 entries: +Relocation section '.rel.dyn' at offset 0x[0-9a-f]+ contains 25 entries: Offset +Info +Type +Sym.Value +Sym. Name [0-9a-f ]+R_386_TLS_TPOFF32 [0-9a-f ]+R_386_TLS_TPOFF * @@ -62,71 +61,68 @@ Relocation section '.rel.dyn' at offset 0x[0-9a-f]+ contains 20 entries: [0-9a-f ]+R_386_TLS_TPOFF * [0-9a-f ]+R_386_TLS_TPOFF * [0-9a-f ]+R_386_TLS_TPOFF32 +[0-9a-f ]+R_386_TLS_DESC * +[0-9a-f ]+R_386_TLS_DESC * +[0-9a-f ]+R_386_TLS_DESC * +[0-9a-f ]+R_386_TLS_DESC * [0-9a-f ]+R_386_TLS_TPOFF +0+8 +sg3 [0-9a-f ]+R_386_TLS_TPOFF32 0+c +sg4 [0-9a-f ]+R_386_TLS_TPOFF +0+c +sg4 [0-9a-f ]+R_386_TLS_TPOFF +0+10 +sg5 [0-9a-f ]+R_386_TLS_TPOFF32 0+4 +sg2 - -Relocation section '.rel.plt' at offset 0x[0-9a-f]+ contains 5 entries: - Offset +Info +Type +Sym.Value +Sym. Name [0-9a-f ]+R_386_TLS_DESC * 0+ +sg1 -[0-9a-f ]+R_386_TLS_DESC * -[0-9a-f ]+R_386_TLS_DESC * -[0-9a-f ]+R_386_TLS_DESC * -[0-9a-f ]+R_386_TLS_DESC * Symbol table '\.dynsym' contains [0-9]+ entries: +Num: +Value +Size +Type +Bind +Vis +Ndx +Name +[0-9]+: 0+ +0 +NOTYPE +LOCAL +DEFAULT +UND * - +[0-9]+: 0+1c +0 +TLS +GLOBAL +DEFAULT +7 sg8 - +[0-9]+: 0+8 +0 +TLS +GLOBAL +DEFAULT +7 sg3 - +[0-9]+: 0+c +0 +TLS +GLOBAL +DEFAULT +7 sg4 - +[0-9]+: 0+10 +0 +TLS +GLOBAL +DEFAULT +7 sg5 - +[0-9]+: 0+ +0 +TLS +GLOBAL +DEFAULT +7 sg1 - +[0-9]+: [0-9a-f]+ +0 +FUNC +GLOBAL +DEFAULT +6 fn1 - +[0-9]+: 0+4 +0 +TLS +GLOBAL +DEFAULT +7 sg2 - +[0-9]+: 0+14 +0 +TLS +GLOBAL +DEFAULT +7 sg6 - +[0-9]+: 0+18 +0 +TLS +GLOBAL +DEFAULT +7 sg7 + +[0-9]+: 0+1c +0 +TLS +GLOBAL +DEFAULT +6 sg8 + +[0-9]+: 0+8 +0 +TLS +GLOBAL +DEFAULT +6 sg3 + +[0-9]+: 0+c +0 +TLS +GLOBAL +DEFAULT +6 sg4 + +[0-9]+: 0+10 +0 +TLS +GLOBAL +DEFAULT +6 sg5 + +[0-9]+: 0+ +0 +TLS +GLOBAL +DEFAULT +6 sg1 + +[0-9]+: [0-9a-f]+ +0 +FUNC +GLOBAL +DEFAULT +5 fn1 + +[0-9]+: 0+4 +0 +TLS +GLOBAL +DEFAULT +6 sg2 + +[0-9]+: 0+14 +0 +TLS +GLOBAL +DEFAULT +6 sg6 + +[0-9]+: 0+18 +0 +TLS +GLOBAL +DEFAULT +6 sg7 Symbol table '\.symtab' contains [0-9]+ entries: +Num: +Value +Size +Type +Bind +Vis +Ndx +Name +[0-9]+: 0+ +0 +NOTYPE +LOCAL +DEFAULT +UND * .* FILE +LOCAL +DEFAULT +ABS .*tlsdesc.o - +[0-9]+: 0+20 +0 +TLS +LOCAL +DEFAULT +7 sl1 - +[0-9]+: 0+24 +0 +TLS +LOCAL +DEFAULT +7 sl2 - +[0-9]+: 0+28 +0 +TLS +LOCAL +DEFAULT +7 sl3 - +[0-9]+: 0+2c +0 +TLS +LOCAL +DEFAULT +7 sl4 - +[0-9]+: 0+30 +0 +TLS +LOCAL +DEFAULT +7 sl5 - +[0-9]+: 0+34 +0 +TLS +LOCAL +DEFAULT +7 sl6 - +[0-9]+: 0+38 +0 +TLS +LOCAL +DEFAULT +7 sl7 - +[0-9]+: 0+3c +0 +TLS +LOCAL +DEFAULT +7 sl8 + +[0-9]+: 0+20 +0 +TLS +LOCAL +DEFAULT +6 sl1 + +[0-9]+: 0+24 +0 +TLS +LOCAL +DEFAULT +6 sl2 + +[0-9]+: 0+28 +0 +TLS +LOCAL +DEFAULT +6 sl3 + +[0-9]+: 0+2c +0 +TLS +LOCAL +DEFAULT +6 sl4 + +[0-9]+: 0+30 +0 +TLS +LOCAL +DEFAULT +6 sl5 + +[0-9]+: 0+34 +0 +TLS +LOCAL +DEFAULT +6 sl6 + +[0-9]+: 0+38 +0 +TLS +LOCAL +DEFAULT +6 sl7 + +[0-9]+: 0+3c +0 +TLS +LOCAL +DEFAULT +6 sl8 .* FILE +LOCAL +DEFAULT +ABS - +[0-9]+: 0+60 +0 +TLS +LOCAL +DEFAULT +8 sH1 - +[0-9]+: 0+ +0 +TLS +LOCAL +DEFAULT +7 _TLS_MODULE_BASE_ - +[0-9]+: [0-9a-f]+ +0 +OBJECT +LOCAL +DEFAULT +9 _DYNAMIC - +[0-9]+: 0+48 +0 +TLS +LOCAL +DEFAULT +7 sh3 - +[0-9]+: 0+64 +0 +TLS +LOCAL +DEFAULT +8 sH2 - +[0-9]+: 0+78 +0 +TLS +LOCAL +DEFAULT +8 sH7 - +[0-9]+: 0+58 +0 +TLS +LOCAL +DEFAULT +7 sh7 - +[0-9]+: 0+5c +0 +TLS +LOCAL +DEFAULT +7 sh8 - +[0-9]+: 0+6c +0 +TLS +LOCAL +DEFAULT +8 sH4 - +[0-9]+: 0+4c +0 +TLS +LOCAL +DEFAULT +7 sh4 - +[0-9]+: 0+68 +0 +TLS +LOCAL +DEFAULT +8 sH3 - +[0-9]+: 0+50 +0 +TLS +LOCAL +DEFAULT +7 sh5 - +[0-9]+: 0+70 +0 +TLS +LOCAL +DEFAULT +8 sH5 - +[0-9]+: 0+74 +0 +TLS +LOCAL +DEFAULT +8 sH6 - +[0-9]+: 0+7c +0 +TLS +LOCAL +DEFAULT +8 sH8 - +[0-9]+: 0+40 +0 +TLS +LOCAL +DEFAULT +7 sh1 - +[0-9]+: [0-9a-f]+ +0 +OBJECT +LOCAL +DEFAULT +11 _GLOBAL_OFFSET_TABLE_ - +[0-9]+: 0+44 +0 +TLS +LOCAL +DEFAULT +7 sh2 - +[0-9]+: 0+54 +0 +TLS +LOCAL +DEFAULT +7 sh6 - +[0-9]+: 0+1c +0 +TLS +GLOBAL +DEFAULT +7 sg8 - +[0-9]+: 0+8 +0 +TLS +GLOBAL +DEFAULT +7 sg3 - +[0-9]+: 0+c +0 +TLS +GLOBAL +DEFAULT +7 sg4 - +[0-9]+: 0+10 +0 +TLS +GLOBAL +DEFAULT +7 sg5 - +[0-9]+: 0+ +0 +TLS +GLOBAL +DEFAULT +7 sg1 - +[0-9]+: [0-9a-f]+ +0 +FUNC +GLOBAL +DEFAULT +6 fn1 - +[0-9]+: 0+4 +0 +TLS +GLOBAL +DEFAULT +7 sg2 - +[0-9]+: 0+14 +0 +TLS +GLOBAL +DEFAULT +7 sg6 - +[0-9]+: 0+18 +0 +TLS +GLOBAL +DEFAULT +7 sg7 + +[0-9]+: 0+60 +0 +TLS +LOCAL +DEFAULT +7 sH1 + +[0-9]+: 0+ +0 +TLS +LOCAL +DEFAULT +6 _TLS_MODULE_BASE_ + +[0-9]+: [0-9a-f]+ +0 +OBJECT +LOCAL +DEFAULT +8 _DYNAMIC + +[0-9]+: 0+48 +0 +TLS +LOCAL +DEFAULT +6 sh3 + +[0-9]+: 0+64 +0 +TLS +LOCAL +DEFAULT +7 sH2 + +[0-9]+: 0+78 +0 +TLS +LOCAL +DEFAULT +7 sH7 + +[0-9]+: 0+58 +0 +TLS +LOCAL +DEFAULT +6 sh7 + +[0-9]+: 0+5c +0 +TLS +LOCAL +DEFAULT +6 sh8 + +[0-9]+: 0+6c +0 +TLS +LOCAL +DEFAULT +7 sH4 + +[0-9]+: 0+4c +0 +TLS +LOCAL +DEFAULT +6 sh4 + +[0-9]+: 0+68 +0 +TLS +LOCAL +DEFAULT +7 sH3 + +[0-9]+: 0+50 +0 +TLS +LOCAL +DEFAULT +6 sh5 + +[0-9]+: 0+70 +0 +TLS +LOCAL +DEFAULT +7 sH5 + +[0-9]+: 0+74 +0 +TLS +LOCAL +DEFAULT +7 sH6 + +[0-9]+: 0+7c +0 +TLS +LOCAL +DEFAULT +7 sH8 + +[0-9]+: 0+40 +0 +TLS +LOCAL +DEFAULT +6 sh1 + +[0-9]+: [0-9a-f]+ +0 +OBJECT +LOCAL +DEFAULT +10 _GLOBAL_OFFSET_TABLE_ + +[0-9]+: 0+44 +0 +TLS +LOCAL +DEFAULT +6 sh2 + +[0-9]+: 0+54 +0 +TLS +LOCAL +DEFAULT +6 sh6 + +[0-9]+: 0+1c +0 +TLS +GLOBAL +DEFAULT +6 sg8 + +[0-9]+: 0+8 +0 +TLS +GLOBAL +DEFAULT +6 sg3 + +[0-9]+: 0+c +0 +TLS +GLOBAL +DEFAULT +6 sg4 + +[0-9]+: 0+10 +0 +TLS +GLOBAL +DEFAULT +6 sg5 + +[0-9]+: 0+ +0 +TLS +GLOBAL +DEFAULT +6 sg1 + +[0-9]+: [0-9a-f]+ +0 +FUNC +GLOBAL +DEFAULT +5 fn1 + +[0-9]+: 0+4 +0 +TLS +GLOBAL +DEFAULT +6 sg2 + +[0-9]+: 0+14 +0 +TLS +GLOBAL +DEFAULT +6 sg6 + +[0-9]+: 0+18 +0 +TLS +GLOBAL +DEFAULT +6 sg7 diff --git a/ld/testsuite/ld-i386/tlsdesc2.d b/ld/testsuite/ld-i386/tlsdesc2.d index b8569e8..c37557a 100644 --- a/ld/testsuite/ld-i386/tlsdesc2.d +++ b/ld/testsuite/ld-i386/tlsdesc2.d @@ -3,8 +3,9 @@ #ld: -melf_i386 -shared -z now #readelf: -d --wide +#failif #... .*\(PLTRELSZ\).* .*\(PLTREL\).* .*\(JMPREL\).* -#pass +#... diff --git a/ld/testsuite/ld-i386/tlsgdesc.rd b/ld/testsuite/ld-i386/tlsgdesc.rd index 0744aeb..a129bf6 100644 --- a/ld/testsuite/ld-i386/tlsgdesc.rd +++ b/ld/testsuite/ld-i386/tlsgdesc.rd @@ -41,22 +41,22 @@ Program Headers: +01 +.dynamic .got .got.plt * +02 +.dynamic * -Relocation section '.rel.dyn' at offset 0x[0-9a-f]+ contains 8 entries: +Relocation section '.rel.dyn' at offset 0x[0-9a-f]+ contains 10 entries: Offset +Info +Type +Sym.Value +Sym. Name [0-9a-f ]+R_386_TLS_TPOFF32 0+ +sG3 [0-9a-f ]+R_386_TLS_TPOFF +0+ +sG5 [0-9a-f ]+R_386_TLS_DTPMOD3 0+ +sG2 [0-9a-f ]+R_386_TLS_DTPOFF3 0+ +sG2 +[0-9a-f ]+R_386_TLS_DESC +0+ +sG2 [0-9a-f ]+R_386_TLS_TPOFF +0+ +sG4 [0-9a-f ]+R_386_TLS_TPOFF32 0+ +sG6 [0-9a-f ]+R_386_TLS_DTPMOD3 0+ +sG1 [0-9a-f ]+R_386_TLS_DTPOFF3 0+ +sG1 +[0-9a-f ]+R_386_TLS_DESC +0+ +sG1 -Relocation section '.rel.plt' at offset 0x[0-9a-f]+ contains 3 entries: +Relocation section '.rel.plt' at offset 0x[0-9a-f]+ contains 1 entry: Offset +Info +Type +Sym.Value +Sym. Name [0-9a-f ]+R_386_JUMP_SLOT +0+ +___tls_get_addr -[0-9a-f ]+R_386_TLS_DESC +0+ +sG1 -[0-9a-f ]+R_386_TLS_DESC +0+ +sG2 Symbol table '\.dynsym' contains [0-9]+ entries: +Num: +Value +Size +Type +Bind +Vis +Ndx +Name diff --git a/ld/testsuite/ld-ifunc/ifunc.exp b/ld/testsuite/ld-ifunc/ifunc.exp index e8b93b3..07a8a2f 100644 --- a/ld/testsuite/ld-ifunc/ifunc.exp +++ b/ld/testsuite/ld-ifunc/ifunc.exp @@ -54,6 +54,13 @@ if ![check_shared_lib_support] { return } +set need_direct_extern_access "" +if { [istarget i?86-*-linux*] + || [istarget i?86-*-gnu*] } then { + # These targets need direct extern access in some tests. + set need_direct_extern_access "$DIRECT_EXTERN_ACCESS_CFLAGS" +} + set saved_ASFLAGS "$ASFLAGS" if { [istarget "i?86-*-*"] || [istarget "x86_64-*-*"] } { set ASFLAGS "$ASFLAGS -mx86-used-note=no" @@ -497,6 +504,7 @@ if { [check_ifunc_available] } { { ifunc-main.c } \ "ifunc-main" \ "ifunc-main.out" \ + "$need_direct_extern_access" \ ] \ [list \ "Run ifunc-main with -fpic" \ @@ -514,6 +522,7 @@ if { [check_ifunc_available] } { { ifunc-main.c } \ "ifunc-mainn" \ "ifunc-main.out" \ + "$need_direct_extern_access" \ ] \ [list \ "Run ifunc-main with PIE (-z now)" \ diff --git a/ld/testsuite/ld-loongarch-elf/32_pcrel.s b/ld/testsuite/ld-loongarch-elf/32_pcrel.s new file mode 100644 index 0000000..3ef16de --- /dev/null +++ b/ld/testsuite/ld-loongarch-elf/32_pcrel.s @@ -0,0 +1,6 @@ + .section sx,"a" +x: + nop + + .section sy,"a" + .4byte x-. diff --git a/ld/testsuite/ld-loongarch-elf/ld-loongarch-elf.exp b/ld/testsuite/ld-loongarch-elf/ld-loongarch-elf.exp index 0295be8..5bc48b2 100644 --- a/ld/testsuite/ld-loongarch-elf/ld-loongarch-elf.exp +++ b/ld/testsuite/ld-loongarch-elf/ld-loongarch-elf.exp @@ -45,8 +45,11 @@ if [istarget "loongarch64-*-*"] { run_dump_test "underflow_s_5_20" run_dump_test "tls-le-norelax" run_dump_test "tls-le-relax" + run_dump_test "relax-after-alignment" run_dump_test "relax-medium-call" run_dump_test "relax-medium-call-1" + run_dump_test "relax-sym-size-1" + run_dump_test "relax-sym-size-2" run_dump_test "check_got_relax" } @@ -169,6 +172,18 @@ if [istarget "loongarch64-*-*"] { "desc-ie-norelax" \ ] \ ] \ + + run_ld_link_tests \ + [list \ + [list \ + "undefind weak with tls le" \ + "" "-e0" \ + "" \ + {undefweak_le.s} \ + {} \ + "undefweak_le" \ + ] \ + ] } if [istarget "loongarch64-*-*"] { @@ -200,6 +215,8 @@ if [istarget "loongarch64-*-*"] { run_dump_test "bad_pcrel20_s2_global" run_dump_test "bad_pcrel20_s2_weak" run_dump_test "weak-undef-hidden-shared" + run_dump_test "overflow_32_pcrel" + run_dump_test "underflow_32_pcrel" } if [check_pie_support] { diff --git a/ld/testsuite/ld-loongarch-elf/overflow_32_pcrel.d b/ld/testsuite/ld-loongarch-elf/overflow_32_pcrel.d new file mode 100644 index 0000000..154dac9 --- /dev/null +++ b/ld/testsuite/ld-loongarch-elf/overflow_32_pcrel.d @@ -0,0 +1,4 @@ +#source: 32_pcrel.s +#as: -mthin-add-sub +#ld: -shared --section-start=sx=0x80001000 --section-start=sy=0x1000 +#error: .*relocation truncated to fit: R_LARCH_32_PCREL against `x' diff --git a/ld/testsuite/ld-loongarch-elf/pic.exp b/ld/testsuite/ld-loongarch-elf/pic.exp index e449a33..510c3fd 100644 --- a/ld/testsuite/ld-loongarch-elf/pic.exp +++ b/ld/testsuite/ld-loongarch-elf/pic.exp @@ -115,31 +115,33 @@ run_ld_link_tests $link_tests set link_tests_libc [list \ [list \ "$testname readelf -s/-r nopic-global-so" \ - "-L./tmpdir -lnopic-global -L/usr/lib -lc" "" \ + "-Wl,--no-as-needed" "" \ {nopic-global.s} \ {{readelf {-s} nopic-global-so.sd} \ {readelf {-r} nopic-global-so.rd}} \ "nopic-global-so" \ + "" "-L./tmpdir -lnopic-global" \ ] \ [list \ "$testname readelf -s/-x nopic-weak-global-so" \ - "-L./tmpdir -lnopic-global -L/usr/lib -lc" "" \ + "-Wl,--no-as-needed" "" \ {nopic-weak-global.s} \ {{readelf {-s} nopic-weak-global-so.sd} \ {readelf {-r} nopic-weak-global-so.rd}} \ "nopic-weak-global-so" \ + "" "-L./tmpdir -lnopic-global" \ ] \ ] # 0:name -# 1:ld/ar leading options, placed before object files -# 2:ld/ar trailing options, placed after object files -# 3:assembler options -# 4:filenames of assembler files -# 5:list of actions, options and expected outputs. -# 6:name of output file -# 7:compiler flags (optional) +# 1:leading ld or ar options +# 2:compile options +# 3:filenames of source files +# 4:action and options. +# 5:name of output file +# 6:language (optional) +# 7:trailing ld options (optional), placed after object files run_cc_link_tests $link_tests_libc @@ -170,10 +172,11 @@ set link_exec_tests [list \ ] \ [list \ "$testname" \ - "-L./tmpdir -lnopic-global -lc -Wl,-rpath=./tmpdir -no-pie" "" \ + "-Wl,--no-as-needed" "" \ { nopic-global.s } \ "nopic-global-so" \ - "nopic-global.out" \ + "nopic-global.out" "" "" "" \ + "-L./tmpdir -lnopic-global -lc -Wl,-rpath=./tmpdir -no-pie" \ ] \ [list \ "$testname" \ @@ -184,10 +187,11 @@ set link_exec_tests [list \ ] \ [list \ "$testname" \ - "-L./tmpdir -lnopic-global -lc -Wl,-rpath=./tmpdir -no-pie" "" \ + "-Wl,--no-as-needed" "" \ { nopic-weak-global.s } \ "nopic-weak-global-so" \ - "nopic-weak-global.out" \ + "nopic-weak-global.out" "" "" "" \ + "-L./tmpdir -lnopic-global -lc -Wl,-rpath=./tmpdir -no-pie" \ ] \ ] diff --git a/ld/testsuite/ld-loongarch-elf/relax-after-alignment.d b/ld/testsuite/ld-loongarch-elf/relax-after-alignment.d new file mode 100644 index 0000000..08def25 --- /dev/null +++ b/ld/testsuite/ld-loongarch-elf/relax-after-alignment.d @@ -0,0 +1,31 @@ +#name: additional relaxation chances after alignment processing +#as: +#ld: --defsym _start=0 +#objdump: -d --no-show-raw-insn +#xfail: *-*-* + +.*:\s+file format .* + + +Disassembly of section \.text: + +0000000120000400 <before>: +\s*120000400:\s+pcalau12i\s+\$t0, 512 +\s*[0-9a-f]+:\s+addi\.d\s+\$t0, \$t0, 1024 +\s*[0-9a-f]+:\s+pcaddi\s+\$t0, 524286 +\s*[0-9a-f]+:\s+nop\s* +\s*\.\.\. +\s*120000c00:\s+pcaddi\s+\$t0, 523776 +\s*\.\.\. + +0000000120200400 <target>: +\s*120200400:\s+break\s+0x0 + +0000000120200404 <after>: +\s*\.\.\. +\s*1203ffbfc:\s+pcaddi\s+\$t0, -523775 +\s*\.\.\. +\s*120400400:\s+pcaddi\s+\$t0, -524288 +\s*[0-9a-f]+:\s+nop\s* +\s*[0-9a-f]+:\s+pcalau12i\s+\$t0, -512 +\s*[0-9a-f]+:\s+addi\.d\s+\$t0, \$t0, 1024 diff --git a/ld/testsuite/ld-loongarch-elf/relax-after-alignment.s b/ld/testsuite/ld-loongarch-elf/relax-after-alignment.s new file mode 100644 index 0000000..24d29ec --- /dev/null +++ b/ld/testsuite/ld-loongarch-elf/relax-after-alignment.s @@ -0,0 +1,49 @@ +# 0x0 pre-relax, 0x400 post-relax +# all addresses are additionally offset by 0x120000000 without `ld -shared` +before: + la.pcrel $t0, target # too far; should stay as pcalau12i + addi.d + la.pcrel $t0, target # furthest reach of relax pass 2 + +# 0x10 pre-relax, 0x410 post-relax +.rept 508 +.word 0 +.endr + +# 0x800 {pre,post}-relax +# 255 nops + R_LARCH_ALIGN before relaxation +# none of the aligning nops should remain after relax pass 1 +.p2align 10 + +# 0xbfc pre-relax, 0xc00 post-relax + la.pcrel $t0, target # should become single pcaddi in relax pass 0 + +# 0xc04 {pre,post}-relax +.rept 523775 +.word 0 +.endr + +# 0x200400 {pre,post}-relax +target: + break 0 + +# 0x200404 {pre,post}-relax +after: +.rept 523774 +.word 0 +.endr + +# 0x3ffbfc {pre,post}-relax + la.pcrel $t0, target # should become single pcaddi in relax pass 0 + +# 255 nops + R_LARCH_ALIGN before relaxation +# none of the aligning nops should remain after relax pass 1 +.p2align 10 + +# 0x400000 pre-relax, 0x3ffc00 post-relax +.rept 512 +.word 0 +.endr + +# 0x400800 pre-relax, 0x400400 post-relax + la.pcrel $t0, target # furthest reach of relax pass 2 + la.pcrel $t0, target # too far; should stay as pcalau12i + addi.d diff --git a/ld/testsuite/ld-loongarch-elf/relax-sym-size-1.d b/ld/testsuite/ld-loongarch-elf/relax-sym-size-1.d new file mode 100644 index 0000000..eec989f --- /dev/null +++ b/ld/testsuite/ld-loongarch-elf/relax-sym-size-1.d @@ -0,0 +1,7 @@ +#source: relax-sym-size-1.s +#ld: +#readelf: -s + +#... + *[0-9]+: [0-9a-z]+ +8 .* _start +#... diff --git a/ld/testsuite/ld-loongarch-elf/relax-sym-size-1.s b/ld/testsuite/ld-loongarch-elf/relax-sym-size-1.s new file mode 100644 index 0000000..c70ac71 --- /dev/null +++ b/ld/testsuite/ld-loongarch-elf/relax-sym-size-1.s @@ -0,0 +1,8 @@ +.p2align 2 +bar: + nop +.globl _start +_start: + la.pcrel $a0, bar + ret +.size _start, . - _start diff --git a/ld/testsuite/ld-loongarch-elf/relax-sym-size-2.d b/ld/testsuite/ld-loongarch-elf/relax-sym-size-2.d new file mode 100644 index 0000000..1388099 --- /dev/null +++ b/ld/testsuite/ld-loongarch-elf/relax-sym-size-2.d @@ -0,0 +1,7 @@ +#source: relax-sym-size-2.s +#ld: +#readelf: -s + +#... + *[0-9]+: [0-9a-z]+ +64 .* _start +#... diff --git a/ld/testsuite/ld-loongarch-elf/relax-sym-size-2.s b/ld/testsuite/ld-loongarch-elf/relax-sym-size-2.s new file mode 100644 index 0000000..e02e16b --- /dev/null +++ b/ld/testsuite/ld-loongarch-elf/relax-sym-size-2.s @@ -0,0 +1,19 @@ +bar: + nop +.p2align 6 + +.reloc ., R_LARCH_ALIGN, 60 +.rept 15 + 1: nop +.endr + la.pcrel $a0, bar + ret + +.reloc ., R_LARCH_ALIGN, 60 +.rept 15 + 2: nop +.endr + +.globl _start +.set _start, 1b +.size _start, 2b - 1b diff --git a/ld/testsuite/ld-loongarch-elf/undefweak_le.s b/ld/testsuite/ld-loongarch-elf/undefweak_le.s new file mode 100644 index 0000000..6e73018 --- /dev/null +++ b/ld/testsuite/ld-loongarch-elf/undefweak_le.s @@ -0,0 +1,7 @@ +_start: + lu12i.w $t0,%le_hi20_r(undefweak_le) + add.d $t0,$t0,$tp,%le_add_r(undefweak_le) + ld.d $t0,$t0,%le_lo12_r(undefweak_le) + + .weak undefweak_le + .hidden undefweak_le diff --git a/ld/testsuite/ld-loongarch-elf/underflow_32_pcrel.d b/ld/testsuite/ld-loongarch-elf/underflow_32_pcrel.d new file mode 100644 index 0000000..a5396bc --- /dev/null +++ b/ld/testsuite/ld-loongarch-elf/underflow_32_pcrel.d @@ -0,0 +1,4 @@ +#source: 32_pcrel.s +#as: -mthin-add-sub +#ld: -shared --section-start=sx=0x1000 --section-start=sy=0x80001001 +#error: .*relocation truncated to fit: R_LARCH_32_PCREL against `x' diff --git a/ld/testsuite/ld-mips-elf/micromips-hilo-n64.d b/ld/testsuite/ld-mips-elf/micromips-hilo-n64.d new file mode 100644 index 0000000..b3d34a1 --- /dev/null +++ b/ld/testsuite/ld-mips-elf/micromips-hilo-n64.d @@ -0,0 +1,662 @@ +#name: R_MICROMIPS_HI16 and R_MICROMIPS_LO16 relocs (n64) +#source: ../../../gas/testsuite/gas/mips/mips-hilo-n64.s +#source: mips-hilo.s +#as: -mmicromips -march=mips64r2 +#objdump: -d +#ld: -Tmips-hilo.ld -e 0x500000 -N +#notarget: mips*el-ps2-elf* + +.*: file format (:?elf.*mips.*|srec) + +Disassembly of section \.(:?text|sec1): + +0*500000 <[^>]*>: + *500000: 41a1 0000 lui at,0x0 + *500004: 41a4 0000 lui a0,0x0 + *500008: 3021 0000 addiu at,at,0 + *50000c: 3084 0000 addiu a0,a0,0 + *500010: 5821 0008 dsll32 at,at,0x0 + *500014: 5824 2150 daddu a0,a0,at + *500018: 41a1 0000 lui at,0x0 + *50001c: 41a4 0065 lui a0,0x65 + *500020: 3021 0000 addiu at,at,0 + *500024: 3084 4320 addiu a0,a0,17184 + *500028: 5821 0008 dsll32 at,at,0x0 + *50002c: 5824 2150 daddu a0,a0,at + *500030: 41a1 0000 lui at,0x0 + *500034: 41a4 0065 lui a0,0x65 + *500038: 3021 0000 addiu at,at,0 + *50003c: 3084 4324 addiu a0,a0,17188 + *500040: 5821 0008 dsll32 at,at,0x0 + *500044: 5824 2150 daddu a0,a0,at + *500048: 41a1 0000 lui at,0x0 + *50004c: 41a4 0065 lui a0,0x65 + *500050: 3021 0000 addiu at,at,0 + *500054: 3084 4330 addiu a0,a0,17200 + *500058: 5821 0008 dsll32 at,at,0x0 + *50005c: 5824 2150 daddu a0,a0,at + *500060: 41a1 0000 lui at,0x0 + *500064: 41a4 0065 lui a0,0x65 + *500068: 3021 0000 addiu at,at,0 + *50006c: 3084 4720 addiu a0,a0,18208 + *500070: 5821 0008 dsll32 at,at,0x0 + *500074: 5824 2150 daddu a0,a0,at + *500078: 41a1 0000 lui at,0x0 + *50007c: 41a4 0076 lui a0,0x76 + *500080: 3021 0000 addiu at,at,0 + *500084: 3084 5820 addiu a0,a0,22560 + *500088: 5821 0008 dsll32 at,at,0x0 + *50008c: 5824 2150 daddu a0,a0,at + *500090: 41a1 0000 lui at,0x0 + *500094: 41a4 0076 lui a0,0x76 + *500098: 3021 0000 addiu at,at,0 + *50009c: 3084 5c08 addiu a0,a0,23560 + *5000a0: 5821 0008 dsll32 at,at,0x0 + *5000a4: 5824 2150 daddu a0,a0,at + *5000a8: 41a1 0000 lui at,0x0 + *5000ac: 41a4 0076 lui a0,0x76 + *5000b0: 3021 0000 addiu at,at,0 + *5000b4: 3084 5430 addiu a0,a0,21552 + *5000b8: 5821 0008 dsll32 at,at,0x0 + *5000bc: 5824 2150 daddu a0,a0,at + *5000c0: 41a1 0000 lui at,0x0 + *5000c4: 41a4 0076 lui a0,0x76 + *5000c8: 3021 0000 addiu at,at,0 + *5000cc: 3084 5c09 addiu a0,a0,23561 + *5000d0: 5821 0008 dsll32 at,at,0x0 + *5000d4: 5824 2150 daddu a0,a0,at + *5000d8: 41a1 0000 lui at,0x0 + *5000dc: 41a4 0000 lui a0,0x0 + *5000e0: 3021 0000 addiu at,at,0 + *5000e4: 3084 0001 addiu a0,a0,1 + *5000e8: 5821 0008 dsll32 at,at,0x0 + *5000ec: 5824 2150 daddu a0,a0,at + *5000f0: 41a1 0000 lui at,0x0 + *5000f4: 41a4 0065 lui a0,0x65 + *5000f8: 3021 0000 addiu at,at,0 + *5000fc: 3084 4321 addiu a0,a0,17185 + *500100: 5821 0008 dsll32 at,at,0x0 + *500104: 5824 2150 daddu a0,a0,at + *500108: 41a1 0000 lui at,0x0 + *50010c: 41a4 0065 lui a0,0x65 + *500110: 3021 0000 addiu at,at,0 + *500114: 3084 4325 addiu a0,a0,17189 + *500118: 5821 0008 dsll32 at,at,0x0 + *50011c: 5824 2150 daddu a0,a0,at + *500120: 41a1 0000 lui at,0x0 + *500124: 41a4 0065 lui a0,0x65 + *500128: 3021 0000 addiu at,at,0 + *50012c: 3084 4331 addiu a0,a0,17201 + *500130: 5821 0008 dsll32 at,at,0x0 + *500134: 5824 2150 daddu a0,a0,at + *500138: 41a1 0000 lui at,0x0 + *50013c: 41a4 0065 lui a0,0x65 + *500140: 3021 0000 addiu at,at,0 + *500144: 3084 4721 addiu a0,a0,18209 + *500148: 5821 0008 dsll32 at,at,0x0 + *50014c: 5824 2150 daddu a0,a0,at + *500150: 41a1 0000 lui at,0x0 + *500154: 41a4 0076 lui a0,0x76 + *500158: 3021 0000 addiu at,at,0 + *50015c: 3084 5821 addiu a0,a0,22561 + *500160: 5821 0008 dsll32 at,at,0x0 + *500164: 5824 2150 daddu a0,a0,at + *500168: 41a1 0000 lui at,0x0 + *50016c: 41a4 0076 lui a0,0x76 + *500170: 3021 0000 addiu at,at,0 + *500174: 3084 5c09 addiu a0,a0,23561 + *500178: 5821 0008 dsll32 at,at,0x0 + *50017c: 5824 2150 daddu a0,a0,at + *500180: 41a1 0000 lui at,0x0 + *500184: 41a4 0076 lui a0,0x76 + *500188: 3021 0000 addiu at,at,0 + *50018c: 3084 5431 addiu a0,a0,21553 + *500190: 5821 0008 dsll32 at,at,0x0 + *500194: 5824 2150 daddu a0,a0,at + *500198: 41a1 0000 lui at,0x0 + *50019c: 41a4 0076 lui a0,0x76 + *5001a0: 3021 0000 addiu at,at,0 + *5001a4: 3084 5c0a addiu a0,a0,23562 + *5001a8: 5821 0008 dsll32 at,at,0x0 + *5001ac: 5824 2150 daddu a0,a0,at + *5001b0: 41a1 0001 lui at,0x1 + *5001b4: 41a4 8001 lui a0,0x8001 + *5001b8: 3021 8001 addiu at,at,-32767 + *5001bc: 3084 8000 addiu a0,a0,-32768 + *5001c0: 5821 0008 dsll32 at,at,0x0 + *5001c4: 5824 2150 daddu a0,a0,at + *5001c8: 41a1 0001 lui at,0x1 + *5001cc: 41a4 8066 lui a0,0x8066 + *5001d0: 3021 8001 addiu at,at,-32767 + *5001d4: 3084 c320 addiu a0,a0,-15584 + *5001d8: 5821 0008 dsll32 at,at,0x0 + *5001dc: 5824 2150 daddu a0,a0,at + *5001e0: 41a1 0001 lui at,0x1 + *5001e4: 41a4 8066 lui a0,0x8066 + *5001e8: 3021 8001 addiu at,at,-32767 + *5001ec: 3084 c324 addiu a0,a0,-15580 + *5001f0: 5821 0008 dsll32 at,at,0x0 + *5001f4: 5824 2150 daddu a0,a0,at + *5001f8: 41a1 0001 lui at,0x1 + *5001fc: 41a4 8066 lui a0,0x8066 + *500200: 3021 8001 addiu at,at,-32767 + *500204: 3084 c330 addiu a0,a0,-15568 + *500208: 5821 0008 dsll32 at,at,0x0 + *50020c: 5824 2150 daddu a0,a0,at + *500210: 41a1 0001 lui at,0x1 + *500214: 41a4 8066 lui a0,0x8066 + *500218: 3021 8001 addiu at,at,-32767 + *50021c: 3084 c720 addiu a0,a0,-14560 + *500220: 5821 0008 dsll32 at,at,0x0 + *500224: 5824 2150 daddu a0,a0,at + *500228: 41a1 0001 lui at,0x1 + *50022c: 41a4 8077 lui a0,0x8077 + *500230: 3021 8001 addiu at,at,-32767 + *500234: 3084 d820 addiu a0,a0,-10208 + *500238: 5821 0008 dsll32 at,at,0x0 + *50023c: 5824 2150 daddu a0,a0,at + *500240: 41a1 0001 lui at,0x1 + *500244: 41a4 8077 lui a0,0x8077 + *500248: 3021 8001 addiu at,at,-32767 + *50024c: 3084 dc08 addiu a0,a0,-9208 + *500250: 5821 0008 dsll32 at,at,0x0 + *500254: 5824 2150 daddu a0,a0,at + *500258: 41a1 0001 lui at,0x1 + *50025c: 41a4 8077 lui a0,0x8077 + *500260: 3021 8001 addiu at,at,-32767 + *500264: 3084 d430 addiu a0,a0,-11216 + *500268: 5821 0008 dsll32 at,at,0x0 + *50026c: 5824 2150 daddu a0,a0,at + *500270: 41a1 0001 lui at,0x1 + *500274: 41a4 8077 lui a0,0x8077 + *500278: 3021 8001 addiu at,at,-32767 + *50027c: 3084 dc09 addiu a0,a0,-9207 + *500280: 5821 0008 dsll32 at,at,0x0 + *500284: 5824 2150 daddu a0,a0,at + *500288: 41a1 0000 lui at,0x0 + *50028c: 41a4 8000 lui a0,0x8000 + *500290: 3021 8000 addiu at,at,-32768 + *500294: 3084 8000 addiu a0,a0,-32768 + *500298: 5821 0008 dsll32 at,at,0x0 + *50029c: 5824 2150 daddu a0,a0,at + *5002a0: 41a1 0000 lui at,0x0 + *5002a4: 41a4 8065 lui a0,0x8065 + *5002a8: 3021 8000 addiu at,at,-32768 + *5002ac: 3084 c320 addiu a0,a0,-15584 + *5002b0: 5821 0008 dsll32 at,at,0x0 + *5002b4: 5824 2150 daddu a0,a0,at + *5002b8: 41a1 0000 lui at,0x0 + *5002bc: 41a4 8065 lui a0,0x8065 + *5002c0: 3021 8000 addiu at,at,-32768 + *5002c4: 3084 c324 addiu a0,a0,-15580 + *5002c8: 5821 0008 dsll32 at,at,0x0 + *5002cc: 5824 2150 daddu a0,a0,at + *5002d0: 41a1 0000 lui at,0x0 + *5002d4: 41a4 8065 lui a0,0x8065 + *5002d8: 3021 8000 addiu at,at,-32768 + *5002dc: 3084 c330 addiu a0,a0,-15568 + *5002e0: 5821 0008 dsll32 at,at,0x0 + *5002e4: 5824 2150 daddu a0,a0,at + *5002e8: 41a1 0000 lui at,0x0 + *5002ec: 41a4 8065 lui a0,0x8065 + *5002f0: 3021 8000 addiu at,at,-32768 + *5002f4: 3084 c720 addiu a0,a0,-14560 + *5002f8: 5821 0008 dsll32 at,at,0x0 + *5002fc: 5824 2150 daddu a0,a0,at + *500300: 41a1 0000 lui at,0x0 + *500304: 41a4 8076 lui a0,0x8076 + *500308: 3021 8000 addiu at,at,-32768 + *50030c: 3084 d820 addiu a0,a0,-10208 + *500310: 5821 0008 dsll32 at,at,0x0 + *500314: 5824 2150 daddu a0,a0,at + *500318: 41a1 0000 lui at,0x0 + *50031c: 41a4 8076 lui a0,0x8076 + *500320: 3021 8000 addiu at,at,-32768 + *500324: 3084 dc08 addiu a0,a0,-9208 + *500328: 5821 0008 dsll32 at,at,0x0 + *50032c: 5824 2150 daddu a0,a0,at + *500330: 41a1 0000 lui at,0x0 + *500334: 41a4 8076 lui a0,0x8076 + *500338: 3021 8000 addiu at,at,-32768 + *50033c: 3084 d430 addiu a0,a0,-11216 + *500340: 5821 0008 dsll32 at,at,0x0 + *500344: 5824 2150 daddu a0,a0,at + *500348: 41a1 0000 lui at,0x0 + *50034c: 41a4 8076 lui a0,0x8076 + *500350: 3021 8000 addiu at,at,-32768 + *500354: 3084 dc09 addiu a0,a0,-9207 + *500358: 5821 0008 dsll32 at,at,0x0 + *50035c: 5824 2150 daddu a0,a0,at + *500360: 41a1 0001 lui at,0x1 + *500364: 41a4 0001 lui a0,0x1 + *500368: 3021 0001 addiu at,at,1 + *50036c: 3084 0000 addiu a0,a0,0 + *500370: 5821 0008 dsll32 at,at,0x0 + *500374: 5824 2150 daddu a0,a0,at + *500378: 41a1 0001 lui at,0x1 + *50037c: 41a4 0066 lui a0,0x66 + *500380: 3021 0001 addiu at,at,1 + *500384: 3084 4320 addiu a0,a0,17184 + *500388: 5821 0008 dsll32 at,at,0x0 + *50038c: 5824 2150 daddu a0,a0,at + *500390: 41a1 0001 lui at,0x1 + *500394: 41a4 0066 lui a0,0x66 + *500398: 3021 0001 addiu at,at,1 + *50039c: 3084 4324 addiu a0,a0,17188 + *5003a0: 5821 0008 dsll32 at,at,0x0 + *5003a4: 5824 2150 daddu a0,a0,at + *5003a8: 41a1 0001 lui at,0x1 + *5003ac: 41a4 0066 lui a0,0x66 + *5003b0: 3021 0001 addiu at,at,1 + *5003b4: 3084 4330 addiu a0,a0,17200 + *5003b8: 5821 0008 dsll32 at,at,0x0 + *5003bc: 5824 2150 daddu a0,a0,at + *5003c0: 41a1 0001 lui at,0x1 + *5003c4: 41a4 0066 lui a0,0x66 + *5003c8: 3021 0001 addiu at,at,1 + *5003cc: 3084 4720 addiu a0,a0,18208 + *5003d0: 5821 0008 dsll32 at,at,0x0 + *5003d4: 5824 2150 daddu a0,a0,at + *5003d8: 41a1 0001 lui at,0x1 + *5003dc: 41a4 0077 lui a0,0x77 + *5003e0: 3021 0001 addiu at,at,1 + *5003e4: 3084 5820 addiu a0,a0,22560 + *5003e8: 5821 0008 dsll32 at,at,0x0 + *5003ec: 5824 2150 daddu a0,a0,at + *5003f0: 41a1 0001 lui at,0x1 + *5003f4: 41a4 0077 lui a0,0x77 + *5003f8: 3021 0001 addiu at,at,1 + *5003fc: 3084 5c08 addiu a0,a0,23560 + *500400: 5821 0008 dsll32 at,at,0x0 + *500404: 5824 2150 daddu a0,a0,at + *500408: 41a1 0001 lui at,0x1 + *50040c: 41a4 0077 lui a0,0x77 + *500410: 3021 0001 addiu at,at,1 + *500414: 3084 5430 addiu a0,a0,21552 + *500418: 5821 0008 dsll32 at,at,0x0 + *50041c: 5824 2150 daddu a0,a0,at + *500420: 41a1 0001 lui at,0x1 + *500424: 41a4 0077 lui a0,0x77 + *500428: 3021 0001 addiu at,at,1 + *50042c: 3084 5c09 addiu a0,a0,23561 + *500430: 5821 0008 dsll32 at,at,0x0 + *500434: 5824 2150 daddu a0,a0,at + *500438: 41a1 0002 lui at,0x2 + *50043c: 41a4 0002 lui a0,0x2 + *500440: 3021 a5a5 addiu at,at,-23131 + *500444: 3084 a5a5 addiu a0,a0,-23131 + *500448: 5821 0008 dsll32 at,at,0x0 + *50044c: 5824 2150 daddu a0,a0,at + *500450: 41a1 0002 lui at,0x2 + *500454: 41a4 0067 lui a0,0x67 + *500458: 3021 a5a5 addiu at,at,-23131 + *50045c: 3084 e8c5 addiu a0,a0,-5947 + *500460: 5821 0008 dsll32 at,at,0x0 + *500464: 5824 2150 daddu a0,a0,at + *500468: 41a1 0002 lui at,0x2 + *50046c: 41a4 0067 lui a0,0x67 + *500470: 3021 a5a5 addiu at,at,-23131 + *500474: 3084 e8c9 addiu a0,a0,-5943 + *500478: 5821 0008 dsll32 at,at,0x0 + *50047c: 5824 2150 daddu a0,a0,at + *500480: 41a1 0002 lui at,0x2 + *500484: 41a4 0067 lui a0,0x67 + *500488: 3021 a5a5 addiu at,at,-23131 + *50048c: 3084 e8d5 addiu a0,a0,-5931 + *500490: 5821 0008 dsll32 at,at,0x0 + *500494: 5824 2150 daddu a0,a0,at + *500498: 41a1 0002 lui at,0x2 + *50049c: 41a4 0067 lui a0,0x67 + *5004a0: 3021 a5a5 addiu at,at,-23131 + *5004a4: 3084 ecc5 addiu a0,a0,-4923 + *5004a8: 5821 0008 dsll32 at,at,0x0 + *5004ac: 5824 2150 daddu a0,a0,at + *5004b0: 41a1 0002 lui at,0x2 + *5004b4: 41a4 0078 lui a0,0x78 + *5004b8: 3021 a5a5 addiu at,at,-23131 + *5004bc: 3084 fdc5 addiu a0,a0,-571 + *5004c0: 5821 0008 dsll32 at,at,0x0 + *5004c4: 5824 2150 daddu a0,a0,at + *5004c8: 41a1 0002 lui at,0x2 + *5004cc: 41a4 0078 lui a0,0x78 + *5004d0: 3021 a5a5 addiu at,at,-23131 + *5004d4: 3084 01ad addiu a0,a0,429 + *5004d8: 5821 0008 dsll32 at,at,0x0 + *5004dc: 5824 2150 daddu a0,a0,at + *5004e0: 41a1 0002 lui at,0x2 + *5004e4: 41a4 0078 lui a0,0x78 + *5004e8: 3021 a5a5 addiu at,at,-23131 + *5004ec: 3084 f9d5 addiu a0,a0,-1579 + *5004f0: 5821 0008 dsll32 at,at,0x0 + *5004f4: 5824 2150 daddu a0,a0,at + *5004f8: 41a1 0002 lui at,0x2 + *5004fc: 41a4 0078 lui a0,0x78 + *500500: 3021 a5a5 addiu at,at,-23131 + *500504: 3084 01ae addiu a0,a0,430 + *500508: 5821 0008 dsll32 at,at,0x0 + *50050c: 5824 2150 daddu a0,a0,at + *500510: 41a1 0000 lui at,0x0 + *500514: 41a5 0000 lui a1,0x0 + *500518: 3021 0000 addiu at,at,0 + *50051c: 5821 0008 dsll32 at,at,0x0 + *500520: 5825 2950 daddu a1,a1,at + *500524: fc85 0000 lw a0,0\(a1\) + *500528: 41a1 0000 lui at,0x0 + *50052c: 41a5 0065 lui a1,0x65 + *500530: 3021 0000 addiu at,at,0 + *500534: 5821 0008 dsll32 at,at,0x0 + *500538: 5825 2950 daddu a1,a1,at + *50053c: fc85 4320 lw a0,17184\(a1\) + *500540: 41a1 0000 lui at,0x0 + *500544: 41a5 0065 lui a1,0x65 + *500548: 3021 0000 addiu at,at,0 + *50054c: 5821 0008 dsll32 at,at,0x0 + *500550: 5825 2950 daddu a1,a1,at + *500554: fc85 4324 lw a0,17188\(a1\) + *500558: 41a1 0000 lui at,0x0 + *50055c: 41a5 0065 lui a1,0x65 + *500560: 3021 0000 addiu at,at,0 + *500564: 5821 0008 dsll32 at,at,0x0 + *500568: 5825 2950 daddu a1,a1,at + *50056c: fc85 4330 lw a0,17200\(a1\) + *500570: 41a1 0000 lui at,0x0 + *500574: 41a5 0065 lui a1,0x65 + *500578: 3021 0000 addiu at,at,0 + *50057c: 5821 0008 dsll32 at,at,0x0 + *500580: 5825 2950 daddu a1,a1,at + *500584: fc85 4720 lw a0,18208\(a1\) + *500588: 41a1 0000 lui at,0x0 + *50058c: 41a5 0076 lui a1,0x76 + *500590: 3021 0000 addiu at,at,0 + *500594: 5821 0008 dsll32 at,at,0x0 + *500598: 5825 2950 daddu a1,a1,at + *50059c: fc85 5820 lw a0,22560\(a1\) + *5005a0: 41a1 0000 lui at,0x0 + *5005a4: 41a5 0076 lui a1,0x76 + *5005a8: 3021 0000 addiu at,at,0 + *5005ac: 5821 0008 dsll32 at,at,0x0 + *5005b0: 5825 2950 daddu a1,a1,at + *5005b4: fc85 5c08 lw a0,23560\(a1\) + *5005b8: 41a1 0000 lui at,0x0 + *5005bc: 41a5 0076 lui a1,0x76 + *5005c0: 3021 0000 addiu at,at,0 + *5005c4: 5821 0008 dsll32 at,at,0x0 + *5005c8: 5825 2950 daddu a1,a1,at + *5005cc: fc85 5430 lw a0,21552\(a1\) + *5005d0: 41a1 0000 lui at,0x0 + *5005d4: 41a5 0076 lui a1,0x76 + *5005d8: 3021 0000 addiu at,at,0 + *5005dc: 5821 0008 dsll32 at,at,0x0 + *5005e0: 5825 2950 daddu a1,a1,at + *5005e4: fc85 5c09 lw a0,23561\(a1\) + *5005e8: 41a1 0000 lui at,0x0 + *5005ec: 41a5 0000 lui a1,0x0 + *5005f0: 3021 0000 addiu at,at,0 + *5005f4: 5821 0008 dsll32 at,at,0x0 + *5005f8: 5825 2950 daddu a1,a1,at + *5005fc: fc85 0001 lw a0,1\(a1\) + *500600: 41a1 0000 lui at,0x0 + *500604: 41a5 0065 lui a1,0x65 + *500608: 3021 0000 addiu at,at,0 + *50060c: 5821 0008 dsll32 at,at,0x0 + *500610: 5825 2950 daddu a1,a1,at + *500614: fc85 4321 lw a0,17185\(a1\) + *500618: 41a1 0000 lui at,0x0 + *50061c: 41a5 0065 lui a1,0x65 + *500620: 3021 0000 addiu at,at,0 + *500624: 5821 0008 dsll32 at,at,0x0 + *500628: 5825 2950 daddu a1,a1,at + *50062c: fc85 4325 lw a0,17189\(a1\) + *500630: 41a1 0000 lui at,0x0 + *500634: 41a5 0065 lui a1,0x65 + *500638: 3021 0000 addiu at,at,0 + *50063c: 5821 0008 dsll32 at,at,0x0 + *500640: 5825 2950 daddu a1,a1,at + *500644: fc85 4331 lw a0,17201\(a1\) + *500648: 41a1 0000 lui at,0x0 + *50064c: 41a5 0065 lui a1,0x65 + *500650: 3021 0000 addiu at,at,0 + *500654: 5821 0008 dsll32 at,at,0x0 + *500658: 5825 2950 daddu a1,a1,at + *50065c: fc85 4721 lw a0,18209\(a1\) + *500660: 41a1 0000 lui at,0x0 + *500664: 41a5 0076 lui a1,0x76 + *500668: 3021 0000 addiu at,at,0 + *50066c: 5821 0008 dsll32 at,at,0x0 + *500670: 5825 2950 daddu a1,a1,at + *500674: fc85 5821 lw a0,22561\(a1\) + *500678: 41a1 0000 lui at,0x0 + *50067c: 41a5 0076 lui a1,0x76 + *500680: 3021 0000 addiu at,at,0 + *500684: 5821 0008 dsll32 at,at,0x0 + *500688: 5825 2950 daddu a1,a1,at + *50068c: fc85 5c09 lw a0,23561\(a1\) + *500690: 41a1 0000 lui at,0x0 + *500694: 41a5 0076 lui a1,0x76 + *500698: 3021 0000 addiu at,at,0 + *50069c: 5821 0008 dsll32 at,at,0x0 + *5006a0: 5825 2950 daddu a1,a1,at + *5006a4: fc85 5431 lw a0,21553\(a1\) + *5006a8: 41a1 0000 lui at,0x0 + *5006ac: 41a5 0076 lui a1,0x76 + *5006b0: 3021 0000 addiu at,at,0 + *5006b4: 5821 0008 dsll32 at,at,0x0 + *5006b8: 5825 2950 daddu a1,a1,at + *5006bc: fc85 5c0a lw a0,23562\(a1\) + *5006c0: 41a1 0001 lui at,0x1 + *5006c4: 41a5 8001 lui a1,0x8001 + *5006c8: 3021 8001 addiu at,at,-32767 + *5006cc: 5821 0008 dsll32 at,at,0x0 + *5006d0: 5825 2950 daddu a1,a1,at + *5006d4: fc85 8000 lw a0,-32768\(a1\) + *5006d8: 41a1 0001 lui at,0x1 + *5006dc: 41a5 8066 lui a1,0x8066 + *5006e0: 3021 8001 addiu at,at,-32767 + *5006e4: 5821 0008 dsll32 at,at,0x0 + *5006e8: 5825 2950 daddu a1,a1,at + *5006ec: fc85 c320 lw a0,-15584\(a1\) + *5006f0: 41a1 0001 lui at,0x1 + *5006f4: 41a5 8066 lui a1,0x8066 + *5006f8: 3021 8001 addiu at,at,-32767 + *5006fc: 5821 0008 dsll32 at,at,0x0 + *500700: 5825 2950 daddu a1,a1,at + *500704: fc85 c324 lw a0,-15580\(a1\) + *500708: 41a1 0001 lui at,0x1 + *50070c: 41a5 8066 lui a1,0x8066 + *500710: 3021 8001 addiu at,at,-32767 + *500714: 5821 0008 dsll32 at,at,0x0 + *500718: 5825 2950 daddu a1,a1,at + *50071c: fc85 c330 lw a0,-15568\(a1\) + *500720: 41a1 0001 lui at,0x1 + *500724: 41a5 8066 lui a1,0x8066 + *500728: 3021 8001 addiu at,at,-32767 + *50072c: 5821 0008 dsll32 at,at,0x0 + *500730: 5825 2950 daddu a1,a1,at + *500734: fc85 c720 lw a0,-14560\(a1\) + *500738: 41a1 0001 lui at,0x1 + *50073c: 41a5 8077 lui a1,0x8077 + *500740: 3021 8001 addiu at,at,-32767 + *500744: 5821 0008 dsll32 at,at,0x0 + *500748: 5825 2950 daddu a1,a1,at + *50074c: fc85 d820 lw a0,-10208\(a1\) + *500750: 41a1 0001 lui at,0x1 + *500754: 41a5 8077 lui a1,0x8077 + *500758: 3021 8001 addiu at,at,-32767 + *50075c: 5821 0008 dsll32 at,at,0x0 + *500760: 5825 2950 daddu a1,a1,at + *500764: fc85 dc08 lw a0,-9208\(a1\) + *500768: 41a1 0001 lui at,0x1 + *50076c: 41a5 8077 lui a1,0x8077 + *500770: 3021 8001 addiu at,at,-32767 + *500774: 5821 0008 dsll32 at,at,0x0 + *500778: 5825 2950 daddu a1,a1,at + *50077c: fc85 d430 lw a0,-11216\(a1\) + *500780: 41a1 0001 lui at,0x1 + *500784: 41a5 8077 lui a1,0x8077 + *500788: 3021 8001 addiu at,at,-32767 + *50078c: 5821 0008 dsll32 at,at,0x0 + *500790: 5825 2950 daddu a1,a1,at + *500794: fc85 dc09 lw a0,-9207\(a1\) + *500798: 41a1 0000 lui at,0x0 + *50079c: 41a5 8000 lui a1,0x8000 + *5007a0: 3021 8000 addiu at,at,-32768 + *5007a4: 5821 0008 dsll32 at,at,0x0 + *5007a8: 5825 2950 daddu a1,a1,at + *5007ac: fc85 8000 lw a0,-32768\(a1\) + *5007b0: 41a1 0000 lui at,0x0 + *5007b4: 41a5 8065 lui a1,0x8065 + *5007b8: 3021 8000 addiu at,at,-32768 + *5007bc: 5821 0008 dsll32 at,at,0x0 + *5007c0: 5825 2950 daddu a1,a1,at + *5007c4: fc85 c320 lw a0,-15584\(a1\) + *5007c8: 41a1 0000 lui at,0x0 + *5007cc: 41a5 8065 lui a1,0x8065 + *5007d0: 3021 8000 addiu at,at,-32768 + *5007d4: 5821 0008 dsll32 at,at,0x0 + *5007d8: 5825 2950 daddu a1,a1,at + *5007dc: fc85 c324 lw a0,-15580\(a1\) + *5007e0: 41a1 0000 lui at,0x0 + *5007e4: 41a5 8065 lui a1,0x8065 + *5007e8: 3021 8000 addiu at,at,-32768 + *5007ec: 5821 0008 dsll32 at,at,0x0 + *5007f0: 5825 2950 daddu a1,a1,at + *5007f4: fc85 c330 lw a0,-15568\(a1\) + *5007f8: 41a1 0000 lui at,0x0 + *5007fc: 41a5 8065 lui a1,0x8065 + *500800: 3021 8000 addiu at,at,-32768 + *500804: 5821 0008 dsll32 at,at,0x0 + *500808: 5825 2950 daddu a1,a1,at + *50080c: fc85 c720 lw a0,-14560\(a1\) + *500810: 41a1 0000 lui at,0x0 + *500814: 41a5 8076 lui a1,0x8076 + *500818: 3021 8000 addiu at,at,-32768 + *50081c: 5821 0008 dsll32 at,at,0x0 + *500820: 5825 2950 daddu a1,a1,at + *500824: fc85 d820 lw a0,-10208\(a1\) + *500828: 41a1 0000 lui at,0x0 + *50082c: 41a5 8076 lui a1,0x8076 + *500830: 3021 8000 addiu at,at,-32768 + *500834: 5821 0008 dsll32 at,at,0x0 + *500838: 5825 2950 daddu a1,a1,at + *50083c: fc85 dc08 lw a0,-9208\(a1\) + *500840: 41a1 0000 lui at,0x0 + *500844: 41a5 8076 lui a1,0x8076 + *500848: 3021 8000 addiu at,at,-32768 + *50084c: 5821 0008 dsll32 at,at,0x0 + *500850: 5825 2950 daddu a1,a1,at + *500854: fc85 d430 lw a0,-11216\(a1\) + *500858: 41a1 0000 lui at,0x0 + *50085c: 41a5 8076 lui a1,0x8076 + *500860: 3021 8000 addiu at,at,-32768 + *500864: 5821 0008 dsll32 at,at,0x0 + *500868: 5825 2950 daddu a1,a1,at + *50086c: fc85 dc09 lw a0,-9207\(a1\) + *500870: 41a1 0001 lui at,0x1 + *500874: 41a5 0001 lui a1,0x1 + *500878: 3021 0001 addiu at,at,1 + *50087c: 5821 0008 dsll32 at,at,0x0 + *500880: 5825 2950 daddu a1,a1,at + *500884: fc85 0000 lw a0,0\(a1\) + *500888: 41a1 0001 lui at,0x1 + *50088c: 41a5 0066 lui a1,0x66 + *500890: 3021 0001 addiu at,at,1 + *500894: 5821 0008 dsll32 at,at,0x0 + *500898: 5825 2950 daddu a1,a1,at + *50089c: fc85 4320 lw a0,17184\(a1\) + *5008a0: 41a1 0001 lui at,0x1 + *5008a4: 41a5 0066 lui a1,0x66 + *5008a8: 3021 0001 addiu at,at,1 + *5008ac: 5821 0008 dsll32 at,at,0x0 + *5008b0: 5825 2950 daddu a1,a1,at + *5008b4: fc85 4324 lw a0,17188\(a1\) + *5008b8: 41a1 0001 lui at,0x1 + *5008bc: 41a5 0066 lui a1,0x66 + *5008c0: 3021 0001 addiu at,at,1 + *5008c4: 5821 0008 dsll32 at,at,0x0 + *5008c8: 5825 2950 daddu a1,a1,at + *5008cc: fc85 4330 lw a0,17200\(a1\) + *5008d0: 41a1 0001 lui at,0x1 + *5008d4: 41a5 0066 lui a1,0x66 + *5008d8: 3021 0001 addiu at,at,1 + *5008dc: 5821 0008 dsll32 at,at,0x0 + *5008e0: 5825 2950 daddu a1,a1,at + *5008e4: fc85 4720 lw a0,18208\(a1\) + *5008e8: 41a1 0001 lui at,0x1 + *5008ec: 41a5 0077 lui a1,0x77 + *5008f0: 3021 0001 addiu at,at,1 + *5008f4: 5821 0008 dsll32 at,at,0x0 + *5008f8: 5825 2950 daddu a1,a1,at + *5008fc: fc85 5820 lw a0,22560\(a1\) + *500900: 41a1 0001 lui at,0x1 + *500904: 41a5 0077 lui a1,0x77 + *500908: 3021 0001 addiu at,at,1 + *50090c: 5821 0008 dsll32 at,at,0x0 + *500910: 5825 2950 daddu a1,a1,at + *500914: fc85 5c08 lw a0,23560\(a1\) + *500918: 41a1 0001 lui at,0x1 + *50091c: 41a5 0077 lui a1,0x77 + *500920: 3021 0001 addiu at,at,1 + *500924: 5821 0008 dsll32 at,at,0x0 + *500928: 5825 2950 daddu a1,a1,at + *50092c: fc85 5430 lw a0,21552\(a1\) + *500930: 41a1 0001 lui at,0x1 + *500934: 41a5 0077 lui a1,0x77 + *500938: 3021 0001 addiu at,at,1 + *50093c: 5821 0008 dsll32 at,at,0x0 + *500940: 5825 2950 daddu a1,a1,at + *500944: fc85 5c09 lw a0,23561\(a1\) + *500948: 41a1 0002 lui at,0x2 + *50094c: 41a5 0002 lui a1,0x2 + *500950: 3021 a5a5 addiu at,at,-23131 + *500954: 5821 0008 dsll32 at,at,0x0 + *500958: 5825 2950 daddu a1,a1,at + *50095c: fc85 a5a5 lw a0,-23131\(a1\) + *500960: 41a1 0002 lui at,0x2 + *500964: 41a5 0067 lui a1,0x67 + *500968: 3021 a5a5 addiu at,at,-23131 + *50096c: 5821 0008 dsll32 at,at,0x0 + *500970: 5825 2950 daddu a1,a1,at + *500974: fc85 e8c5 lw a0,-5947\(a1\) + *500978: 41a1 0002 lui at,0x2 + *50097c: 41a5 0067 lui a1,0x67 + *500980: 3021 a5a5 addiu at,at,-23131 + *500984: 5821 0008 dsll32 at,at,0x0 + *500988: 5825 2950 daddu a1,a1,at + *50098c: fc85 e8c9 lw a0,-5943\(a1\) + *500990: 41a1 0002 lui at,0x2 + *500994: 41a5 0067 lui a1,0x67 + *500998: 3021 a5a5 addiu at,at,-23131 + *50099c: 5821 0008 dsll32 at,at,0x0 + *5009a0: 5825 2950 daddu a1,a1,at + *5009a4: fc85 e8d5 lw a0,-5931\(a1\) + *5009a8: 41a1 0002 lui at,0x2 + *5009ac: 41a5 0067 lui a1,0x67 + *5009b0: 3021 a5a5 addiu at,at,-23131 + *5009b4: 5821 0008 dsll32 at,at,0x0 + *5009b8: 5825 2950 daddu a1,a1,at + *5009bc: fc85 ecc5 lw a0,-4923\(a1\) + *5009c0: 41a1 0002 lui at,0x2 + *5009c4: 41a5 0078 lui a1,0x78 + *5009c8: 3021 a5a5 addiu at,at,-23131 + *5009cc: 5821 0008 dsll32 at,at,0x0 + *5009d0: 5825 2950 daddu a1,a1,at + *5009d4: fc85 fdc5 lw a0,-571\(a1\) + *5009d8: 41a1 0002 lui at,0x2 + *5009dc: 41a5 0078 lui a1,0x78 + *5009e0: 3021 a5a5 addiu at,at,-23131 + *5009e4: 5821 0008 dsll32 at,at,0x0 + *5009e8: 5825 2950 daddu a1,a1,at + *5009ec: fc85 01ad lw a0,429\(a1\) + *5009f0: 41a1 0002 lui at,0x2 + *5009f4: 41a5 0078 lui a1,0x78 + *5009f8: 3021 a5a5 addiu at,at,-23131 + *5009fc: 5821 0008 dsll32 at,at,0x0 + *500a00: 5825 2950 daddu a1,a1,at + *500a04: fc85 f9d5 lw a0,-1579\(a1\) + *500a08: 41a1 0002 lui at,0x2 + *500a0c: 41a5 0078 lui a1,0x78 + *500a10: 3021 a5a5 addiu at,at,-23131 + *500a14: 5821 0008 dsll32 at,at,0x0 + *500a18: 5825 2950 daddu a1,a1,at + *500a1c: fc85 01ae lw a0,430\(a1\) + \.\.\. diff --git a/ld/testsuite/ld-mips-elf/micromips-hilo-srec-n64.d b/ld/testsuite/ld-mips-elf/micromips-hilo-srec-n64.d new file mode 100644 index 0000000..efbaaa5 --- /dev/null +++ b/ld/testsuite/ld-mips-elf/micromips-hilo-srec-n64.d @@ -0,0 +1,8 @@ +#name: R_MICROMIPS_HI16 and R_MICROMIPS_LO16 relocs srec (n64) +#source: ../../../gas/testsuite/gas/mips/mips-hilo-n64.s +#source: mips-hilo.s +#as: -mmicromips -march=mips64r2 +#objdump: -m mips:micromips -j .sec1 -D +#ld: --oformat=srec -Tmips-hilo.ld -e 0x500000 -N +#notarget: mips*el-ps2-elf* +#dump: micromips-hilo-n64.d diff --git a/ld/testsuite/ld-mips-elf/micromips-hilo-srec.d b/ld/testsuite/ld-mips-elf/micromips-hilo-srec.d new file mode 100644 index 0000000..c8bee0a --- /dev/null +++ b/ld/testsuite/ld-mips-elf/micromips-hilo-srec.d @@ -0,0 +1,8 @@ +#name: R_MICROMIPS_HI16 and R_MICROMIPS_LO16 relocs srec +#source: ../../../gas/testsuite/gas/mips/mips-hilo.s +#source: mips-hilo.s +#as: -mmicromips -march=mips64r2 +#objdump: -m mips:micromips -j .sec1 -D +#ld: --oformat=srec -Tmips-hilo.ld -e 0x500000 -N +#notarget: mips*el-ps2-elf* +#dump: micromips-hilo.d diff --git a/ld/testsuite/ld-mips-elf/micromips-hilo.d b/ld/testsuite/ld-mips-elf/micromips-hilo.d new file mode 100644 index 0000000..ec5c9d1 --- /dev/null +++ b/ld/testsuite/ld-mips-elf/micromips-hilo.d @@ -0,0 +1,230 @@ +#name: R_MICROMIPS_HI16 and R_MICROMIPS_LO16 relocs +#source: ../../../gas/testsuite/gas/mips/mips-hilo.s +#source: mips-hilo.s +#as: -mmicromips -march=mips64r2 +#objdump: -d +#ld: -Tmips-hilo.ld -e 0x500000 -N +#notarget: mips*el-ps2-elf* + +.*: file format (:?elf.*mips.*|srec) + +Disassembly of section \.(:?text|sec1): + +0*500000 <[^>]*>: + *500000: 41a4 0000 lui a0,0x0 + *500004: 3084 0000 addiu a0,a0,0 + *500008: 41a4 0065 lui a0,0x65 + *50000c: 3084 4320 addiu a0,a0,17184 + *500010: 41a4 0065 lui a0,0x65 + *500014: 3084 4324 addiu a0,a0,17188 + *500018: 41a4 0065 lui a0,0x65 + *50001c: 3084 4330 addiu a0,a0,17200 + *500020: 41a4 0065 lui a0,0x65 + *500024: 3084 4720 addiu a0,a0,18208 + *500028: 41a4 0076 lui a0,0x76 + *50002c: 3084 5820 addiu a0,a0,22560 + *500030: 41a4 0076 lui a0,0x76 + *500034: 3084 5c08 addiu a0,a0,23560 + *500038: 41a4 0076 lui a0,0x76 + *50003c: 3084 5430 addiu a0,a0,21552 + *500040: 41a4 0076 lui a0,0x76 + *500044: 3084 5c09 addiu a0,a0,23561 + *500048: 41a4 0000 lui a0,0x0 + *50004c: 3084 0001 addiu a0,a0,1 + *500050: 41a4 0065 lui a0,0x65 + *500054: 3084 4321 addiu a0,a0,17185 + *500058: 41a4 0065 lui a0,0x65 + *50005c: 3084 4325 addiu a0,a0,17189 + *500060: 41a4 0065 lui a0,0x65 + *500064: 3084 4331 addiu a0,a0,17201 + *500068: 41a4 0065 lui a0,0x65 + *50006c: 3084 4721 addiu a0,a0,18209 + *500070: 41a4 0076 lui a0,0x76 + *500074: 3084 5821 addiu a0,a0,22561 + *500078: 41a4 0076 lui a0,0x76 + *50007c: 3084 5c09 addiu a0,a0,23561 + *500080: 41a4 0076 lui a0,0x76 + *500084: 3084 5431 addiu a0,a0,21553 + *500088: 41a4 0076 lui a0,0x76 + *50008c: 3084 5c0a addiu a0,a0,23562 + *500090: 41a4 0001 lui a0,0x1 + *500094: 3084 8000 addiu a0,a0,-32768 + *500098: 41a4 0066 lui a0,0x66 + *50009c: 3084 c320 addiu a0,a0,-15584 + *5000a0: 41a4 0066 lui a0,0x66 + *5000a4: 3084 c324 addiu a0,a0,-15580 + *5000a8: 41a4 0066 lui a0,0x66 + *5000ac: 3084 c330 addiu a0,a0,-15568 + *5000b0: 41a4 0066 lui a0,0x66 + *5000b4: 3084 c720 addiu a0,a0,-14560 + *5000b8: 41a4 0077 lui a0,0x77 + *5000bc: 3084 d820 addiu a0,a0,-10208 + *5000c0: 41a4 0077 lui a0,0x77 + *5000c4: 3084 dc08 addiu a0,a0,-9208 + *5000c8: 41a4 0077 lui a0,0x77 + *5000cc: 3084 d430 addiu a0,a0,-11216 + *5000d0: 41a4 0077 lui a0,0x77 + *5000d4: 3084 dc09 addiu a0,a0,-9207 + *5000d8: 41a4 0000 lui a0,0x0 + *5000dc: 3084 8000 addiu a0,a0,-32768 + *5000e0: 41a4 0065 lui a0,0x65 + *5000e4: 3084 c320 addiu a0,a0,-15584 + *5000e8: 41a4 0065 lui a0,0x65 + *5000ec: 3084 c324 addiu a0,a0,-15580 + *5000f0: 41a4 0065 lui a0,0x65 + *5000f4: 3084 c330 addiu a0,a0,-15568 + *5000f8: 41a4 0065 lui a0,0x65 + *5000fc: 3084 c720 addiu a0,a0,-14560 + *500100: 41a4 0076 lui a0,0x76 + *500104: 3084 d820 addiu a0,a0,-10208 + *500108: 41a4 0076 lui a0,0x76 + *50010c: 3084 dc08 addiu a0,a0,-9208 + *500110: 41a4 0076 lui a0,0x76 + *500114: 3084 d430 addiu a0,a0,-11216 + *500118: 41a4 0076 lui a0,0x76 + *50011c: 3084 dc09 addiu a0,a0,-9207 + *500120: 41a4 0001 lui a0,0x1 + *500124: 3084 0000 addiu a0,a0,0 + *500128: 41a4 0066 lui a0,0x66 + *50012c: 3084 4320 addiu a0,a0,17184 + *500130: 41a4 0066 lui a0,0x66 + *500134: 3084 4324 addiu a0,a0,17188 + *500138: 41a4 0066 lui a0,0x66 + *50013c: 3084 4330 addiu a0,a0,17200 + *500140: 41a4 0066 lui a0,0x66 + *500144: 3084 4720 addiu a0,a0,18208 + *500148: 41a4 0077 lui a0,0x77 + *50014c: 3084 5820 addiu a0,a0,22560 + *500150: 41a4 0077 lui a0,0x77 + *500154: 3084 5c08 addiu a0,a0,23560 + *500158: 41a4 0077 lui a0,0x77 + *50015c: 3084 5430 addiu a0,a0,21552 + *500160: 41a4 0077 lui a0,0x77 + *500164: 3084 5c09 addiu a0,a0,23561 + *500168: 41a4 0002 lui a0,0x2 + *50016c: 3084 a5a5 addiu a0,a0,-23131 + *500170: 41a4 0067 lui a0,0x67 + *500174: 3084 e8c5 addiu a0,a0,-5947 + *500178: 41a4 0067 lui a0,0x67 + *50017c: 3084 e8c9 addiu a0,a0,-5943 + *500180: 41a4 0067 lui a0,0x67 + *500184: 3084 e8d5 addiu a0,a0,-5931 + *500188: 41a4 0067 lui a0,0x67 + *50018c: 3084 ecc5 addiu a0,a0,-4923 + *500190: 41a4 0078 lui a0,0x78 + *500194: 3084 fdc5 addiu a0,a0,-571 + *500198: 41a4 0078 lui a0,0x78 + *50019c: 3084 01ad addiu a0,a0,429 + *5001a0: 41a4 0078 lui a0,0x78 + *5001a4: 3084 f9d5 addiu a0,a0,-1579 + *5001a8: 41a4 0078 lui a0,0x78 + *5001ac: 3084 01ae addiu a0,a0,430 + *5001b0: 41a5 0000 lui a1,0x0 + *5001b4: fc85 0000 lw a0,0\(a1\) + *5001b8: 41a5 0065 lui a1,0x65 + *5001bc: fc85 4320 lw a0,17184\(a1\) + *5001c0: 41a5 0065 lui a1,0x65 + *5001c4: fc85 4324 lw a0,17188\(a1\) + *5001c8: 41a5 0065 lui a1,0x65 + *5001cc: fc85 4330 lw a0,17200\(a1\) + *5001d0: 41a5 0065 lui a1,0x65 + *5001d4: fc85 4720 lw a0,18208\(a1\) + *5001d8: 41a5 0076 lui a1,0x76 + *5001dc: fc85 5820 lw a0,22560\(a1\) + *5001e0: 41a5 0076 lui a1,0x76 + *5001e4: fc85 5c08 lw a0,23560\(a1\) + *5001e8: 41a5 0076 lui a1,0x76 + *5001ec: fc85 5430 lw a0,21552\(a1\) + *5001f0: 41a5 0076 lui a1,0x76 + *5001f4: fc85 5c09 lw a0,23561\(a1\) + *5001f8: 41a5 0000 lui a1,0x0 + *5001fc: fc85 0001 lw a0,1\(a1\) + *500200: 41a5 0065 lui a1,0x65 + *500204: fc85 4321 lw a0,17185\(a1\) + *500208: 41a5 0065 lui a1,0x65 + *50020c: fc85 4325 lw a0,17189\(a1\) + *500210: 41a5 0065 lui a1,0x65 + *500214: fc85 4331 lw a0,17201\(a1\) + *500218: 41a5 0065 lui a1,0x65 + *50021c: fc85 4721 lw a0,18209\(a1\) + *500220: 41a5 0076 lui a1,0x76 + *500224: fc85 5821 lw a0,22561\(a1\) + *500228: 41a5 0076 lui a1,0x76 + *50022c: fc85 5c09 lw a0,23561\(a1\) + *500230: 41a5 0076 lui a1,0x76 + *500234: fc85 5431 lw a0,21553\(a1\) + *500238: 41a5 0076 lui a1,0x76 + *50023c: fc85 5c0a lw a0,23562\(a1\) + *500240: 41a5 0001 lui a1,0x1 + *500244: fc85 8000 lw a0,-32768\(a1\) + *500248: 41a5 0066 lui a1,0x66 + *50024c: fc85 c320 lw a0,-15584\(a1\) + *500250: 41a5 0066 lui a1,0x66 + *500254: fc85 c324 lw a0,-15580\(a1\) + *500258: 41a5 0066 lui a1,0x66 + *50025c: fc85 c330 lw a0,-15568\(a1\) + *500260: 41a5 0066 lui a1,0x66 + *500264: fc85 c720 lw a0,-14560\(a1\) + *500268: 41a5 0077 lui a1,0x77 + *50026c: fc85 d820 lw a0,-10208\(a1\) + *500270: 41a5 0077 lui a1,0x77 + *500274: fc85 dc08 lw a0,-9208\(a1\) + *500278: 41a5 0077 lui a1,0x77 + *50027c: fc85 d430 lw a0,-11216\(a1\) + *500280: 41a5 0077 lui a1,0x77 + *500284: fc85 dc09 lw a0,-9207\(a1\) + *500288: 41a5 0000 lui a1,0x0 + *50028c: fc85 8000 lw a0,-32768\(a1\) + *500290: 41a5 0065 lui a1,0x65 + *500294: fc85 c320 lw a0,-15584\(a1\) + *500298: 41a5 0065 lui a1,0x65 + *50029c: fc85 c324 lw a0,-15580\(a1\) + *5002a0: 41a5 0065 lui a1,0x65 + *5002a4: fc85 c330 lw a0,-15568\(a1\) + *5002a8: 41a5 0065 lui a1,0x65 + *5002ac: fc85 c720 lw a0,-14560\(a1\) + *5002b0: 41a5 0076 lui a1,0x76 + *5002b4: fc85 d820 lw a0,-10208\(a1\) + *5002b8: 41a5 0076 lui a1,0x76 + *5002bc: fc85 dc08 lw a0,-9208\(a1\) + *5002c0: 41a5 0076 lui a1,0x76 + *5002c4: fc85 d430 lw a0,-11216\(a1\) + *5002c8: 41a5 0076 lui a1,0x76 + *5002cc: fc85 dc09 lw a0,-9207\(a1\) + *5002d0: 41a5 0001 lui a1,0x1 + *5002d4: fc85 0000 lw a0,0\(a1\) + *5002d8: 41a5 0066 lui a1,0x66 + *5002dc: fc85 4320 lw a0,17184\(a1\) + *5002e0: 41a5 0066 lui a1,0x66 + *5002e4: fc85 4324 lw a0,17188\(a1\) + *5002e8: 41a5 0066 lui a1,0x66 + *5002ec: fc85 4330 lw a0,17200\(a1\) + *5002f0: 41a5 0066 lui a1,0x66 + *5002f4: fc85 4720 lw a0,18208\(a1\) + *5002f8: 41a5 0077 lui a1,0x77 + *5002fc: fc85 5820 lw a0,22560\(a1\) + *500300: 41a5 0077 lui a1,0x77 + *500304: fc85 5c08 lw a0,23560\(a1\) + *500308: 41a5 0077 lui a1,0x77 + *50030c: fc85 5430 lw a0,21552\(a1\) + *500310: 41a5 0077 lui a1,0x77 + *500314: fc85 5c09 lw a0,23561\(a1\) + *500318: 41a5 0002 lui a1,0x2 + *50031c: fc85 a5a5 lw a0,-23131\(a1\) + *500320: 41a5 0067 lui a1,0x67 + *500324: fc85 e8c5 lw a0,-5947\(a1\) + *500328: 41a5 0067 lui a1,0x67 + *50032c: fc85 e8c9 lw a0,-5943\(a1\) + *500330: 41a5 0067 lui a1,0x67 + *500334: fc85 e8d5 lw a0,-5931\(a1\) + *500338: 41a5 0067 lui a1,0x67 + *50033c: fc85 ecc5 lw a0,-4923\(a1\) + *500340: 41a5 0078 lui a1,0x78 + *500344: fc85 fdc5 lw a0,-571\(a1\) + *500348: 41a5 0078 lui a1,0x78 + *50034c: fc85 01ad lw a0,429\(a1\) + *500350: 41a5 0078 lui a1,0x78 + *500354: fc85 f9d5 lw a0,-1579\(a1\) + *500358: 41a5 0078 lui a1,0x78 + *50035c: fc85 01ae lw a0,430\(a1\) + \.\.\. diff --git a/ld/testsuite/ld-mips-elf/mips-elf.exp b/ld/testsuite/ld-mips-elf/mips-elf.exp index 6cb9088..e8a1d42 100644 --- a/ld/testsuite/ld-mips-elf/mips-elf.exp +++ b/ld/testsuite/ld-mips-elf/mips-elf.exp @@ -814,8 +814,68 @@ run_dump_test_n32 "jalbal" noarch run_dump_test "mode-change-error-1" -run_dump_test_o32 "mips16-hilo" -run_dump_test_n32 "mips16-hilo-n32" +run_dump_test_o32 "mips16-hilo" noarch +run_dump_test_n32 "mips16-hilo" [list noarch [list name (n32)]] +run_dump_test_o32 "mips16-hilo-srec" \ + [list noarch \ + [list objdump [expr { [istarget *el-*-*] ? "-EL" : "-EB" }]]] +run_dump_test_n32 "mips16-hilo-srec" \ + [list noarch \ + [list name (n32)] \ + [list objdump [expr { [istarget *el-*-*] ? "-EL" : "-EB" }]]] +run_dump_test_o32 "mips16e2-hilo" noarch +run_dump_test_n32 "mips16e2-hilo" [list noarch [list name (n32)]] +run_dump_test_o32 "mips16e2-hilo-srec" \ + [list noarch \ + [list objdump [expr { [istarget *el-*-*] ? "-EL" : "-EB" }]]] +run_dump_test_n32 "mips16e2-hilo-srec" \ + [list noarch \ + [list name (n32)] \ + [list objdump [expr { [istarget *el-*-*] ? "-EL" : "-EB" }]]] +run_dump_test_o32 "mips-hilo" +run_dump_test_n32 "mips-hilo" [list [list name (n32)]] +run_dump_test_n64 "mips-hilo-n64" +run_dump_test_o32 "mips-hilo-srec" \ + [list [list objdump [expr { [istarget *el-*-*] ? "-EL" : "-EB" }]]] +run_dump_test_n32 "mips-hilo-srec" \ + [list [list name (n32)] \ + [list objdump [expr { [istarget *el-*-*] ? "-EL" : "-EB" }]]] +run_dump_test_n64 "mips-hilo-srec-n64" \ + [list [list objdump [expr { [istarget *el-*-*] ? "-EL" : "-EB" }]]] +run_dump_test_o32 "micromips-hilo" noarch +run_dump_test_n32 "micromips-hilo" [list noarch [list name (n32)]] +run_dump_test_n64 "micromips-hilo-n64" noarch +run_dump_test_o32 "micromips-hilo-srec" \ + [list noarch \ + [list objdump [expr { [istarget *el-*-*] ? "-EL" : "-EB" }]]] +run_dump_test_n32 "micromips-hilo-srec" \ + [list noarch \ + [list name (n32)] \ + [list objdump [expr { [istarget *el-*-*] ? "-EL" : "-EB" }]]] +run_dump_test_n64 "micromips-hilo-srec-n64" \ + [list noarch \ + [list objdump [expr { [istarget *el-*-*] ? "-EL" : "-EB" }]]] +run_dump_test_o32 "pcrel-hilo" +run_dump_test_n32 "pcrel-hilo" [list [list name (n32)]] +run_dump_test_n64 "pcrel-hilo" [list [list name (n64)]] +run_dump_test_o32 "pcrel-hilo-srec" \ + [list [list objdump [expr { [istarget *el-*-*] ? "-EL" : "-EB" }]]] +run_dump_test_n32 "pcrel-hilo-srec" \ + [list [list name (n32)] \ + [list objdump [expr { [istarget *el-*-*] ? "-EL" : "-EB" }]]] +run_dump_test_n64 "pcrel-hilo-srec" \ + [list [list name (n64)] \ + [list objdump [expr { [istarget *el-*-*] ? "-EL" : "-EB" }]]] + +run_dump_test_o32 "pr19977" +run_dump_test_n32 "pr19977" [list [list name (n32)]] +run_dump_test_o32 "pr19977-mips16" noarch +run_dump_test_n32 "pr19977-mips16" [list noarch [list name (n32)]] +run_dump_test_o32 "pr19977-micromips" noarch +run_dump_test_n32 "pr19977-micromips" [list noarch [list name (n32)]] +run_dump_test_o32 "pr19977-r" +run_dump_test_o32 "pr19977-r-mips16" noarch +run_dump_test_o32 "pr19977-r-micromips" noarch if { $linux_gnu } { run_dump_test_n32 "textrel-1" diff --git a/ld/testsuite/ld-mips-elf/mips-hilo-n64.d b/ld/testsuite/ld-mips-elf/mips-hilo-n64.d new file mode 100644 index 0000000..9cac1b3 --- /dev/null +++ b/ld/testsuite/ld-mips-elf/mips-hilo-n64.d @@ -0,0 +1,660 @@ +#name: R_MIPS_HI16 and R_MIPS_LO16 relocs (n64) +#source: ../../../gas/testsuite/gas/mips/mips-hilo-n64.s +#source: mips-hilo.s +#objdump: -d +#ld: -Tmips-hilo.ld -e 0x500000 -N + +.*: file format (:?elf.*mips.*|srec) + +Disassembly of section \.(:?text|sec1): + +0*500000 <[^>]*>: + *500000: 3c010000 lui at,0x0 + *500004: 3c040000 lui a0,0x0 + *500008: 24210000 addiu at,at,0 + *50000c: 24840000 addiu a0,a0,0 + *500010: 0001083c dsll32 at,at,0x0 + *500014: 0081202d daddu a0,a0,at + *500018: 3c010000 lui at,0x0 + *50001c: 3c040065 lui a0,0x65 + *500020: 24210000 addiu at,at,0 + *500024: 24844320 addiu a0,a0,17184 + *500028: 0001083c dsll32 at,at,0x0 + *50002c: 0081202d daddu a0,a0,at + *500030: 3c010000 lui at,0x0 + *500034: 3c040065 lui a0,0x65 + *500038: 24210000 addiu at,at,0 + *50003c: 24844324 addiu a0,a0,17188 + *500040: 0001083c dsll32 at,at,0x0 + *500044: 0081202d daddu a0,a0,at + *500048: 3c010000 lui at,0x0 + *50004c: 3c040065 lui a0,0x65 + *500050: 24210000 addiu at,at,0 + *500054: 24844330 addiu a0,a0,17200 + *500058: 0001083c dsll32 at,at,0x0 + *50005c: 0081202d daddu a0,a0,at + *500060: 3c010000 lui at,0x0 + *500064: 3c040065 lui a0,0x65 + *500068: 24210000 addiu at,at,0 + *50006c: 24844720 addiu a0,a0,18208 + *500070: 0001083c dsll32 at,at,0x0 + *500074: 0081202d daddu a0,a0,at + *500078: 3c010000 lui at,0x0 + *50007c: 3c040076 lui a0,0x76 + *500080: 24210000 addiu at,at,0 + *500084: 24845820 addiu a0,a0,22560 + *500088: 0001083c dsll32 at,at,0x0 + *50008c: 0081202d daddu a0,a0,at + *500090: 3c010000 lui at,0x0 + *500094: 3c040076 lui a0,0x76 + *500098: 24210000 addiu at,at,0 + *50009c: 24845c08 addiu a0,a0,23560 + *5000a0: 0001083c dsll32 at,at,0x0 + *5000a4: 0081202d daddu a0,a0,at + *5000a8: 3c010000 lui at,0x0 + *5000ac: 3c040076 lui a0,0x76 + *5000b0: 24210000 addiu at,at,0 + *5000b4: 24845430 addiu a0,a0,21552 + *5000b8: 0001083c dsll32 at,at,0x0 + *5000bc: 0081202d daddu a0,a0,at + *5000c0: 3c010000 lui at,0x0 + *5000c4: 3c040076 lui a0,0x76 + *5000c8: 24210000 addiu at,at,0 + *5000cc: 24845c09 addiu a0,a0,23561 + *5000d0: 0001083c dsll32 at,at,0x0 + *5000d4: 0081202d daddu a0,a0,at + *5000d8: 3c010000 lui at,0x0 + *5000dc: 3c040000 lui a0,0x0 + *5000e0: 24210000 addiu at,at,0 + *5000e4: 24840001 addiu a0,a0,1 + *5000e8: 0001083c dsll32 at,at,0x0 + *5000ec: 0081202d daddu a0,a0,at + *5000f0: 3c010000 lui at,0x0 + *5000f4: 3c040065 lui a0,0x65 + *5000f8: 24210000 addiu at,at,0 + *5000fc: 24844321 addiu a0,a0,17185 + *500100: 0001083c dsll32 at,at,0x0 + *500104: 0081202d daddu a0,a0,at + *500108: 3c010000 lui at,0x0 + *50010c: 3c040065 lui a0,0x65 + *500110: 24210000 addiu at,at,0 + *500114: 24844325 addiu a0,a0,17189 + *500118: 0001083c dsll32 at,at,0x0 + *50011c: 0081202d daddu a0,a0,at + *500120: 3c010000 lui at,0x0 + *500124: 3c040065 lui a0,0x65 + *500128: 24210000 addiu at,at,0 + *50012c: 24844331 addiu a0,a0,17201 + *500130: 0001083c dsll32 at,at,0x0 + *500134: 0081202d daddu a0,a0,at + *500138: 3c010000 lui at,0x0 + *50013c: 3c040065 lui a0,0x65 + *500140: 24210000 addiu at,at,0 + *500144: 24844721 addiu a0,a0,18209 + *500148: 0001083c dsll32 at,at,0x0 + *50014c: 0081202d daddu a0,a0,at + *500150: 3c010000 lui at,0x0 + *500154: 3c040076 lui a0,0x76 + *500158: 24210000 addiu at,at,0 + *50015c: 24845821 addiu a0,a0,22561 + *500160: 0001083c dsll32 at,at,0x0 + *500164: 0081202d daddu a0,a0,at + *500168: 3c010000 lui at,0x0 + *50016c: 3c040076 lui a0,0x76 + *500170: 24210000 addiu at,at,0 + *500174: 24845c09 addiu a0,a0,23561 + *500178: 0001083c dsll32 at,at,0x0 + *50017c: 0081202d daddu a0,a0,at + *500180: 3c010000 lui at,0x0 + *500184: 3c040076 lui a0,0x76 + *500188: 24210000 addiu at,at,0 + *50018c: 24845431 addiu a0,a0,21553 + *500190: 0001083c dsll32 at,at,0x0 + *500194: 0081202d daddu a0,a0,at + *500198: 3c010000 lui at,0x0 + *50019c: 3c040076 lui a0,0x76 + *5001a0: 24210000 addiu at,at,0 + *5001a4: 24845c0a addiu a0,a0,23562 + *5001a8: 0001083c dsll32 at,at,0x0 + *5001ac: 0081202d daddu a0,a0,at + *5001b0: 3c010001 lui at,0x1 + *5001b4: 3c048001 lui a0,0x8001 + *5001b8: 24218001 addiu at,at,-32767 + *5001bc: 24848000 addiu a0,a0,-32768 + *5001c0: 0001083c dsll32 at,at,0x0 + *5001c4: 0081202d daddu a0,a0,at + *5001c8: 3c010001 lui at,0x1 + *5001cc: 3c048066 lui a0,0x8066 + *5001d0: 24218001 addiu at,at,-32767 + *5001d4: 2484c320 addiu a0,a0,-15584 + *5001d8: 0001083c dsll32 at,at,0x0 + *5001dc: 0081202d daddu a0,a0,at + *5001e0: 3c010001 lui at,0x1 + *5001e4: 3c048066 lui a0,0x8066 + *5001e8: 24218001 addiu at,at,-32767 + *5001ec: 2484c324 addiu a0,a0,-15580 + *5001f0: 0001083c dsll32 at,at,0x0 + *5001f4: 0081202d daddu a0,a0,at + *5001f8: 3c010001 lui at,0x1 + *5001fc: 3c048066 lui a0,0x8066 + *500200: 24218001 addiu at,at,-32767 + *500204: 2484c330 addiu a0,a0,-15568 + *500208: 0001083c dsll32 at,at,0x0 + *50020c: 0081202d daddu a0,a0,at + *500210: 3c010001 lui at,0x1 + *500214: 3c048066 lui a0,0x8066 + *500218: 24218001 addiu at,at,-32767 + *50021c: 2484c720 addiu a0,a0,-14560 + *500220: 0001083c dsll32 at,at,0x0 + *500224: 0081202d daddu a0,a0,at + *500228: 3c010001 lui at,0x1 + *50022c: 3c048077 lui a0,0x8077 + *500230: 24218001 addiu at,at,-32767 + *500234: 2484d820 addiu a0,a0,-10208 + *500238: 0001083c dsll32 at,at,0x0 + *50023c: 0081202d daddu a0,a0,at + *500240: 3c010001 lui at,0x1 + *500244: 3c048077 lui a0,0x8077 + *500248: 24218001 addiu at,at,-32767 + *50024c: 2484dc08 addiu a0,a0,-9208 + *500250: 0001083c dsll32 at,at,0x0 + *500254: 0081202d daddu a0,a0,at + *500258: 3c010001 lui at,0x1 + *50025c: 3c048077 lui a0,0x8077 + *500260: 24218001 addiu at,at,-32767 + *500264: 2484d430 addiu a0,a0,-11216 + *500268: 0001083c dsll32 at,at,0x0 + *50026c: 0081202d daddu a0,a0,at + *500270: 3c010001 lui at,0x1 + *500274: 3c048077 lui a0,0x8077 + *500278: 24218001 addiu at,at,-32767 + *50027c: 2484dc09 addiu a0,a0,-9207 + *500280: 0001083c dsll32 at,at,0x0 + *500284: 0081202d daddu a0,a0,at + *500288: 3c010000 lui at,0x0 + *50028c: 3c048000 lui a0,0x8000 + *500290: 24218000 addiu at,at,-32768 + *500294: 24848000 addiu a0,a0,-32768 + *500298: 0001083c dsll32 at,at,0x0 + *50029c: 0081202d daddu a0,a0,at + *5002a0: 3c010000 lui at,0x0 + *5002a4: 3c048065 lui a0,0x8065 + *5002a8: 24218000 addiu at,at,-32768 + *5002ac: 2484c320 addiu a0,a0,-15584 + *5002b0: 0001083c dsll32 at,at,0x0 + *5002b4: 0081202d daddu a0,a0,at + *5002b8: 3c010000 lui at,0x0 + *5002bc: 3c048065 lui a0,0x8065 + *5002c0: 24218000 addiu at,at,-32768 + *5002c4: 2484c324 addiu a0,a0,-15580 + *5002c8: 0001083c dsll32 at,at,0x0 + *5002cc: 0081202d daddu a0,a0,at + *5002d0: 3c010000 lui at,0x0 + *5002d4: 3c048065 lui a0,0x8065 + *5002d8: 24218000 addiu at,at,-32768 + *5002dc: 2484c330 addiu a0,a0,-15568 + *5002e0: 0001083c dsll32 at,at,0x0 + *5002e4: 0081202d daddu a0,a0,at + *5002e8: 3c010000 lui at,0x0 + *5002ec: 3c048065 lui a0,0x8065 + *5002f0: 24218000 addiu at,at,-32768 + *5002f4: 2484c720 addiu a0,a0,-14560 + *5002f8: 0001083c dsll32 at,at,0x0 + *5002fc: 0081202d daddu a0,a0,at + *500300: 3c010000 lui at,0x0 + *500304: 3c048076 lui a0,0x8076 + *500308: 24218000 addiu at,at,-32768 + *50030c: 2484d820 addiu a0,a0,-10208 + *500310: 0001083c dsll32 at,at,0x0 + *500314: 0081202d daddu a0,a0,at + *500318: 3c010000 lui at,0x0 + *50031c: 3c048076 lui a0,0x8076 + *500320: 24218000 addiu at,at,-32768 + *500324: 2484dc08 addiu a0,a0,-9208 + *500328: 0001083c dsll32 at,at,0x0 + *50032c: 0081202d daddu a0,a0,at + *500330: 3c010000 lui at,0x0 + *500334: 3c048076 lui a0,0x8076 + *500338: 24218000 addiu at,at,-32768 + *50033c: 2484d430 addiu a0,a0,-11216 + *500340: 0001083c dsll32 at,at,0x0 + *500344: 0081202d daddu a0,a0,at + *500348: 3c010000 lui at,0x0 + *50034c: 3c048076 lui a0,0x8076 + *500350: 24218000 addiu at,at,-32768 + *500354: 2484dc09 addiu a0,a0,-9207 + *500358: 0001083c dsll32 at,at,0x0 + *50035c: 0081202d daddu a0,a0,at + *500360: 3c010001 lui at,0x1 + *500364: 3c040001 lui a0,0x1 + *500368: 24210001 addiu at,at,1 + *50036c: 24840000 addiu a0,a0,0 + *500370: 0001083c dsll32 at,at,0x0 + *500374: 0081202d daddu a0,a0,at + *500378: 3c010001 lui at,0x1 + *50037c: 3c040066 lui a0,0x66 + *500380: 24210001 addiu at,at,1 + *500384: 24844320 addiu a0,a0,17184 + *500388: 0001083c dsll32 at,at,0x0 + *50038c: 0081202d daddu a0,a0,at + *500390: 3c010001 lui at,0x1 + *500394: 3c040066 lui a0,0x66 + *500398: 24210001 addiu at,at,1 + *50039c: 24844324 addiu a0,a0,17188 + *5003a0: 0001083c dsll32 at,at,0x0 + *5003a4: 0081202d daddu a0,a0,at + *5003a8: 3c010001 lui at,0x1 + *5003ac: 3c040066 lui a0,0x66 + *5003b0: 24210001 addiu at,at,1 + *5003b4: 24844330 addiu a0,a0,17200 + *5003b8: 0001083c dsll32 at,at,0x0 + *5003bc: 0081202d daddu a0,a0,at + *5003c0: 3c010001 lui at,0x1 + *5003c4: 3c040066 lui a0,0x66 + *5003c8: 24210001 addiu at,at,1 + *5003cc: 24844720 addiu a0,a0,18208 + *5003d0: 0001083c dsll32 at,at,0x0 + *5003d4: 0081202d daddu a0,a0,at + *5003d8: 3c010001 lui at,0x1 + *5003dc: 3c040077 lui a0,0x77 + *5003e0: 24210001 addiu at,at,1 + *5003e4: 24845820 addiu a0,a0,22560 + *5003e8: 0001083c dsll32 at,at,0x0 + *5003ec: 0081202d daddu a0,a0,at + *5003f0: 3c010001 lui at,0x1 + *5003f4: 3c040077 lui a0,0x77 + *5003f8: 24210001 addiu at,at,1 + *5003fc: 24845c08 addiu a0,a0,23560 + *500400: 0001083c dsll32 at,at,0x0 + *500404: 0081202d daddu a0,a0,at + *500408: 3c010001 lui at,0x1 + *50040c: 3c040077 lui a0,0x77 + *500410: 24210001 addiu at,at,1 + *500414: 24845430 addiu a0,a0,21552 + *500418: 0001083c dsll32 at,at,0x0 + *50041c: 0081202d daddu a0,a0,at + *500420: 3c010001 lui at,0x1 + *500424: 3c040077 lui a0,0x77 + *500428: 24210001 addiu at,at,1 + *50042c: 24845c09 addiu a0,a0,23561 + *500430: 0001083c dsll32 at,at,0x0 + *500434: 0081202d daddu a0,a0,at + *500438: 3c010002 lui at,0x2 + *50043c: 3c040002 lui a0,0x2 + *500440: 2421a5a5 addiu at,at,-23131 + *500444: 2484a5a5 addiu a0,a0,-23131 + *500448: 0001083c dsll32 at,at,0x0 + *50044c: 0081202d daddu a0,a0,at + *500450: 3c010002 lui at,0x2 + *500454: 3c040067 lui a0,0x67 + *500458: 2421a5a5 addiu at,at,-23131 + *50045c: 2484e8c5 addiu a0,a0,-5947 + *500460: 0001083c dsll32 at,at,0x0 + *500464: 0081202d daddu a0,a0,at + *500468: 3c010002 lui at,0x2 + *50046c: 3c040067 lui a0,0x67 + *500470: 2421a5a5 addiu at,at,-23131 + *500474: 2484e8c9 addiu a0,a0,-5943 + *500478: 0001083c dsll32 at,at,0x0 + *50047c: 0081202d daddu a0,a0,at + *500480: 3c010002 lui at,0x2 + *500484: 3c040067 lui a0,0x67 + *500488: 2421a5a5 addiu at,at,-23131 + *50048c: 2484e8d5 addiu a0,a0,-5931 + *500490: 0001083c dsll32 at,at,0x0 + *500494: 0081202d daddu a0,a0,at + *500498: 3c010002 lui at,0x2 + *50049c: 3c040067 lui a0,0x67 + *5004a0: 2421a5a5 addiu at,at,-23131 + *5004a4: 2484ecc5 addiu a0,a0,-4923 + *5004a8: 0001083c dsll32 at,at,0x0 + *5004ac: 0081202d daddu a0,a0,at + *5004b0: 3c010002 lui at,0x2 + *5004b4: 3c040078 lui a0,0x78 + *5004b8: 2421a5a5 addiu at,at,-23131 + *5004bc: 2484fdc5 addiu a0,a0,-571 + *5004c0: 0001083c dsll32 at,at,0x0 + *5004c4: 0081202d daddu a0,a0,at + *5004c8: 3c010002 lui at,0x2 + *5004cc: 3c040078 lui a0,0x78 + *5004d0: 2421a5a5 addiu at,at,-23131 + *5004d4: 248401ad addiu a0,a0,429 + *5004d8: 0001083c dsll32 at,at,0x0 + *5004dc: 0081202d daddu a0,a0,at + *5004e0: 3c010002 lui at,0x2 + *5004e4: 3c040078 lui a0,0x78 + *5004e8: 2421a5a5 addiu at,at,-23131 + *5004ec: 2484f9d5 addiu a0,a0,-1579 + *5004f0: 0001083c dsll32 at,at,0x0 + *5004f4: 0081202d daddu a0,a0,at + *5004f8: 3c010002 lui at,0x2 + *5004fc: 3c040078 lui a0,0x78 + *500500: 2421a5a5 addiu at,at,-23131 + *500504: 248401ae addiu a0,a0,430 + *500508: 0001083c dsll32 at,at,0x0 + *50050c: 0081202d daddu a0,a0,at + *500510: 3c010000 lui at,0x0 + *500514: 3c050000 lui a1,0x0 + *500518: 24210000 addiu at,at,0 + *50051c: 0001083c dsll32 at,at,0x0 + *500520: 00a1282d daddu a1,a1,at + *500524: 8ca40000 lw a0,0\(a1\) + *500528: 3c010000 lui at,0x0 + *50052c: 3c050065 lui a1,0x65 + *500530: 24210000 addiu at,at,0 + *500534: 0001083c dsll32 at,at,0x0 + *500538: 00a1282d daddu a1,a1,at + *50053c: 8ca44320 lw a0,17184\(a1\) + *500540: 3c010000 lui at,0x0 + *500544: 3c050065 lui a1,0x65 + *500548: 24210000 addiu at,at,0 + *50054c: 0001083c dsll32 at,at,0x0 + *500550: 00a1282d daddu a1,a1,at + *500554: 8ca44324 lw a0,17188\(a1\) + *500558: 3c010000 lui at,0x0 + *50055c: 3c050065 lui a1,0x65 + *500560: 24210000 addiu at,at,0 + *500564: 0001083c dsll32 at,at,0x0 + *500568: 00a1282d daddu a1,a1,at + *50056c: 8ca44330 lw a0,17200\(a1\) + *500570: 3c010000 lui at,0x0 + *500574: 3c050065 lui a1,0x65 + *500578: 24210000 addiu at,at,0 + *50057c: 0001083c dsll32 at,at,0x0 + *500580: 00a1282d daddu a1,a1,at + *500584: 8ca44720 lw a0,18208\(a1\) + *500588: 3c010000 lui at,0x0 + *50058c: 3c050076 lui a1,0x76 + *500590: 24210000 addiu at,at,0 + *500594: 0001083c dsll32 at,at,0x0 + *500598: 00a1282d daddu a1,a1,at + *50059c: 8ca45820 lw a0,22560\(a1\) + *5005a0: 3c010000 lui at,0x0 + *5005a4: 3c050076 lui a1,0x76 + *5005a8: 24210000 addiu at,at,0 + *5005ac: 0001083c dsll32 at,at,0x0 + *5005b0: 00a1282d daddu a1,a1,at + *5005b4: 8ca45c08 lw a0,23560\(a1\) + *5005b8: 3c010000 lui at,0x0 + *5005bc: 3c050076 lui a1,0x76 + *5005c0: 24210000 addiu at,at,0 + *5005c4: 0001083c dsll32 at,at,0x0 + *5005c8: 00a1282d daddu a1,a1,at + *5005cc: 8ca45430 lw a0,21552\(a1\) + *5005d0: 3c010000 lui at,0x0 + *5005d4: 3c050076 lui a1,0x76 + *5005d8: 24210000 addiu at,at,0 + *5005dc: 0001083c dsll32 at,at,0x0 + *5005e0: 00a1282d daddu a1,a1,at + *5005e4: 8ca45c09 lw a0,23561\(a1\) + *5005e8: 3c010000 lui at,0x0 + *5005ec: 3c050000 lui a1,0x0 + *5005f0: 24210000 addiu at,at,0 + *5005f4: 0001083c dsll32 at,at,0x0 + *5005f8: 00a1282d daddu a1,a1,at + *5005fc: 8ca40001 lw a0,1\(a1\) + *500600: 3c010000 lui at,0x0 + *500604: 3c050065 lui a1,0x65 + *500608: 24210000 addiu at,at,0 + *50060c: 0001083c dsll32 at,at,0x0 + *500610: 00a1282d daddu a1,a1,at + *500614: 8ca44321 lw a0,17185\(a1\) + *500618: 3c010000 lui at,0x0 + *50061c: 3c050065 lui a1,0x65 + *500620: 24210000 addiu at,at,0 + *500624: 0001083c dsll32 at,at,0x0 + *500628: 00a1282d daddu a1,a1,at + *50062c: 8ca44325 lw a0,17189\(a1\) + *500630: 3c010000 lui at,0x0 + *500634: 3c050065 lui a1,0x65 + *500638: 24210000 addiu at,at,0 + *50063c: 0001083c dsll32 at,at,0x0 + *500640: 00a1282d daddu a1,a1,at + *500644: 8ca44331 lw a0,17201\(a1\) + *500648: 3c010000 lui at,0x0 + *50064c: 3c050065 lui a1,0x65 + *500650: 24210000 addiu at,at,0 + *500654: 0001083c dsll32 at,at,0x0 + *500658: 00a1282d daddu a1,a1,at + *50065c: 8ca44721 lw a0,18209\(a1\) + *500660: 3c010000 lui at,0x0 + *500664: 3c050076 lui a1,0x76 + *500668: 24210000 addiu at,at,0 + *50066c: 0001083c dsll32 at,at,0x0 + *500670: 00a1282d daddu a1,a1,at + *500674: 8ca45821 lw a0,22561\(a1\) + *500678: 3c010000 lui at,0x0 + *50067c: 3c050076 lui a1,0x76 + *500680: 24210000 addiu at,at,0 + *500684: 0001083c dsll32 at,at,0x0 + *500688: 00a1282d daddu a1,a1,at + *50068c: 8ca45c09 lw a0,23561\(a1\) + *500690: 3c010000 lui at,0x0 + *500694: 3c050076 lui a1,0x76 + *500698: 24210000 addiu at,at,0 + *50069c: 0001083c dsll32 at,at,0x0 + *5006a0: 00a1282d daddu a1,a1,at + *5006a4: 8ca45431 lw a0,21553\(a1\) + *5006a8: 3c010000 lui at,0x0 + *5006ac: 3c050076 lui a1,0x76 + *5006b0: 24210000 addiu at,at,0 + *5006b4: 0001083c dsll32 at,at,0x0 + *5006b8: 00a1282d daddu a1,a1,at + *5006bc: 8ca45c0a lw a0,23562\(a1\) + *5006c0: 3c010001 lui at,0x1 + *5006c4: 3c058001 lui a1,0x8001 + *5006c8: 24218001 addiu at,at,-32767 + *5006cc: 0001083c dsll32 at,at,0x0 + *5006d0: 00a1282d daddu a1,a1,at + *5006d4: 8ca48000 lw a0,-32768\(a1\) + *5006d8: 3c010001 lui at,0x1 + *5006dc: 3c058066 lui a1,0x8066 + *5006e0: 24218001 addiu at,at,-32767 + *5006e4: 0001083c dsll32 at,at,0x0 + *5006e8: 00a1282d daddu a1,a1,at + *5006ec: 8ca4c320 lw a0,-15584\(a1\) + *5006f0: 3c010001 lui at,0x1 + *5006f4: 3c058066 lui a1,0x8066 + *5006f8: 24218001 addiu at,at,-32767 + *5006fc: 0001083c dsll32 at,at,0x0 + *500700: 00a1282d daddu a1,a1,at + *500704: 8ca4c324 lw a0,-15580\(a1\) + *500708: 3c010001 lui at,0x1 + *50070c: 3c058066 lui a1,0x8066 + *500710: 24218001 addiu at,at,-32767 + *500714: 0001083c dsll32 at,at,0x0 + *500718: 00a1282d daddu a1,a1,at + *50071c: 8ca4c330 lw a0,-15568\(a1\) + *500720: 3c010001 lui at,0x1 + *500724: 3c058066 lui a1,0x8066 + *500728: 24218001 addiu at,at,-32767 + *50072c: 0001083c dsll32 at,at,0x0 + *500730: 00a1282d daddu a1,a1,at + *500734: 8ca4c720 lw a0,-14560\(a1\) + *500738: 3c010001 lui at,0x1 + *50073c: 3c058077 lui a1,0x8077 + *500740: 24218001 addiu at,at,-32767 + *500744: 0001083c dsll32 at,at,0x0 + *500748: 00a1282d daddu a1,a1,at + *50074c: 8ca4d820 lw a0,-10208\(a1\) + *500750: 3c010001 lui at,0x1 + *500754: 3c058077 lui a1,0x8077 + *500758: 24218001 addiu at,at,-32767 + *50075c: 0001083c dsll32 at,at,0x0 + *500760: 00a1282d daddu a1,a1,at + *500764: 8ca4dc08 lw a0,-9208\(a1\) + *500768: 3c010001 lui at,0x1 + *50076c: 3c058077 lui a1,0x8077 + *500770: 24218001 addiu at,at,-32767 + *500774: 0001083c dsll32 at,at,0x0 + *500778: 00a1282d daddu a1,a1,at + *50077c: 8ca4d430 lw a0,-11216\(a1\) + *500780: 3c010001 lui at,0x1 + *500784: 3c058077 lui a1,0x8077 + *500788: 24218001 addiu at,at,-32767 + *50078c: 0001083c dsll32 at,at,0x0 + *500790: 00a1282d daddu a1,a1,at + *500794: 8ca4dc09 lw a0,-9207\(a1\) + *500798: 3c010000 lui at,0x0 + *50079c: 3c058000 lui a1,0x8000 + *5007a0: 24218000 addiu at,at,-32768 + *5007a4: 0001083c dsll32 at,at,0x0 + *5007a8: 00a1282d daddu a1,a1,at + *5007ac: 8ca48000 lw a0,-32768\(a1\) + *5007b0: 3c010000 lui at,0x0 + *5007b4: 3c058065 lui a1,0x8065 + *5007b8: 24218000 addiu at,at,-32768 + *5007bc: 0001083c dsll32 at,at,0x0 + *5007c0: 00a1282d daddu a1,a1,at + *5007c4: 8ca4c320 lw a0,-15584\(a1\) + *5007c8: 3c010000 lui at,0x0 + *5007cc: 3c058065 lui a1,0x8065 + *5007d0: 24218000 addiu at,at,-32768 + *5007d4: 0001083c dsll32 at,at,0x0 + *5007d8: 00a1282d daddu a1,a1,at + *5007dc: 8ca4c324 lw a0,-15580\(a1\) + *5007e0: 3c010000 lui at,0x0 + *5007e4: 3c058065 lui a1,0x8065 + *5007e8: 24218000 addiu at,at,-32768 + *5007ec: 0001083c dsll32 at,at,0x0 + *5007f0: 00a1282d daddu a1,a1,at + *5007f4: 8ca4c330 lw a0,-15568\(a1\) + *5007f8: 3c010000 lui at,0x0 + *5007fc: 3c058065 lui a1,0x8065 + *500800: 24218000 addiu at,at,-32768 + *500804: 0001083c dsll32 at,at,0x0 + *500808: 00a1282d daddu a1,a1,at + *50080c: 8ca4c720 lw a0,-14560\(a1\) + *500810: 3c010000 lui at,0x0 + *500814: 3c058076 lui a1,0x8076 + *500818: 24218000 addiu at,at,-32768 + *50081c: 0001083c dsll32 at,at,0x0 + *500820: 00a1282d daddu a1,a1,at + *500824: 8ca4d820 lw a0,-10208\(a1\) + *500828: 3c010000 lui at,0x0 + *50082c: 3c058076 lui a1,0x8076 + *500830: 24218000 addiu at,at,-32768 + *500834: 0001083c dsll32 at,at,0x0 + *500838: 00a1282d daddu a1,a1,at + *50083c: 8ca4dc08 lw a0,-9208\(a1\) + *500840: 3c010000 lui at,0x0 + *500844: 3c058076 lui a1,0x8076 + *500848: 24218000 addiu at,at,-32768 + *50084c: 0001083c dsll32 at,at,0x0 + *500850: 00a1282d daddu a1,a1,at + *500854: 8ca4d430 lw a0,-11216\(a1\) + *500858: 3c010000 lui at,0x0 + *50085c: 3c058076 lui a1,0x8076 + *500860: 24218000 addiu at,at,-32768 + *500864: 0001083c dsll32 at,at,0x0 + *500868: 00a1282d daddu a1,a1,at + *50086c: 8ca4dc09 lw a0,-9207\(a1\) + *500870: 3c010001 lui at,0x1 + *500874: 3c050001 lui a1,0x1 + *500878: 24210001 addiu at,at,1 + *50087c: 0001083c dsll32 at,at,0x0 + *500880: 00a1282d daddu a1,a1,at + *500884: 8ca40000 lw a0,0\(a1\) + *500888: 3c010001 lui at,0x1 + *50088c: 3c050066 lui a1,0x66 + *500890: 24210001 addiu at,at,1 + *500894: 0001083c dsll32 at,at,0x0 + *500898: 00a1282d daddu a1,a1,at + *50089c: 8ca44320 lw a0,17184\(a1\) + *5008a0: 3c010001 lui at,0x1 + *5008a4: 3c050066 lui a1,0x66 + *5008a8: 24210001 addiu at,at,1 + *5008ac: 0001083c dsll32 at,at,0x0 + *5008b0: 00a1282d daddu a1,a1,at + *5008b4: 8ca44324 lw a0,17188\(a1\) + *5008b8: 3c010001 lui at,0x1 + *5008bc: 3c050066 lui a1,0x66 + *5008c0: 24210001 addiu at,at,1 + *5008c4: 0001083c dsll32 at,at,0x0 + *5008c8: 00a1282d daddu a1,a1,at + *5008cc: 8ca44330 lw a0,17200\(a1\) + *5008d0: 3c010001 lui at,0x1 + *5008d4: 3c050066 lui a1,0x66 + *5008d8: 24210001 addiu at,at,1 + *5008dc: 0001083c dsll32 at,at,0x0 + *5008e0: 00a1282d daddu a1,a1,at + *5008e4: 8ca44720 lw a0,18208\(a1\) + *5008e8: 3c010001 lui at,0x1 + *5008ec: 3c050077 lui a1,0x77 + *5008f0: 24210001 addiu at,at,1 + *5008f4: 0001083c dsll32 at,at,0x0 + *5008f8: 00a1282d daddu a1,a1,at + *5008fc: 8ca45820 lw a0,22560\(a1\) + *500900: 3c010001 lui at,0x1 + *500904: 3c050077 lui a1,0x77 + *500908: 24210001 addiu at,at,1 + *50090c: 0001083c dsll32 at,at,0x0 + *500910: 00a1282d daddu a1,a1,at + *500914: 8ca45c08 lw a0,23560\(a1\) + *500918: 3c010001 lui at,0x1 + *50091c: 3c050077 lui a1,0x77 + *500920: 24210001 addiu at,at,1 + *500924: 0001083c dsll32 at,at,0x0 + *500928: 00a1282d daddu a1,a1,at + *50092c: 8ca45430 lw a0,21552\(a1\) + *500930: 3c010001 lui at,0x1 + *500934: 3c050077 lui a1,0x77 + *500938: 24210001 addiu at,at,1 + *50093c: 0001083c dsll32 at,at,0x0 + *500940: 00a1282d daddu a1,a1,at + *500944: 8ca45c09 lw a0,23561\(a1\) + *500948: 3c010002 lui at,0x2 + *50094c: 3c050002 lui a1,0x2 + *500950: 2421a5a5 addiu at,at,-23131 + *500954: 0001083c dsll32 at,at,0x0 + *500958: 00a1282d daddu a1,a1,at + *50095c: 8ca4a5a5 lw a0,-23131\(a1\) + *500960: 3c010002 lui at,0x2 + *500964: 3c050067 lui a1,0x67 + *500968: 2421a5a5 addiu at,at,-23131 + *50096c: 0001083c dsll32 at,at,0x0 + *500970: 00a1282d daddu a1,a1,at + *500974: 8ca4e8c5 lw a0,-5947\(a1\) + *500978: 3c010002 lui at,0x2 + *50097c: 3c050067 lui a1,0x67 + *500980: 2421a5a5 addiu at,at,-23131 + *500984: 0001083c dsll32 at,at,0x0 + *500988: 00a1282d daddu a1,a1,at + *50098c: 8ca4e8c9 lw a0,-5943\(a1\) + *500990: 3c010002 lui at,0x2 + *500994: 3c050067 lui a1,0x67 + *500998: 2421a5a5 addiu at,at,-23131 + *50099c: 0001083c dsll32 at,at,0x0 + *5009a0: 00a1282d daddu a1,a1,at + *5009a4: 8ca4e8d5 lw a0,-5931\(a1\) + *5009a8: 3c010002 lui at,0x2 + *5009ac: 3c050067 lui a1,0x67 + *5009b0: 2421a5a5 addiu at,at,-23131 + *5009b4: 0001083c dsll32 at,at,0x0 + *5009b8: 00a1282d daddu a1,a1,at + *5009bc: 8ca4ecc5 lw a0,-4923\(a1\) + *5009c0: 3c010002 lui at,0x2 + *5009c4: 3c050078 lui a1,0x78 + *5009c8: 2421a5a5 addiu at,at,-23131 + *5009cc: 0001083c dsll32 at,at,0x0 + *5009d0: 00a1282d daddu a1,a1,at + *5009d4: 8ca4fdc5 lw a0,-571\(a1\) + *5009d8: 3c010002 lui at,0x2 + *5009dc: 3c050078 lui a1,0x78 + *5009e0: 2421a5a5 addiu at,at,-23131 + *5009e4: 0001083c dsll32 at,at,0x0 + *5009e8: 00a1282d daddu a1,a1,at + *5009ec: 8ca401ad lw a0,429\(a1\) + *5009f0: 3c010002 lui at,0x2 + *5009f4: 3c050078 lui a1,0x78 + *5009f8: 2421a5a5 addiu at,at,-23131 + *5009fc: 0001083c dsll32 at,at,0x0 + *500a00: 00a1282d daddu a1,a1,at + *500a04: 8ca4f9d5 lw a0,-1579\(a1\) + *500a08: 3c010002 lui at,0x2 + *500a0c: 3c050078 lui a1,0x78 + *500a10: 2421a5a5 addiu at,at,-23131 + *500a14: 0001083c dsll32 at,at,0x0 + *500a18: 00a1282d daddu a1,a1,at + *500a1c: 8ca401ae lw a0,430\(a1\) + \.\.\. diff --git a/ld/testsuite/ld-mips-elf/mips-hilo-srec-n64.d b/ld/testsuite/ld-mips-elf/mips-hilo-srec-n64.d new file mode 100644 index 0000000..19ba44c --- /dev/null +++ b/ld/testsuite/ld-mips-elf/mips-hilo-srec-n64.d @@ -0,0 +1,6 @@ +#name: R_MIPS_HI16 and R_MIPS_LO16 relocs srec (n64) +#source: ../../../gas/testsuite/gas/mips/mips-hilo-n64.s +#source: mips-hilo.s +#objdump: -m mips:4000 -j .sec1 -D +#ld: --oformat=srec -Tmips-hilo.ld -e 0x500000 -N +#dump: mips-hilo-n64.d diff --git a/ld/testsuite/ld-mips-elf/mips-hilo-srec.d b/ld/testsuite/ld-mips-elf/mips-hilo-srec.d new file mode 100644 index 0000000..a6afb3f --- /dev/null +++ b/ld/testsuite/ld-mips-elf/mips-hilo-srec.d @@ -0,0 +1,6 @@ +#name: R_MIPS_HI16 and R_MIPS_LO16 relocs srec +#source: ../../../gas/testsuite/gas/mips/mips-hilo.s +#source: mips-hilo.s +#objdump: -m mips:4000 -j .sec1 -D +#ld: --oformat=srec -Tmips-hilo.ld -e 0x500000 -N +#dump: mips-hilo.d diff --git a/ld/testsuite/ld-mips-elf/mips-hilo.d b/ld/testsuite/ld-mips-elf/mips-hilo.d new file mode 100644 index 0000000..ae19f50 --- /dev/null +++ b/ld/testsuite/ld-mips-elf/mips-hilo.d @@ -0,0 +1,228 @@ +#name: R_MIPS_HI16 and R_MIPS_LO16 relocs +#source: ../../../gas/testsuite/gas/mips/mips-hilo.s +#source: mips-hilo.s +#objdump: -d +#ld: -Tmips-hilo.ld -e 0x500000 -N + +.*: file format (:?elf.*mips.*|srec) + +Disassembly of section \.(:?text|sec1): + +0*500000 <[^>]*>: + *500000: 3c040000 lui a0,0x0 + *500004: 24840000 addiu a0,a0,0 + *500008: 3c040065 lui a0,0x65 + *50000c: 24844320 addiu a0,a0,17184 + *500010: 3c040065 lui a0,0x65 + *500014: 24844324 addiu a0,a0,17188 + *500018: 3c040065 lui a0,0x65 + *50001c: 24844330 addiu a0,a0,17200 + *500020: 3c040065 lui a0,0x65 + *500024: 24844720 addiu a0,a0,18208 + *500028: 3c040076 lui a0,0x76 + *50002c: 24845820 addiu a0,a0,22560 + *500030: 3c040076 lui a0,0x76 + *500034: 24845c08 addiu a0,a0,23560 + *500038: 3c040076 lui a0,0x76 + *50003c: 24845430 addiu a0,a0,21552 + *500040: 3c040076 lui a0,0x76 + *500044: 24845c09 addiu a0,a0,23561 + *500048: 3c040000 lui a0,0x0 + *50004c: 24840001 addiu a0,a0,1 + *500050: 3c040065 lui a0,0x65 + *500054: 24844321 addiu a0,a0,17185 + *500058: 3c040065 lui a0,0x65 + *50005c: 24844325 addiu a0,a0,17189 + *500060: 3c040065 lui a0,0x65 + *500064: 24844331 addiu a0,a0,17201 + *500068: 3c040065 lui a0,0x65 + *50006c: 24844721 addiu a0,a0,18209 + *500070: 3c040076 lui a0,0x76 + *500074: 24845821 addiu a0,a0,22561 + *500078: 3c040076 lui a0,0x76 + *50007c: 24845c09 addiu a0,a0,23561 + *500080: 3c040076 lui a0,0x76 + *500084: 24845431 addiu a0,a0,21553 + *500088: 3c040076 lui a0,0x76 + *50008c: 24845c0a addiu a0,a0,23562 + *500090: 3c040001 lui a0,0x1 + *500094: 24848000 addiu a0,a0,-32768 + *500098: 3c040066 lui a0,0x66 + *50009c: 2484c320 addiu a0,a0,-15584 + *5000a0: 3c040066 lui a0,0x66 + *5000a4: 2484c324 addiu a0,a0,-15580 + *5000a8: 3c040066 lui a0,0x66 + *5000ac: 2484c330 addiu a0,a0,-15568 + *5000b0: 3c040066 lui a0,0x66 + *5000b4: 2484c720 addiu a0,a0,-14560 + *5000b8: 3c040077 lui a0,0x77 + *5000bc: 2484d820 addiu a0,a0,-10208 + *5000c0: 3c040077 lui a0,0x77 + *5000c4: 2484dc08 addiu a0,a0,-9208 + *5000c8: 3c040077 lui a0,0x77 + *5000cc: 2484d430 addiu a0,a0,-11216 + *5000d0: 3c040077 lui a0,0x77 + *5000d4: 2484dc09 addiu a0,a0,-9207 + *5000d8: 3c040000 lui a0,0x0 + *5000dc: 24848000 addiu a0,a0,-32768 + *5000e0: 3c040065 lui a0,0x65 + *5000e4: 2484c320 addiu a0,a0,-15584 + *5000e8: 3c040065 lui a0,0x65 + *5000ec: 2484c324 addiu a0,a0,-15580 + *5000f0: 3c040065 lui a0,0x65 + *5000f4: 2484c330 addiu a0,a0,-15568 + *5000f8: 3c040065 lui a0,0x65 + *5000fc: 2484c720 addiu a0,a0,-14560 + *500100: 3c040076 lui a0,0x76 + *500104: 2484d820 addiu a0,a0,-10208 + *500108: 3c040076 lui a0,0x76 + *50010c: 2484dc08 addiu a0,a0,-9208 + *500110: 3c040076 lui a0,0x76 + *500114: 2484d430 addiu a0,a0,-11216 + *500118: 3c040076 lui a0,0x76 + *50011c: 2484dc09 addiu a0,a0,-9207 + *500120: 3c040001 lui a0,0x1 + *500124: 24840000 addiu a0,a0,0 + *500128: 3c040066 lui a0,0x66 + *50012c: 24844320 addiu a0,a0,17184 + *500130: 3c040066 lui a0,0x66 + *500134: 24844324 addiu a0,a0,17188 + *500138: 3c040066 lui a0,0x66 + *50013c: 24844330 addiu a0,a0,17200 + *500140: 3c040066 lui a0,0x66 + *500144: 24844720 addiu a0,a0,18208 + *500148: 3c040077 lui a0,0x77 + *50014c: 24845820 addiu a0,a0,22560 + *500150: 3c040077 lui a0,0x77 + *500154: 24845c08 addiu a0,a0,23560 + *500158: 3c040077 lui a0,0x77 + *50015c: 24845430 addiu a0,a0,21552 + *500160: 3c040077 lui a0,0x77 + *500164: 24845c09 addiu a0,a0,23561 + *500168: 3c040002 lui a0,0x2 + *50016c: 2484a5a5 addiu a0,a0,-23131 + *500170: 3c040067 lui a0,0x67 + *500174: 2484e8c5 addiu a0,a0,-5947 + *500178: 3c040067 lui a0,0x67 + *50017c: 2484e8c9 addiu a0,a0,-5943 + *500180: 3c040067 lui a0,0x67 + *500184: 2484e8d5 addiu a0,a0,-5931 + *500188: 3c040067 lui a0,0x67 + *50018c: 2484ecc5 addiu a0,a0,-4923 + *500190: 3c040078 lui a0,0x78 + *500194: 2484fdc5 addiu a0,a0,-571 + *500198: 3c040078 lui a0,0x78 + *50019c: 248401ad addiu a0,a0,429 + *5001a0: 3c040078 lui a0,0x78 + *5001a4: 2484f9d5 addiu a0,a0,-1579 + *5001a8: 3c040078 lui a0,0x78 + *5001ac: 248401ae addiu a0,a0,430 + *5001b0: 3c050000 lui a1,0x0 + *5001b4: 8ca40000 lw a0,0\(a1\) + *5001b8: 3c050065 lui a1,0x65 + *5001bc: 8ca44320 lw a0,17184\(a1\) + *5001c0: 3c050065 lui a1,0x65 + *5001c4: 8ca44324 lw a0,17188\(a1\) + *5001c8: 3c050065 lui a1,0x65 + *5001cc: 8ca44330 lw a0,17200\(a1\) + *5001d0: 3c050065 lui a1,0x65 + *5001d4: 8ca44720 lw a0,18208\(a1\) + *5001d8: 3c050076 lui a1,0x76 + *5001dc: 8ca45820 lw a0,22560\(a1\) + *5001e0: 3c050076 lui a1,0x76 + *5001e4: 8ca45c08 lw a0,23560\(a1\) + *5001e8: 3c050076 lui a1,0x76 + *5001ec: 8ca45430 lw a0,21552\(a1\) + *5001f0: 3c050076 lui a1,0x76 + *5001f4: 8ca45c09 lw a0,23561\(a1\) + *5001f8: 3c050000 lui a1,0x0 + *5001fc: 8ca40001 lw a0,1\(a1\) + *500200: 3c050065 lui a1,0x65 + *500204: 8ca44321 lw a0,17185\(a1\) + *500208: 3c050065 lui a1,0x65 + *50020c: 8ca44325 lw a0,17189\(a1\) + *500210: 3c050065 lui a1,0x65 + *500214: 8ca44331 lw a0,17201\(a1\) + *500218: 3c050065 lui a1,0x65 + *50021c: 8ca44721 lw a0,18209\(a1\) + *500220: 3c050076 lui a1,0x76 + *500224: 8ca45821 lw a0,22561\(a1\) + *500228: 3c050076 lui a1,0x76 + *50022c: 8ca45c09 lw a0,23561\(a1\) + *500230: 3c050076 lui a1,0x76 + *500234: 8ca45431 lw a0,21553\(a1\) + *500238: 3c050076 lui a1,0x76 + *50023c: 8ca45c0a lw a0,23562\(a1\) + *500240: 3c050001 lui a1,0x1 + *500244: 8ca48000 lw a0,-32768\(a1\) + *500248: 3c050066 lui a1,0x66 + *50024c: 8ca4c320 lw a0,-15584\(a1\) + *500250: 3c050066 lui a1,0x66 + *500254: 8ca4c324 lw a0,-15580\(a1\) + *500258: 3c050066 lui a1,0x66 + *50025c: 8ca4c330 lw a0,-15568\(a1\) + *500260: 3c050066 lui a1,0x66 + *500264: 8ca4c720 lw a0,-14560\(a1\) + *500268: 3c050077 lui a1,0x77 + *50026c: 8ca4d820 lw a0,-10208\(a1\) + *500270: 3c050077 lui a1,0x77 + *500274: 8ca4dc08 lw a0,-9208\(a1\) + *500278: 3c050077 lui a1,0x77 + *50027c: 8ca4d430 lw a0,-11216\(a1\) + *500280: 3c050077 lui a1,0x77 + *500284: 8ca4dc09 lw a0,-9207\(a1\) + *500288: 3c050000 lui a1,0x0 + *50028c: 8ca48000 lw a0,-32768\(a1\) + *500290: 3c050065 lui a1,0x65 + *500294: 8ca4c320 lw a0,-15584\(a1\) + *500298: 3c050065 lui a1,0x65 + *50029c: 8ca4c324 lw a0,-15580\(a1\) + *5002a0: 3c050065 lui a1,0x65 + *5002a4: 8ca4c330 lw a0,-15568\(a1\) + *5002a8: 3c050065 lui a1,0x65 + *5002ac: 8ca4c720 lw a0,-14560\(a1\) + *5002b0: 3c050076 lui a1,0x76 + *5002b4: 8ca4d820 lw a0,-10208\(a1\) + *5002b8: 3c050076 lui a1,0x76 + *5002bc: 8ca4dc08 lw a0,-9208\(a1\) + *5002c0: 3c050076 lui a1,0x76 + *5002c4: 8ca4d430 lw a0,-11216\(a1\) + *5002c8: 3c050076 lui a1,0x76 + *5002cc: 8ca4dc09 lw a0,-9207\(a1\) + *5002d0: 3c050001 lui a1,0x1 + *5002d4: 8ca40000 lw a0,0\(a1\) + *5002d8: 3c050066 lui a1,0x66 + *5002dc: 8ca44320 lw a0,17184\(a1\) + *5002e0: 3c050066 lui a1,0x66 + *5002e4: 8ca44324 lw a0,17188\(a1\) + *5002e8: 3c050066 lui a1,0x66 + *5002ec: 8ca44330 lw a0,17200\(a1\) + *5002f0: 3c050066 lui a1,0x66 + *5002f4: 8ca44720 lw a0,18208\(a1\) + *5002f8: 3c050077 lui a1,0x77 + *5002fc: 8ca45820 lw a0,22560\(a1\) + *500300: 3c050077 lui a1,0x77 + *500304: 8ca45c08 lw a0,23560\(a1\) + *500308: 3c050077 lui a1,0x77 + *50030c: 8ca45430 lw a0,21552\(a1\) + *500310: 3c050077 lui a1,0x77 + *500314: 8ca45c09 lw a0,23561\(a1\) + *500318: 3c050002 lui a1,0x2 + *50031c: 8ca4a5a5 lw a0,-23131\(a1\) + *500320: 3c050067 lui a1,0x67 + *500324: 8ca4e8c5 lw a0,-5947\(a1\) + *500328: 3c050067 lui a1,0x67 + *50032c: 8ca4e8c9 lw a0,-5943\(a1\) + *500330: 3c050067 lui a1,0x67 + *500334: 8ca4e8d5 lw a0,-5931\(a1\) + *500338: 3c050067 lui a1,0x67 + *50033c: 8ca4ecc5 lw a0,-4923\(a1\) + *500340: 3c050078 lui a1,0x78 + *500344: 8ca4fdc5 lw a0,-571\(a1\) + *500348: 3c050078 lui a1,0x78 + *50034c: 8ca401ad lw a0,429\(a1\) + *500350: 3c050078 lui a1,0x78 + *500354: 8ca4f9d5 lw a0,-1579\(a1\) + *500358: 3c050078 lui a1,0x78 + *50035c: 8ca401ae lw a0,430\(a1\) + \.\.\. diff --git a/ld/testsuite/ld-mips-elf/mips16-hilo.ld b/ld/testsuite/ld-mips-elf/mips-hilo.ld index 1b54352..ce13411 100644 --- a/ld/testsuite/ld-mips-elf/mips16-hilo.ld +++ b/ld/testsuite/ld-mips-elf/mips-hilo.ld @@ -5,8 +5,9 @@ SECTIONS . = 0x0654320; .data : { *(.data) } .sdata : { *(.sdata) } + .MIPS.abiflags : { *(.MIPS.abiflags) } . = 0x0765430; .bss : { *(.bss) *(COMMON) } - .sbss : { *(.sbss) *(.scommon) } + .sbss : { *(.scommon) *(.sbss) } /DISCARD/ : { *(*) } } diff --git a/ld/testsuite/ld-mips-elf/mips-hilo.s b/ld/testsuite/ld-mips-elf/mips-hilo.s new file mode 100644 index 0000000..79ac2fb --- /dev/null +++ b/ld/testsuite/ld-mips-elf/mips-hilo.s @@ -0,0 +1,14 @@ + .data + .globl big_external_data_label +big_external_data_label: + .fill 1000 + +# align section end to 16-byte boundary for easier testing on multiple targets + .p2align 4 + + .globl small_external_data_label +small_external_data_label: + .fill 1 + +# align section end to 16-byte boundary for easier testing on multiple targets + .p2align 4 diff --git a/ld/testsuite/ld-mips-elf/mips16-hilo-n32.d b/ld/testsuite/ld-mips-elf/mips16-hilo-n32.d deleted file mode 100644 index 8d70b35..0000000 --- a/ld/testsuite/ld-mips-elf/mips16-hilo-n32.d +++ /dev/null @@ -1,337 +0,0 @@ -#name: R_MIPS16_HI16 and R_MIPS16_LO16 relocs n32 -#source: ../../../gas/testsuite/gas/mips/mips16-hilo.s -#source: mips16-hilo.s -#objdump: -mmips:16 --prefix-addresses -tdr --show-raw-insn -#ld: -Tmips16-hilo.ld -e 0x500000 -N - -.*: file format elf.*mips.* - -#... - -Disassembly of section .text: -0+500000 <[^>]*> 6c00 li a0,0 -0+500002 <[^>]*> f400 3480 sll a0,16 -0+500006 <[^>]*> 4c00 addiu a0,0 -0+500008 <[^>]*> f060 6c05 li a0,101 -0+50000c <[^>]*> f400 3480 sll a0,16 -0+500010 <[^>]*> f328 4c00 addiu a0,17184 -0+500014 <[^>]*> f060 6c05 li a0,101 -0+500018 <[^>]*> f400 3480 sll a0,16 -0+50001c <[^>]*> f328 4c04 addiu a0,17188 -0+500020 <[^>]*> f060 6c05 li a0,101 -0+500024 <[^>]*> f400 3480 sll a0,16 -0+500028 <[^>]*> f328 4c10 addiu a0,17200 -0+50002c <[^>]*> f060 6c05 li a0,101 -0+500030 <[^>]*> f400 3480 sll a0,16 -0+500034 <[^>]*> f728 4c00 addiu a0,18208 -0+500038 <[^>]*> f060 6c16 li a0,118 -0+50003c <[^>]*> f400 3480 sll a0,16 -0+500040 <[^>]*> f02b 4c00 addiu a0,22560 -0+500044 <[^>]*> f060 6c16 li a0,118 -0+500048 <[^>]*> f400 3480 sll a0,16 -0+50004c <[^>]*> f40b 4c09 addiu a0,23561 -0+500050 <[^>]*> f060 6c16 li a0,118 -0+500054 <[^>]*> f400 3480 sll a0,16 -0+500058 <[^>]*> f42a 4c10 addiu a0,21552 -0+50005c <[^>]*> f060 6c16 li a0,118 -0+500060 <[^>]*> f400 3480 sll a0,16 -0+500064 <[^>]*> f40b 4c08 addiu a0,23560 -0+500068 <[^>]*> 6c00 li a0,0 -0+50006a <[^>]*> f400 3480 sll a0,16 -0+50006e <[^>]*> 4c01 addiu a0,1 -0+500070 <[^>]*> f060 6c05 li a0,101 -0+500074 <[^>]*> f400 3480 sll a0,16 -0+500078 <[^>]*> f328 4c01 addiu a0,17185 -0+50007c <[^>]*> f060 6c05 li a0,101 -0+500080 <[^>]*> f400 3480 sll a0,16 -0+500084 <[^>]*> f328 4c05 addiu a0,17189 -0+500088 <[^>]*> f060 6c05 li a0,101 -0+50008c <[^>]*> f400 3480 sll a0,16 -0+500090 <[^>]*> f328 4c11 addiu a0,17201 -0+500094 <[^>]*> f060 6c05 li a0,101 -0+500098 <[^>]*> f400 3480 sll a0,16 -0+50009c <[^>]*> f728 4c01 addiu a0,18209 -0+5000a0 <[^>]*> f060 6c16 li a0,118 -0+5000a4 <[^>]*> f400 3480 sll a0,16 -0+5000a8 <[^>]*> f02b 4c01 addiu a0,22561 -0+5000ac <[^>]*> f060 6c16 li a0,118 -0+5000b0 <[^>]*> f400 3480 sll a0,16 -0+5000b4 <[^>]*> f40b 4c0a addiu a0,23562 -0+5000b8 <[^>]*> f060 6c16 li a0,118 -0+5000bc <[^>]*> f400 3480 sll a0,16 -0+5000c0 <[^>]*> f42a 4c11 addiu a0,21553 -0+5000c4 <[^>]*> f060 6c16 li a0,118 -0+5000c8 <[^>]*> f400 3480 sll a0,16 -0+5000cc <[^>]*> f40b 4c09 addiu a0,23561 -0+5000d0 <[^>]*> 6c01 li a0,1 -0+5000d2 <[^>]*> f400 3480 sll a0,16 -0+5000d6 <[^>]*> f010 4c00 addiu a0,-32768 -0+5000da <[^>]*> f060 6c06 li a0,102 -0+5000de <[^>]*> f400 3480 sll a0,16 -0+5000e2 <[^>]*> f338 4c00 addiu a0,-15584 -0+5000e6 <[^>]*> f060 6c06 li a0,102 -0+5000ea <[^>]*> f400 3480 sll a0,16 -0+5000ee <[^>]*> f338 4c04 addiu a0,-15580 -0+5000f2 <[^>]*> f060 6c06 li a0,102 -0+5000f6 <[^>]*> f400 3480 sll a0,16 -0+5000fa <[^>]*> f338 4c10 addiu a0,-15568 -0+5000fe <[^>]*> f060 6c06 li a0,102 -0+500102 <[^>]*> f400 3480 sll a0,16 -0+500106 <[^>]*> f738 4c00 addiu a0,-14560 -0+50010a <[^>]*> f060 6c17 li a0,119 -0+50010e <[^>]*> f400 3480 sll a0,16 -0+500112 <[^>]*> f03b 4c00 addiu a0,-10208 -0+500116 <[^>]*> f060 6c17 li a0,119 -0+50011a <[^>]*> f400 3480 sll a0,16 -0+50011e <[^>]*> f41b 4c09 addiu a0,-9207 -0+500122 <[^>]*> f060 6c17 li a0,119 -0+500126 <[^>]*> f400 3480 sll a0,16 -0+50012a <[^>]*> f43a 4c10 addiu a0,-11216 -0+50012e <[^>]*> f060 6c17 li a0,119 -0+500132 <[^>]*> f400 3480 sll a0,16 -0+500136 <[^>]*> f41b 4c08 addiu a0,-9208 -0+50013a <[^>]*> 6c00 li a0,0 -0+50013c <[^>]*> f400 3480 sll a0,16 -0+500140 <[^>]*> f010 4c00 addiu a0,-32768 -0+500144 <[^>]*> f060 6c05 li a0,101 -0+500148 <[^>]*> f400 3480 sll a0,16 -0+50014c <[^>]*> f338 4c00 addiu a0,-15584 -0+500150 <[^>]*> f060 6c05 li a0,101 -0+500154 <[^>]*> f400 3480 sll a0,16 -0+500158 <[^>]*> f338 4c04 addiu a0,-15580 -0+50015c <[^>]*> f060 6c05 li a0,101 -0+500160 <[^>]*> f400 3480 sll a0,16 -0+500164 <[^>]*> f338 4c10 addiu a0,-15568 -0+500168 <[^>]*> f060 6c05 li a0,101 -0+50016c <[^>]*> f400 3480 sll a0,16 -0+500170 <[^>]*> f738 4c00 addiu a0,-14560 -0+500174 <[^>]*> f060 6c16 li a0,118 -0+500178 <[^>]*> f400 3480 sll a0,16 -0+50017c <[^>]*> f03b 4c00 addiu a0,-10208 -0+500180 <[^>]*> f060 6c16 li a0,118 -0+500184 <[^>]*> f400 3480 sll a0,16 -0+500188 <[^>]*> f41b 4c09 addiu a0,-9207 -0+50018c <[^>]*> f060 6c16 li a0,118 -0+500190 <[^>]*> f400 3480 sll a0,16 -0+500194 <[^>]*> f43a 4c10 addiu a0,-11216 -0+500198 <[^>]*> f060 6c16 li a0,118 -0+50019c <[^>]*> f400 3480 sll a0,16 -0+5001a0 <[^>]*> f41b 4c08 addiu a0,-9208 -0+5001a4 <[^>]*> 6c01 li a0,1 -0+5001a6 <[^>]*> f400 3480 sll a0,16 -0+5001aa <[^>]*> 4c00 addiu a0,0 -0+5001ac <[^>]*> f060 6c06 li a0,102 -0+5001b0 <[^>]*> f400 3480 sll a0,16 -0+5001b4 <[^>]*> f328 4c00 addiu a0,17184 -0+5001b8 <[^>]*> f060 6c06 li a0,102 -0+5001bc <[^>]*> f400 3480 sll a0,16 -0+5001c0 <[^>]*> f328 4c04 addiu a0,17188 -0+5001c4 <[^>]*> f060 6c06 li a0,102 -0+5001c8 <[^>]*> f400 3480 sll a0,16 -0+5001cc <[^>]*> f328 4c10 addiu a0,17200 -0+5001d0 <[^>]*> f060 6c06 li a0,102 -0+5001d4 <[^>]*> f400 3480 sll a0,16 -0+5001d8 <[^>]*> f728 4c00 addiu a0,18208 -0+5001dc <[^>]*> f060 6c17 li a0,119 -0+5001e0 <[^>]*> f400 3480 sll a0,16 -0+5001e4 <[^>]*> f02b 4c00 addiu a0,22560 -0+5001e8 <[^>]*> f060 6c17 li a0,119 -0+5001ec <[^>]*> f400 3480 sll a0,16 -0+5001f0 <[^>]*> f40b 4c09 addiu a0,23561 -0+5001f4 <[^>]*> f060 6c17 li a0,119 -0+5001f8 <[^>]*> f400 3480 sll a0,16 -0+5001fc <[^>]*> f42a 4c10 addiu a0,21552 -0+500200 <[^>]*> f060 6c17 li a0,119 -0+500204 <[^>]*> f400 3480 sll a0,16 -0+500208 <[^>]*> f40b 4c08 addiu a0,23560 -0+50020c <[^>]*> 6c02 li a0,2 -0+50020e <[^>]*> f400 3480 sll a0,16 -0+500212 <[^>]*> f5b4 4c05 addiu a0,-23131 -0+500216 <[^>]*> f060 6c07 li a0,103 -0+50021a <[^>]*> f400 3480 sll a0,16 -0+50021e <[^>]*> f0dd 4c05 addiu a0,-5947 -0+500222 <[^>]*> f060 6c07 li a0,103 -0+500226 <[^>]*> f400 3480 sll a0,16 -0+50022a <[^>]*> f0dd 4c09 addiu a0,-5943 -0+50022e <[^>]*> f060 6c07 li a0,103 -0+500232 <[^>]*> f400 3480 sll a0,16 -0+500236 <[^>]*> f0dd 4c15 addiu a0,-5931 -0+50023a <[^>]*> f060 6c07 li a0,103 -0+50023e <[^>]*> f400 3480 sll a0,16 -0+500242 <[^>]*> f4dd 4c05 addiu a0,-4923 -0+500246 <[^>]*> f060 6c18 li a0,120 -0+50024a <[^>]*> f400 3480 sll a0,16 -0+50024e <[^>]*> f5df 4c05 addiu a0,-571 -0+500252 <[^>]*> f060 6c18 li a0,120 -0+500256 <[^>]*> f400 3480 sll a0,16 -0+50025a <[^>]*> f1a0 4c0e addiu a0,430 -0+50025e <[^>]*> f060 6c18 li a0,120 -0+500262 <[^>]*> f400 3480 sll a0,16 -0+500266 <[^>]*> f1df 4c15 addiu a0,-1579 -0+50026a <[^>]*> f060 6c18 li a0,120 -0+50026e <[^>]*> f400 3480 sll a0,16 -0+500272 <[^>]*> f1a0 4c0d addiu a0,429 -0+500276 <[^>]*> 6d00 li a1,0 -0+500278 <[^>]*> f400 35a0 sll a1,16 -0+50027c <[^>]*> 9d80 lw a0,0\(a1\) -0+50027e <[^>]*> f060 6d05 li a1,101 -0+500282 <[^>]*> f400 35a0 sll a1,16 -0+500286 <[^>]*> f060 9d85 lw a0,101\(a1\) -0+50028a <[^>]*> f060 6d05 li a1,101 -0+50028e <[^>]*> f400 35a0 sll a1,16 -0+500292 <[^>]*> f060 9d85 lw a0,101\(a1\) -0+500296 <[^>]*> f060 6d05 li a1,101 -0+50029a <[^>]*> f400 35a0 sll a1,16 -0+50029e <[^>]*> f328 9d90 lw a0,17200\(a1\) -0+5002a2 <[^>]*> f060 6d05 li a1,101 -0+5002a6 <[^>]*> f400 35a0 sll a1,16 -0+5002aa <[^>]*> f728 9d80 lw a0,18208\(a1\) -0+5002ae <[^>]*> f060 6d16 li a1,118 -0+5002b2 <[^>]*> f400 35a0 sll a1,16 -0+5002b6 <[^>]*> f02b 9d80 lw a0,22560\(a1\) -0+5002ba <[^>]*> f060 6d16 li a1,118 -0+5002be <[^>]*> f400 35a0 sll a1,16 -0+5002c2 <[^>]*> f40b 9d89 lw a0,23561\(a1\) -0+5002c6 <[^>]*> f060 6d16 li a1,118 -0+5002ca <[^>]*> f400 35a0 sll a1,16 -0+5002ce <[^>]*> f42a 9d90 lw a0,21552\(a1\) -0+5002d2 <[^>]*> f060 6d16 li a1,118 -0+5002d6 <[^>]*> f400 35a0 sll a1,16 -0+5002da <[^>]*> f40b 9d88 lw a0,23560\(a1\) -0+5002de <[^>]*> 6d00 li a1,0 -0+5002e0 <[^>]*> f400 35a0 sll a1,16 -0+5002e4 <[^>]*> f000 9d81 lw a0,1\(a1\) -0+5002e8 <[^>]*> f060 6d05 li a1,101 -0+5002ec <[^>]*> f400 35a0 sll a1,16 -0+5002f0 <[^>]*> f328 9d81 lw a0,17185\(a1\) -0+5002f4 <[^>]*> f060 6d05 li a1,101 -0+5002f8 <[^>]*> f400 35a0 sll a1,16 -0+5002fc <[^>]*> f328 9d85 lw a0,17189\(a1\) -0+500300 <[^>]*> f060 6d05 li a1,101 -0+500304 <[^>]*> f400 35a0 sll a1,16 -0+500308 <[^>]*> f328 9d91 lw a0,17201\(a1\) -0+50030c <[^>]*> f060 6d05 li a1,101 -0+500310 <[^>]*> f400 35a0 sll a1,16 -0+500314 <[^>]*> f728 9d81 lw a0,18209\(a1\) -0+500318 <[^>]*> f060 6d16 li a1,118 -0+50031c <[^>]*> f400 35a0 sll a1,16 -0+500320 <[^>]*> f02b 9d81 lw a0,22561\(a1\) -0+500324 <[^>]*> f060 6d16 li a1,118 -0+500328 <[^>]*> f400 35a0 sll a1,16 -0+50032c <[^>]*> f40b 9d8a lw a0,23562\(a1\) -0+500330 <[^>]*> f060 6d16 li a1,118 -0+500334 <[^>]*> f400 35a0 sll a1,16 -0+500338 <[^>]*> f42a 9d91 lw a0,21553\(a1\) -0+50033c <[^>]*> f060 6d16 li a1,118 -0+500340 <[^>]*> f400 35a0 sll a1,16 -0+500344 <[^>]*> f40b 9d89 lw a0,23561\(a1\) -0+500348 <[^>]*> 6d01 li a1,1 -0+50034a <[^>]*> f400 35a0 sll a1,16 -0+50034e <[^>]*> f010 9d80 lw a0,-32768\(a1\) -0+500352 <[^>]*> f060 6d06 li a1,102 -0+500356 <[^>]*> f400 35a0 sll a1,16 -0+50035a <[^>]*> f338 9d80 lw a0,-15584\(a1\) -0+50035e <[^>]*> f060 6d06 li a1,102 -0+500362 <[^>]*> f400 35a0 sll a1,16 -0+500366 <[^>]*> f338 9d84 lw a0,-15580\(a1\) -0+50036a <[^>]*> f060 6d06 li a1,102 -0+50036e <[^>]*> f400 35a0 sll a1,16 -0+500372 <[^>]*> f338 9d90 lw a0,-15568\(a1\) -0+500376 <[^>]*> f060 6d06 li a1,102 -0+50037a <[^>]*> f400 35a0 sll a1,16 -0+50037e <[^>]*> f738 9d80 lw a0,-14560\(a1\) -0+500382 <[^>]*> f060 6d17 li a1,119 -0+500386 <[^>]*> f400 35a0 sll a1,16 -0+50038a <[^>]*> f03b 9d80 lw a0,-10208\(a1\) -0+50038e <[^>]*> f060 6d17 li a1,119 -0+500392 <[^>]*> f400 35a0 sll a1,16 -0+500396 <[^>]*> f41b 9d89 lw a0,-9207\(a1\) -0+50039a <[^>]*> f060 6d17 li a1,119 -0+50039e <[^>]*> f400 35a0 sll a1,16 -0+5003a2 <[^>]*> f43a 9d90 lw a0,-11216\(a1\) -0+5003a6 <[^>]*> f060 6d17 li a1,119 -0+5003aa <[^>]*> f400 35a0 sll a1,16 -0+5003ae <[^>]*> f41b 9d88 lw a0,-9208\(a1\) -0+5003b2 <[^>]*> 6d00 li a1,0 -0+5003b4 <[^>]*> f400 35a0 sll a1,16 -0+5003b8 <[^>]*> f010 9d80 lw a0,-32768\(a1\) -0+5003bc <[^>]*> f060 6d05 li a1,101 -0+5003c0 <[^>]*> f400 35a0 sll a1,16 -0+5003c4 <[^>]*> f338 9d80 lw a0,-15584\(a1\) -0+5003c8 <[^>]*> f060 6d05 li a1,101 -0+5003cc <[^>]*> f400 35a0 sll a1,16 -0+5003d0 <[^>]*> f338 9d84 lw a0,-15580\(a1\) -0+5003d4 <[^>]*> f060 6d05 li a1,101 -0+5003d8 <[^>]*> f400 35a0 sll a1,16 -0+5003dc <[^>]*> f338 9d90 lw a0,-15568\(a1\) -0+5003e0 <[^>]*> f060 6d05 li a1,101 -0+5003e4 <[^>]*> f400 35a0 sll a1,16 -0+5003e8 <[^>]*> f738 9d80 lw a0,-14560\(a1\) -0+5003ec <[^>]*> f060 6d16 li a1,118 -0+5003f0 <[^>]*> f400 35a0 sll a1,16 -0+5003f4 <[^>]*> f03b 9d80 lw a0,-10208\(a1\) -0+5003f8 <[^>]*> f060 6d16 li a1,118 -0+5003fc <[^>]*> f400 35a0 sll a1,16 -0+500400 <[^>]*> f41b 9d89 lw a0,-9207\(a1\) -0+500404 <[^>]*> f060 6d16 li a1,118 -0+500408 <[^>]*> f400 35a0 sll a1,16 -0+50040c <[^>]*> f43a 9d90 lw a0,-11216\(a1\) -0+500410 <[^>]*> f060 6d16 li a1,118 -0+500414 <[^>]*> f400 35a0 sll a1,16 -0+500418 <[^>]*> f41b 9d88 lw a0,-9208\(a1\) -0+50041c <[^>]*> 6d01 li a1,1 -0+50041e <[^>]*> f400 35a0 sll a1,16 -0+500422 <[^>]*> 9d80 lw a0,0\(a1\) -0+500424 <[^>]*> f060 6d06 li a1,102 -0+500428 <[^>]*> f400 35a0 sll a1,16 -0+50042c <[^>]*> f328 9d80 lw a0,17184\(a1\) -0+500430 <[^>]*> f060 6d06 li a1,102 -0+500434 <[^>]*> f400 35a0 sll a1,16 -0+500438 <[^>]*> f328 9d84 lw a0,17188\(a1\) -0+50043c <[^>]*> f060 6d06 li a1,102 -0+500440 <[^>]*> f400 35a0 sll a1,16 -0+500444 <[^>]*> f328 9d90 lw a0,17200\(a1\) -0+500448 <[^>]*> f060 6d06 li a1,102 -0+50044c <[^>]*> f400 35a0 sll a1,16 -0+500450 <[^>]*> f728 9d80 lw a0,18208\(a1\) -0+500454 <[^>]*> f060 6d17 li a1,119 -0+500458 <[^>]*> f400 35a0 sll a1,16 -0+50045c <[^>]*> f02b 9d80 lw a0,22560\(a1\) -0+500460 <[^>]*> f060 6d17 li a1,119 -0+500464 <[^>]*> f400 35a0 sll a1,16 -0+500468 <[^>]*> f40b 9d89 lw a0,23561\(a1\) -0+50046c <[^>]*> f060 6d17 li a1,119 -0+500470 <[^>]*> f400 35a0 sll a1,16 -0+500474 <[^>]*> f42a 9d90 lw a0,21552\(a1\) -0+500478 <[^>]*> f060 6d17 li a1,119 -0+50047c <[^>]*> f400 35a0 sll a1,16 -0+500480 <[^>]*> f40b 9d88 lw a0,23560\(a1\) -0+500484 <[^>]*> 6d02 li a1,2 -0+500486 <[^>]*> f400 35a0 sll a1,16 -0+50048a <[^>]*> f5b4 9d85 lw a0,-23131\(a1\) -0+50048e <[^>]*> f060 6d07 li a1,103 -0+500492 <[^>]*> f400 35a0 sll a1,16 -0+500496 <[^>]*> f0dd 9d85 lw a0,-5947\(a1\) -0+50049a <[^>]*> f060 6d07 li a1,103 -0+50049e <[^>]*> f400 35a0 sll a1,16 -0+5004a2 <[^>]*> f0dd 9d89 lw a0,-5943\(a1\) -0+5004a6 <[^>]*> f060 6d07 li a1,103 -0+5004aa <[^>]*> f400 35a0 sll a1,16 -0+5004ae <[^>]*> f0dd 9d95 lw a0,-5931\(a1\) -0+5004b2 <[^>]*> f060 6d07 li a1,103 -0+5004b6 <[^>]*> f400 35a0 sll a1,16 -0+5004ba <[^>]*> f4dd 9d85 lw a0,-4923\(a1\) -0+5004be <[^>]*> f060 6d18 li a1,120 -0+5004c2 <[^>]*> f400 35a0 sll a1,16 -0+5004c6 <[^>]*> f5df 9d85 lw a0,-571\(a1\) -0+5004ca <[^>]*> f060 6d18 li a1,120 -0+5004ce <[^>]*> f400 35a0 sll a1,16 -0+5004d2 <[^>]*> f1a0 9d8e lw a0,430\(a1\) -0+5004d6 <[^>]*> f060 6d18 li a1,120 -0+5004da <[^>]*> f400 35a0 sll a1,16 -0+5004de <[^>]*> f1df 9d95 lw a0,-1579\(a1\) -0+5004e2 <[^>]*> f060 6d18 li a1,120 -0+5004e6 <[^>]*> f400 35a0 sll a1,16 -0+5004ea <[^>]*> f1a0 9d8d lw a0,429\(a1\) -0+5004ee <[^>]*> 6500 nop -#pass diff --git a/ld/testsuite/ld-mips-elf/mips16-hilo-srec.d b/ld/testsuite/ld-mips-elf/mips16-hilo-srec.d new file mode 100644 index 0000000..cd20d98 --- /dev/null +++ b/ld/testsuite/ld-mips-elf/mips16-hilo-srec.d @@ -0,0 +1,7 @@ +#name: R_MIPS16_HI16 and R_MIPS16_LO16 relocs srec +#source: ../../../gas/testsuite/gas/mips/mips16-hilo.s +#source: mips-hilo.s +#as: -march=mips3 +#objdump: -mmips:16 -j .sec1 -D +#ld: --oformat=srec -Tmips-hilo.ld -e 0x500000 -N +#dump: mips16-hilo.d diff --git a/ld/testsuite/ld-mips-elf/mips16-hilo.d b/ld/testsuite/ld-mips-elf/mips16-hilo.d index 5600983..3a8dc71 100644 --- a/ld/testsuite/ld-mips-elf/mips16-hilo.d +++ b/ld/testsuite/ld-mips-elf/mips16-hilo.d @@ -1,337 +1,338 @@ #name: R_MIPS16_HI16 and R_MIPS16_LO16 relocs #source: ../../../gas/testsuite/gas/mips/mips16-hilo.s -#source: mips16-hilo.s -#objdump: -mmips:16 --prefix-addresses -tdr --show-raw-insn -#ld: -Tmips16-hilo.ld -e 0x500000 -N +#source: mips-hilo.s +#as: -march=mips3 +#objdump: -mmips:16 -d +#ld: -Tmips-hilo.ld -e 0x500000 -N -.*: file format elf.*mips.* +.*: file format (:?elf.*mips.*|srec) -#... +Disassembly of section \.(:?text|sec1): -Disassembly of section .text: -0+500000 <[^>]*> 6c00 li a0,0 -0+500002 <[^>]*> f400 3480 sll a0,16 -0+500006 <[^>]*> 4c00 addiu a0,0 -0+500008 <[^>]*> f060 6c05 li a0,101 -0+50000c <[^>]*> f400 3480 sll a0,16 -0+500010 <[^>]*> f328 4c00 addiu a0,17184 -0+500014 <[^>]*> f060 6c05 li a0,101 -0+500018 <[^>]*> f400 3480 sll a0,16 -0+50001c <[^>]*> f328 4c04 addiu a0,17188 -0+500020 <[^>]*> f060 6c05 li a0,101 -0+500024 <[^>]*> f400 3480 sll a0,16 -0+500028 <[^>]*> f328 4c10 addiu a0,17200 -0+50002c <[^>]*> f060 6c05 li a0,101 -0+500030 <[^>]*> f400 3480 sll a0,16 -0+500034 <[^>]*> f728 4c00 addiu a0,18208 -0+500038 <[^>]*> f060 6c16 li a0,118 -0+50003c <[^>]*> f400 3480 sll a0,16 -0+500040 <[^>]*> f02b 4c00 addiu a0,22560 -0+500044 <[^>]*> f060 6c16 li a0,118 -0+500048 <[^>]*> f400 3480 sll a0,16 -0+50004c <[^>]*> f40b 4c09 addiu a0,23561 -0+500050 <[^>]*> f060 6c16 li a0,118 -0+500054 <[^>]*> f400 3480 sll a0,16 -0+500058 <[^>]*> f42a 4c10 addiu a0,21552 -0+50005c <[^>]*> f060 6c16 li a0,118 -0+500060 <[^>]*> f400 3480 sll a0,16 -0+500064 <[^>]*> f40b 4c08 addiu a0,23560 -0+500068 <[^>]*> 6c00 li a0,0 -0+50006a <[^>]*> f400 3480 sll a0,16 -0+50006e <[^>]*> 4c01 addiu a0,1 -0+500070 <[^>]*> f060 6c05 li a0,101 -0+500074 <[^>]*> f400 3480 sll a0,16 -0+500078 <[^>]*> f328 4c01 addiu a0,17185 -0+50007c <[^>]*> f060 6c05 li a0,101 -0+500080 <[^>]*> f400 3480 sll a0,16 -0+500084 <[^>]*> f328 4c05 addiu a0,17189 -0+500088 <[^>]*> f060 6c05 li a0,101 -0+50008c <[^>]*> f400 3480 sll a0,16 -0+500090 <[^>]*> f328 4c11 addiu a0,17201 -0+500094 <[^>]*> f060 6c05 li a0,101 -0+500098 <[^>]*> f400 3480 sll a0,16 -0+50009c <[^>]*> f728 4c01 addiu a0,18209 -0+5000a0 <[^>]*> f060 6c16 li a0,118 -0+5000a4 <[^>]*> f400 3480 sll a0,16 -0+5000a8 <[^>]*> f02b 4c01 addiu a0,22561 -0+5000ac <[^>]*> f060 6c16 li a0,118 -0+5000b0 <[^>]*> f400 3480 sll a0,16 -0+5000b4 <[^>]*> f40b 4c0a addiu a0,23562 -0+5000b8 <[^>]*> f060 6c16 li a0,118 -0+5000bc <[^>]*> f400 3480 sll a0,16 -0+5000c0 <[^>]*> f42a 4c11 addiu a0,21553 -0+5000c4 <[^>]*> f060 6c16 li a0,118 -0+5000c8 <[^>]*> f400 3480 sll a0,16 -0+5000cc <[^>]*> f40b 4c09 addiu a0,23561 -0+5000d0 <[^>]*> 6c01 li a0,1 -0+5000d2 <[^>]*> f400 3480 sll a0,16 -0+5000d6 <[^>]*> f010 4c00 addiu a0,-32768 -0+5000da <[^>]*> f060 6c06 li a0,102 -0+5000de <[^>]*> f400 3480 sll a0,16 -0+5000e2 <[^>]*> f338 4c00 addiu a0,-15584 -0+5000e6 <[^>]*> f060 6c06 li a0,102 -0+5000ea <[^>]*> f400 3480 sll a0,16 -0+5000ee <[^>]*> f338 4c04 addiu a0,-15580 -0+5000f2 <[^>]*> f060 6c06 li a0,102 -0+5000f6 <[^>]*> f400 3480 sll a0,16 -0+5000fa <[^>]*> f338 4c10 addiu a0,-15568 -0+5000fe <[^>]*> f060 6c06 li a0,102 -0+500102 <[^>]*> f400 3480 sll a0,16 -0+500106 <[^>]*> f738 4c00 addiu a0,-14560 -0+50010a <[^>]*> f060 6c17 li a0,119 -0+50010e <[^>]*> f400 3480 sll a0,16 -0+500112 <[^>]*> f03b 4c00 addiu a0,-10208 -0+500116 <[^>]*> f060 6c17 li a0,119 -0+50011a <[^>]*> f400 3480 sll a0,16 -0+50011e <[^>]*> f41b 4c09 addiu a0,-9207 -0+500122 <[^>]*> f060 6c17 li a0,119 -0+500126 <[^>]*> f400 3480 sll a0,16 -0+50012a <[^>]*> f43a 4c10 addiu a0,-11216 -0+50012e <[^>]*> f060 6c17 li a0,119 -0+500132 <[^>]*> f400 3480 sll a0,16 -0+500136 <[^>]*> f41b 4c08 addiu a0,-9208 -0+50013a <[^>]*> 6c00 li a0,0 -0+50013c <[^>]*> f400 3480 sll a0,16 -0+500140 <[^>]*> f010 4c00 addiu a0,-32768 -0+500144 <[^>]*> f060 6c05 li a0,101 -0+500148 <[^>]*> f400 3480 sll a0,16 -0+50014c <[^>]*> f338 4c00 addiu a0,-15584 -0+500150 <[^>]*> f060 6c05 li a0,101 -0+500154 <[^>]*> f400 3480 sll a0,16 -0+500158 <[^>]*> f338 4c04 addiu a0,-15580 -0+50015c <[^>]*> f060 6c05 li a0,101 -0+500160 <[^>]*> f400 3480 sll a0,16 -0+500164 <[^>]*> f338 4c10 addiu a0,-15568 -0+500168 <[^>]*> f060 6c05 li a0,101 -0+50016c <[^>]*> f400 3480 sll a0,16 -0+500170 <[^>]*> f738 4c00 addiu a0,-14560 -0+500174 <[^>]*> f060 6c16 li a0,118 -0+500178 <[^>]*> f400 3480 sll a0,16 -0+50017c <[^>]*> f03b 4c00 addiu a0,-10208 -0+500180 <[^>]*> f060 6c16 li a0,118 -0+500184 <[^>]*> f400 3480 sll a0,16 -0+500188 <[^>]*> f41b 4c09 addiu a0,-9207 -0+50018c <[^>]*> f060 6c16 li a0,118 -0+500190 <[^>]*> f400 3480 sll a0,16 -0+500194 <[^>]*> f43a 4c10 addiu a0,-11216 -0+500198 <[^>]*> f060 6c16 li a0,118 -0+50019c <[^>]*> f400 3480 sll a0,16 -0+5001a0 <[^>]*> f41b 4c08 addiu a0,-9208 -0+5001a4 <[^>]*> 6c01 li a0,1 -0+5001a6 <[^>]*> f400 3480 sll a0,16 -0+5001aa <[^>]*> 4c00 addiu a0,0 -0+5001ac <[^>]*> f060 6c06 li a0,102 -0+5001b0 <[^>]*> f400 3480 sll a0,16 -0+5001b4 <[^>]*> f328 4c00 addiu a0,17184 -0+5001b8 <[^>]*> f060 6c06 li a0,102 -0+5001bc <[^>]*> f400 3480 sll a0,16 -0+5001c0 <[^>]*> f328 4c04 addiu a0,17188 -0+5001c4 <[^>]*> f060 6c06 li a0,102 -0+5001c8 <[^>]*> f400 3480 sll a0,16 -0+5001cc <[^>]*> f328 4c10 addiu a0,17200 -0+5001d0 <[^>]*> f060 6c06 li a0,102 -0+5001d4 <[^>]*> f400 3480 sll a0,16 -0+5001d8 <[^>]*> f728 4c00 addiu a0,18208 -0+5001dc <[^>]*> f060 6c17 li a0,119 -0+5001e0 <[^>]*> f400 3480 sll a0,16 -0+5001e4 <[^>]*> f02b 4c00 addiu a0,22560 -0+5001e8 <[^>]*> f060 6c17 li a0,119 -0+5001ec <[^>]*> f400 3480 sll a0,16 -0+5001f0 <[^>]*> f40b 4c09 addiu a0,23561 -0+5001f4 <[^>]*> f060 6c17 li a0,119 -0+5001f8 <[^>]*> f400 3480 sll a0,16 -0+5001fc <[^>]*> f42a 4c10 addiu a0,21552 -0+500200 <[^>]*> f060 6c17 li a0,119 -0+500204 <[^>]*> f400 3480 sll a0,16 -0+500208 <[^>]*> f40b 4c08 addiu a0,23560 -0+50020c <[^>]*> 6c02 li a0,2 -0+50020e <[^>]*> f400 3480 sll a0,16 -0+500212 <[^>]*> f5b4 4c05 addiu a0,-23131 -0+500216 <[^>]*> f060 6c07 li a0,103 -0+50021a <[^>]*> f400 3480 sll a0,16 -0+50021e <[^>]*> f0dd 4c05 addiu a0,-5947 -0+500222 <[^>]*> f060 6c07 li a0,103 -0+500226 <[^>]*> f400 3480 sll a0,16 -0+50022a <[^>]*> f0dd 4c09 addiu a0,-5943 -0+50022e <[^>]*> f060 6c07 li a0,103 -0+500232 <[^>]*> f400 3480 sll a0,16 -0+500236 <[^>]*> f0dd 4c15 addiu a0,-5931 -0+50023a <[^>]*> f060 6c07 li a0,103 -0+50023e <[^>]*> f400 3480 sll a0,16 -0+500242 <[^>]*> f4dd 4c05 addiu a0,-4923 -0+500246 <[^>]*> f060 6c18 li a0,120 -0+50024a <[^>]*> f400 3480 sll a0,16 -0+50024e <[^>]*> f5df 4c05 addiu a0,-571 -0+500252 <[^>]*> f060 6c18 li a0,120 -0+500256 <[^>]*> f400 3480 sll a0,16 -0+50025a <[^>]*> f1a0 4c0e addiu a0,430 -0+50025e <[^>]*> f060 6c18 li a0,120 -0+500262 <[^>]*> f400 3480 sll a0,16 -0+500266 <[^>]*> f1df 4c15 addiu a0,-1579 -0+50026a <[^>]*> f060 6c18 li a0,120 -0+50026e <[^>]*> f400 3480 sll a0,16 -0+500272 <[^>]*> f1a0 4c0d addiu a0,429 -0+500276 <[^>]*> 6d00 li a1,0 -0+500278 <[^>]*> f400 35a0 sll a1,16 -0+50027c <[^>]*> 9d80 lw a0,0\(a1\) -0+50027e <[^>]*> f060 6d05 li a1,101 -0+500282 <[^>]*> f400 35a0 sll a1,16 -0+500286 <[^>]*> f060 9d85 lw a0,101\(a1\) -0+50028a <[^>]*> f060 6d05 li a1,101 -0+50028e <[^>]*> f400 35a0 sll a1,16 -0+500292 <[^>]*> f060 9d85 lw a0,101\(a1\) -0+500296 <[^>]*> f060 6d05 li a1,101 -0+50029a <[^>]*> f400 35a0 sll a1,16 -0+50029e <[^>]*> f328 9d90 lw a0,17200\(a1\) -0+5002a2 <[^>]*> f060 6d05 li a1,101 -0+5002a6 <[^>]*> f400 35a0 sll a1,16 -0+5002aa <[^>]*> f728 9d80 lw a0,18208\(a1\) -0+5002ae <[^>]*> f060 6d16 li a1,118 -0+5002b2 <[^>]*> f400 35a0 sll a1,16 -0+5002b6 <[^>]*> f02b 9d80 lw a0,22560\(a1\) -0+5002ba <[^>]*> f060 6d16 li a1,118 -0+5002be <[^>]*> f400 35a0 sll a1,16 -0+5002c2 <[^>]*> f40b 9d89 lw a0,23561\(a1\) -0+5002c6 <[^>]*> f060 6d16 li a1,118 -0+5002ca <[^>]*> f400 35a0 sll a1,16 -0+5002ce <[^>]*> f42a 9d90 lw a0,21552\(a1\) -0+5002d2 <[^>]*> f060 6d16 li a1,118 -0+5002d6 <[^>]*> f400 35a0 sll a1,16 -0+5002da <[^>]*> f40b 9d88 lw a0,23560\(a1\) -0+5002de <[^>]*> 6d00 li a1,0 -0+5002e0 <[^>]*> f400 35a0 sll a1,16 -0+5002e4 <[^>]*> f000 9d81 lw a0,1\(a1\) -0+5002e8 <[^>]*> f060 6d05 li a1,101 -0+5002ec <[^>]*> f400 35a0 sll a1,16 -0+5002f0 <[^>]*> f328 9d81 lw a0,17185\(a1\) -0+5002f4 <[^>]*> f060 6d05 li a1,101 -0+5002f8 <[^>]*> f400 35a0 sll a1,16 -0+5002fc <[^>]*> f328 9d85 lw a0,17189\(a1\) -0+500300 <[^>]*> f060 6d05 li a1,101 -0+500304 <[^>]*> f400 35a0 sll a1,16 -0+500308 <[^>]*> f328 9d91 lw a0,17201\(a1\) -0+50030c <[^>]*> f060 6d05 li a1,101 -0+500310 <[^>]*> f400 35a0 sll a1,16 -0+500314 <[^>]*> f728 9d81 lw a0,18209\(a1\) -0+500318 <[^>]*> f060 6d16 li a1,118 -0+50031c <[^>]*> f400 35a0 sll a1,16 -0+500320 <[^>]*> f02b 9d81 lw a0,22561\(a1\) -0+500324 <[^>]*> f060 6d16 li a1,118 -0+500328 <[^>]*> f400 35a0 sll a1,16 -0+50032c <[^>]*> f40b 9d8a lw a0,23562\(a1\) -0+500330 <[^>]*> f060 6d16 li a1,118 -0+500334 <[^>]*> f400 35a0 sll a1,16 -0+500338 <[^>]*> f42a 9d91 lw a0,21553\(a1\) -0+50033c <[^>]*> f060 6d16 li a1,118 -0+500340 <[^>]*> f400 35a0 sll a1,16 -0+500344 <[^>]*> f40b 9d89 lw a0,23561\(a1\) -0+500348 <[^>]*> 6d01 li a1,1 -0+50034a <[^>]*> f400 35a0 sll a1,16 -0+50034e <[^>]*> f010 9d80 lw a0,-32768\(a1\) -0+500352 <[^>]*> f060 6d06 li a1,102 -0+500356 <[^>]*> f400 35a0 sll a1,16 -0+50035a <[^>]*> f338 9d80 lw a0,-15584\(a1\) -0+50035e <[^>]*> f060 6d06 li a1,102 -0+500362 <[^>]*> f400 35a0 sll a1,16 -0+500366 <[^>]*> f338 9d84 lw a0,-15580\(a1\) -0+50036a <[^>]*> f060 6d06 li a1,102 -0+50036e <[^>]*> f400 35a0 sll a1,16 -0+500372 <[^>]*> f338 9d90 lw a0,-15568\(a1\) -0+500376 <[^>]*> f060 6d06 li a1,102 -0+50037a <[^>]*> f400 35a0 sll a1,16 -0+50037e <[^>]*> f738 9d80 lw a0,-14560\(a1\) -0+500382 <[^>]*> f060 6d17 li a1,119 -0+500386 <[^>]*> f400 35a0 sll a1,16 -0+50038a <[^>]*> f03b 9d80 lw a0,-10208\(a1\) -0+50038e <[^>]*> f060 6d17 li a1,119 -0+500392 <[^>]*> f400 35a0 sll a1,16 -0+500396 <[^>]*> f41b 9d89 lw a0,-9207\(a1\) -0+50039a <[^>]*> f060 6d17 li a1,119 -0+50039e <[^>]*> f400 35a0 sll a1,16 -0+5003a2 <[^>]*> f43a 9d90 lw a0,-11216\(a1\) -0+5003a6 <[^>]*> f060 6d17 li a1,119 -0+5003aa <[^>]*> f400 35a0 sll a1,16 -0+5003ae <[^>]*> f41b 9d88 lw a0,-9208\(a1\) -0+5003b2 <[^>]*> 6d00 li a1,0 -0+5003b4 <[^>]*> f400 35a0 sll a1,16 -0+5003b8 <[^>]*> f010 9d80 lw a0,-32768\(a1\) -0+5003bc <[^>]*> f060 6d05 li a1,101 -0+5003c0 <[^>]*> f400 35a0 sll a1,16 -0+5003c4 <[^>]*> f338 9d80 lw a0,-15584\(a1\) -0+5003c8 <[^>]*> f060 6d05 li a1,101 -0+5003cc <[^>]*> f400 35a0 sll a1,16 -0+5003d0 <[^>]*> f338 9d84 lw a0,-15580\(a1\) -0+5003d4 <[^>]*> f060 6d05 li a1,101 -0+5003d8 <[^>]*> f400 35a0 sll a1,16 -0+5003dc <[^>]*> f338 9d90 lw a0,-15568\(a1\) -0+5003e0 <[^>]*> f060 6d05 li a1,101 -0+5003e4 <[^>]*> f400 35a0 sll a1,16 -0+5003e8 <[^>]*> f738 9d80 lw a0,-14560\(a1\) -0+5003ec <[^>]*> f060 6d16 li a1,118 -0+5003f0 <[^>]*> f400 35a0 sll a1,16 -0+5003f4 <[^>]*> f03b 9d80 lw a0,-10208\(a1\) -0+5003f8 <[^>]*> f060 6d16 li a1,118 -0+5003fc <[^>]*> f400 35a0 sll a1,16 -0+500400 <[^>]*> f41b 9d89 lw a0,-9207\(a1\) -0+500404 <[^>]*> f060 6d16 li a1,118 -0+500408 <[^>]*> f400 35a0 sll a1,16 -0+50040c <[^>]*> f43a 9d90 lw a0,-11216\(a1\) -0+500410 <[^>]*> f060 6d16 li a1,118 -0+500414 <[^>]*> f400 35a0 sll a1,16 -0+500418 <[^>]*> f41b 9d88 lw a0,-9208\(a1\) -0+50041c <[^>]*> 6d01 li a1,1 -0+50041e <[^>]*> f400 35a0 sll a1,16 -0+500422 <[^>]*> 9d80 lw a0,0\(a1\) -0+500424 <[^>]*> f060 6d06 li a1,102 -0+500428 <[^>]*> f400 35a0 sll a1,16 -0+50042c <[^>]*> f328 9d80 lw a0,17184\(a1\) -0+500430 <[^>]*> f060 6d06 li a1,102 -0+500434 <[^>]*> f400 35a0 sll a1,16 -0+500438 <[^>]*> f328 9d84 lw a0,17188\(a1\) -0+50043c <[^>]*> f060 6d06 li a1,102 -0+500440 <[^>]*> f400 35a0 sll a1,16 -0+500444 <[^>]*> f328 9d90 lw a0,17200\(a1\) -0+500448 <[^>]*> f060 6d06 li a1,102 -0+50044c <[^>]*> f400 35a0 sll a1,16 -0+500450 <[^>]*> f728 9d80 lw a0,18208\(a1\) -0+500454 <[^>]*> f060 6d17 li a1,119 -0+500458 <[^>]*> f400 35a0 sll a1,16 -0+50045c <[^>]*> f02b 9d80 lw a0,22560\(a1\) -0+500460 <[^>]*> f060 6d17 li a1,119 -0+500464 <[^>]*> f400 35a0 sll a1,16 -0+500468 <[^>]*> f40b 9d89 lw a0,23561\(a1\) -0+50046c <[^>]*> f060 6d17 li a1,119 -0+500470 <[^>]*> f400 35a0 sll a1,16 -0+500474 <[^>]*> f42a 9d90 lw a0,21552\(a1\) -0+500478 <[^>]*> f060 6d17 li a1,119 -0+50047c <[^>]*> f400 35a0 sll a1,16 -0+500480 <[^>]*> f40b 9d88 lw a0,23560\(a1\) -0+500484 <[^>]*> 6d02 li a1,2 -0+500486 <[^>]*> f400 35a0 sll a1,16 -0+50048a <[^>]*> f5b4 9d85 lw a0,-23131\(a1\) -0+50048e <[^>]*> f060 6d07 li a1,103 -0+500492 <[^>]*> f400 35a0 sll a1,16 -0+500496 <[^>]*> f0dd 9d85 lw a0,-5947\(a1\) -0+50049a <[^>]*> f060 6d07 li a1,103 -0+50049e <[^>]*> f400 35a0 sll a1,16 -0+5004a2 <[^>]*> f0dd 9d89 lw a0,-5943\(a1\) -0+5004a6 <[^>]*> f060 6d07 li a1,103 -0+5004aa <[^>]*> f400 35a0 sll a1,16 -0+5004ae <[^>]*> f0dd 9d95 lw a0,-5931\(a1\) -0+5004b2 <[^>]*> f060 6d07 li a1,103 -0+5004b6 <[^>]*> f400 35a0 sll a1,16 -0+5004ba <[^>]*> f4dd 9d85 lw a0,-4923\(a1\) -0+5004be <[^>]*> f060 6d18 li a1,120 -0+5004c2 <[^>]*> f400 35a0 sll a1,16 -0+5004c6 <[^>]*> f5df 9d85 lw a0,-571\(a1\) -0+5004ca <[^>]*> f060 6d18 li a1,120 -0+5004ce <[^>]*> f400 35a0 sll a1,16 -0+5004d2 <[^>]*> f1a0 9d8e lw a0,430\(a1\) -0+5004d6 <[^>]*> f060 6d18 li a1,120 -0+5004da <[^>]*> f400 35a0 sll a1,16 -0+5004de <[^>]*> f1df 9d95 lw a0,-1579\(a1\) -0+5004e2 <[^>]*> f060 6d18 li a1,120 -0+5004e6 <[^>]*> f400 35a0 sll a1,16 -0+5004ea <[^>]*> f1a0 9d8d lw a0,429\(a1\) -0+5004ee <[^>]*> 6500 nop +0*500000 <[^>]*>: + *500000: 6c00 li a0,0 + *500002: f400 3480 sll a0,16 + *500006: 4c00 addiu a0,0 + *500008: f060 6c05 li a0,101 + *50000c: f400 3480 sll a0,16 + *500010: f328 4c00 addiu a0,17184 + *500014: f060 6c05 li a0,101 + *500018: f400 3480 sll a0,16 + *50001c: f328 4c04 addiu a0,17188 + *500020: f060 6c05 li a0,101 + *500024: f400 3480 sll a0,16 + *500028: f328 4c10 addiu a0,17200 + *50002c: f060 6c05 li a0,101 + *500030: f400 3480 sll a0,16 + *500034: f728 4c00 addiu a0,18208 + *500038: f060 6c16 li a0,118 + *50003c: f400 3480 sll a0,16 + *500040: f02b 4c00 addiu a0,22560 + *500044: f060 6c16 li a0,118 + *500048: f400 3480 sll a0,16 + *50004c: f40b 4c08 addiu a0,23560 + *500050: f060 6c16 li a0,118 + *500054: f400 3480 sll a0,16 + *500058: f42a 4c10 addiu a0,21552 + *50005c: f060 6c16 li a0,118 + *500060: f400 3480 sll a0,16 + *500064: f40b 4c09 addiu a0,23561 + *500068: 6c00 li a0,0 + *50006a: f400 3480 sll a0,16 + *50006e: 4c01 addiu a0,1 + *500070: f060 6c05 li a0,101 + *500074: f400 3480 sll a0,16 + *500078: f328 4c01 addiu a0,17185 + *50007c: f060 6c05 li a0,101 + *500080: f400 3480 sll a0,16 + *500084: f328 4c05 addiu a0,17189 + *500088: f060 6c05 li a0,101 + *50008c: f400 3480 sll a0,16 + *500090: f328 4c11 addiu a0,17201 + *500094: f060 6c05 li a0,101 + *500098: f400 3480 sll a0,16 + *50009c: f728 4c01 addiu a0,18209 + *5000a0: f060 6c16 li a0,118 + *5000a4: f400 3480 sll a0,16 + *5000a8: f02b 4c01 addiu a0,22561 + *5000ac: f060 6c16 li a0,118 + *5000b0: f400 3480 sll a0,16 + *5000b4: f40b 4c09 addiu a0,23561 + *5000b8: f060 6c16 li a0,118 + *5000bc: f400 3480 sll a0,16 + *5000c0: f42a 4c11 addiu a0,21553 + *5000c4: f060 6c16 li a0,118 + *5000c8: f400 3480 sll a0,16 + *5000cc: f40b 4c0a addiu a0,23562 + *5000d0: 6c01 li a0,1 + *5000d2: f400 3480 sll a0,16 + *5000d6: f010 4c00 addiu a0,-32768 + *5000da: f060 6c06 li a0,102 + *5000de: f400 3480 sll a0,16 + *5000e2: f338 4c00 addiu a0,-15584 + *5000e6: f060 6c06 li a0,102 + *5000ea: f400 3480 sll a0,16 + *5000ee: f338 4c04 addiu a0,-15580 + *5000f2: f060 6c06 li a0,102 + *5000f6: f400 3480 sll a0,16 + *5000fa: f338 4c10 addiu a0,-15568 + *5000fe: f060 6c06 li a0,102 + *500102: f400 3480 sll a0,16 + *500106: f738 4c00 addiu a0,-14560 + *50010a: f060 6c17 li a0,119 + *50010e: f400 3480 sll a0,16 + *500112: f03b 4c00 addiu a0,-10208 + *500116: f060 6c17 li a0,119 + *50011a: f400 3480 sll a0,16 + *50011e: f41b 4c08 addiu a0,-9208 + *500122: f060 6c17 li a0,119 + *500126: f400 3480 sll a0,16 + *50012a: f43a 4c10 addiu a0,-11216 + *50012e: f060 6c17 li a0,119 + *500132: f400 3480 sll a0,16 + *500136: f41b 4c09 addiu a0,-9207 + *50013a: 6c00 li a0,0 + *50013c: f400 3480 sll a0,16 + *500140: f010 4c00 addiu a0,-32768 + *500144: f060 6c05 li a0,101 + *500148: f400 3480 sll a0,16 + *50014c: f338 4c00 addiu a0,-15584 + *500150: f060 6c05 li a0,101 + *500154: f400 3480 sll a0,16 + *500158: f338 4c04 addiu a0,-15580 + *50015c: f060 6c05 li a0,101 + *500160: f400 3480 sll a0,16 + *500164: f338 4c10 addiu a0,-15568 + *500168: f060 6c05 li a0,101 + *50016c: f400 3480 sll a0,16 + *500170: f738 4c00 addiu a0,-14560 + *500174: f060 6c16 li a0,118 + *500178: f400 3480 sll a0,16 + *50017c: f03b 4c00 addiu a0,-10208 + *500180: f060 6c16 li a0,118 + *500184: f400 3480 sll a0,16 + *500188: f41b 4c08 addiu a0,-9208 + *50018c: f060 6c16 li a0,118 + *500190: f400 3480 sll a0,16 + *500194: f43a 4c10 addiu a0,-11216 + *500198: f060 6c16 li a0,118 + *50019c: f400 3480 sll a0,16 + *5001a0: f41b 4c09 addiu a0,-9207 + *5001a4: 6c01 li a0,1 + *5001a6: f400 3480 sll a0,16 + *5001aa: 4c00 addiu a0,0 + *5001ac: f060 6c06 li a0,102 + *5001b0: f400 3480 sll a0,16 + *5001b4: f328 4c00 addiu a0,17184 + *5001b8: f060 6c06 li a0,102 + *5001bc: f400 3480 sll a0,16 + *5001c0: f328 4c04 addiu a0,17188 + *5001c4: f060 6c06 li a0,102 + *5001c8: f400 3480 sll a0,16 + *5001cc: f328 4c10 addiu a0,17200 + *5001d0: f060 6c06 li a0,102 + *5001d4: f400 3480 sll a0,16 + *5001d8: f728 4c00 addiu a0,18208 + *5001dc: f060 6c17 li a0,119 + *5001e0: f400 3480 sll a0,16 + *5001e4: f02b 4c00 addiu a0,22560 + *5001e8: f060 6c17 li a0,119 + *5001ec: f400 3480 sll a0,16 + *5001f0: f40b 4c08 addiu a0,23560 + *5001f4: f060 6c17 li a0,119 + *5001f8: f400 3480 sll a0,16 + *5001fc: f42a 4c10 addiu a0,21552 + *500200: f060 6c17 li a0,119 + *500204: f400 3480 sll a0,16 + *500208: f40b 4c09 addiu a0,23561 + *50020c: 6c02 li a0,2 + *50020e: f400 3480 sll a0,16 + *500212: f5b4 4c05 addiu a0,-23131 + *500216: f060 6c07 li a0,103 + *50021a: f400 3480 sll a0,16 + *50021e: f0dd 4c05 addiu a0,-5947 + *500222: f060 6c07 li a0,103 + *500226: f400 3480 sll a0,16 + *50022a: f0dd 4c09 addiu a0,-5943 + *50022e: f060 6c07 li a0,103 + *500232: f400 3480 sll a0,16 + *500236: f0dd 4c15 addiu a0,-5931 + *50023a: f060 6c07 li a0,103 + *50023e: f400 3480 sll a0,16 + *500242: f4dd 4c05 addiu a0,-4923 + *500246: f060 6c18 li a0,120 + *50024a: f400 3480 sll a0,16 + *50024e: f5df 4c05 addiu a0,-571 + *500252: f060 6c18 li a0,120 + *500256: f400 3480 sll a0,16 + *50025a: f1a0 4c0d addiu a0,429 + *50025e: f060 6c18 li a0,120 + *500262: f400 3480 sll a0,16 + *500266: f1df 4c15 addiu a0,-1579 + *50026a: f060 6c18 li a0,120 + *50026e: f400 3480 sll a0,16 + *500272: f1a0 4c0e addiu a0,430 + *500276: 6d00 li a1,0 + *500278: f400 35a0 sll a1,16 + *50027c: 9d80 lw a0,0\(a1\) + *50027e: f060 6d05 li a1,101 + *500282: f400 35a0 sll a1,16 + *500286: f328 9d80 lw a0,17184\(a1\) + *50028a: f060 6d05 li a1,101 + *50028e: f400 35a0 sll a1,16 + *500292: f328 9d84 lw a0,17188\(a1\) + *500296: f060 6d05 li a1,101 + *50029a: f400 35a0 sll a1,16 + *50029e: f328 9d90 lw a0,17200\(a1\) + *5002a2: f060 6d05 li a1,101 + *5002a6: f400 35a0 sll a1,16 + *5002aa: f728 9d80 lw a0,18208\(a1\) + *5002ae: f060 6d16 li a1,118 + *5002b2: f400 35a0 sll a1,16 + *5002b6: f02b 9d80 lw a0,22560\(a1\) + *5002ba: f060 6d16 li a1,118 + *5002be: f400 35a0 sll a1,16 + *5002c2: f40b 9d88 lw a0,23560\(a1\) + *5002c6: f060 6d16 li a1,118 + *5002ca: f400 35a0 sll a1,16 + *5002ce: f42a 9d90 lw a0,21552\(a1\) + *5002d2: f060 6d16 li a1,118 + *5002d6: f400 35a0 sll a1,16 + *5002da: f40b 9d89 lw a0,23561\(a1\) + *5002de: 6d00 li a1,0 + *5002e0: f400 35a0 sll a1,16 + *5002e4: f000 9d81 lw a0,1\(a1\) + *5002e8: f060 6d05 li a1,101 + *5002ec: f400 35a0 sll a1,16 + *5002f0: f328 9d81 lw a0,17185\(a1\) + *5002f4: f060 6d05 li a1,101 + *5002f8: f400 35a0 sll a1,16 + *5002fc: f328 9d85 lw a0,17189\(a1\) + *500300: f060 6d05 li a1,101 + *500304: f400 35a0 sll a1,16 + *500308: f328 9d91 lw a0,17201\(a1\) + *50030c: f060 6d05 li a1,101 + *500310: f400 35a0 sll a1,16 + *500314: f728 9d81 lw a0,18209\(a1\) + *500318: f060 6d16 li a1,118 + *50031c: f400 35a0 sll a1,16 + *500320: f02b 9d81 lw a0,22561\(a1\) + *500324: f060 6d16 li a1,118 + *500328: f400 35a0 sll a1,16 + *50032c: f40b 9d89 lw a0,23561\(a1\) + *500330: f060 6d16 li a1,118 + *500334: f400 35a0 sll a1,16 + *500338: f42a 9d91 lw a0,21553\(a1\) + *50033c: f060 6d16 li a1,118 + *500340: f400 35a0 sll a1,16 + *500344: f40b 9d8a lw a0,23562\(a1\) + *500348: 6d01 li a1,1 + *50034a: f400 35a0 sll a1,16 + *50034e: f010 9d80 lw a0,-32768\(a1\) + *500352: f060 6d06 li a1,102 + *500356: f400 35a0 sll a1,16 + *50035a: f338 9d80 lw a0,-15584\(a1\) + *50035e: f060 6d06 li a1,102 + *500362: f400 35a0 sll a1,16 + *500366: f338 9d84 lw a0,-15580\(a1\) + *50036a: f060 6d06 li a1,102 + *50036e: f400 35a0 sll a1,16 + *500372: f338 9d90 lw a0,-15568\(a1\) + *500376: f060 6d06 li a1,102 + *50037a: f400 35a0 sll a1,16 + *50037e: f738 9d80 lw a0,-14560\(a1\) + *500382: f060 6d17 li a1,119 + *500386: f400 35a0 sll a1,16 + *50038a: f03b 9d80 lw a0,-10208\(a1\) + *50038e: f060 6d17 li a1,119 + *500392: f400 35a0 sll a1,16 + *500396: f41b 9d88 lw a0,-9208\(a1\) + *50039a: f060 6d17 li a1,119 + *50039e: f400 35a0 sll a1,16 + *5003a2: f43a 9d90 lw a0,-11216\(a1\) + *5003a6: f060 6d17 li a1,119 + *5003aa: f400 35a0 sll a1,16 + *5003ae: f41b 9d89 lw a0,-9207\(a1\) + *5003b2: 6d00 li a1,0 + *5003b4: f400 35a0 sll a1,16 + *5003b8: f010 9d80 lw a0,-32768\(a1\) + *5003bc: f060 6d05 li a1,101 + *5003c0: f400 35a0 sll a1,16 + *5003c4: f338 9d80 lw a0,-15584\(a1\) + *5003c8: f060 6d05 li a1,101 + *5003cc: f400 35a0 sll a1,16 + *5003d0: f338 9d84 lw a0,-15580\(a1\) + *5003d4: f060 6d05 li a1,101 + *5003d8: f400 35a0 sll a1,16 + *5003dc: f338 9d90 lw a0,-15568\(a1\) + *5003e0: f060 6d05 li a1,101 + *5003e4: f400 35a0 sll a1,16 + *5003e8: f738 9d80 lw a0,-14560\(a1\) + *5003ec: f060 6d16 li a1,118 + *5003f0: f400 35a0 sll a1,16 + *5003f4: f03b 9d80 lw a0,-10208\(a1\) + *5003f8: f060 6d16 li a1,118 + *5003fc: f400 35a0 sll a1,16 + *500400: f41b 9d88 lw a0,-9208\(a1\) + *500404: f060 6d16 li a1,118 + *500408: f400 35a0 sll a1,16 + *50040c: f43a 9d90 lw a0,-11216\(a1\) + *500410: f060 6d16 li a1,118 + *500414: f400 35a0 sll a1,16 + *500418: f41b 9d89 lw a0,-9207\(a1\) + *50041c: 6d01 li a1,1 + *50041e: f400 35a0 sll a1,16 + *500422: 9d80 lw a0,0\(a1\) + *500424: f060 6d06 li a1,102 + *500428: f400 35a0 sll a1,16 + *50042c: f328 9d80 lw a0,17184\(a1\) + *500430: f060 6d06 li a1,102 + *500434: f400 35a0 sll a1,16 + *500438: f328 9d84 lw a0,17188\(a1\) + *50043c: f060 6d06 li a1,102 + *500440: f400 35a0 sll a1,16 + *500444: f328 9d90 lw a0,17200\(a1\) + *500448: f060 6d06 li a1,102 + *50044c: f400 35a0 sll a1,16 + *500450: f728 9d80 lw a0,18208\(a1\) + *500454: f060 6d17 li a1,119 + *500458: f400 35a0 sll a1,16 + *50045c: f02b 9d80 lw a0,22560\(a1\) + *500460: f060 6d17 li a1,119 + *500464: f400 35a0 sll a1,16 + *500468: f40b 9d88 lw a0,23560\(a1\) + *50046c: f060 6d17 li a1,119 + *500470: f400 35a0 sll a1,16 + *500474: f42a 9d90 lw a0,21552\(a1\) + *500478: f060 6d17 li a1,119 + *50047c: f400 35a0 sll a1,16 + *500480: f40b 9d89 lw a0,23561\(a1\) + *500484: 6d02 li a1,2 + *500486: f400 35a0 sll a1,16 + *50048a: f5b4 9d85 lw a0,-23131\(a1\) + *50048e: f060 6d07 li a1,103 + *500492: f400 35a0 sll a1,16 + *500496: f0dd 9d85 lw a0,-5947\(a1\) + *50049a: f060 6d07 li a1,103 + *50049e: f400 35a0 sll a1,16 + *5004a2: f0dd 9d89 lw a0,-5943\(a1\) + *5004a6: f060 6d07 li a1,103 + *5004aa: f400 35a0 sll a1,16 + *5004ae: f0dd 9d95 lw a0,-5931\(a1\) + *5004b2: f060 6d07 li a1,103 + *5004b6: f400 35a0 sll a1,16 + *5004ba: f4dd 9d85 lw a0,-4923\(a1\) + *5004be: f060 6d18 li a1,120 + *5004c2: f400 35a0 sll a1,16 + *5004c6: f5df 9d85 lw a0,-571\(a1\) + *5004ca: f060 6d18 li a1,120 + *5004ce: f400 35a0 sll a1,16 + *5004d2: f1a0 9d8d lw a0,429\(a1\) + *5004d6: f060 6d18 li a1,120 + *5004da: f400 35a0 sll a1,16 + *5004de: f1df 9d95 lw a0,-1579\(a1\) + *5004e2: f060 6d18 li a1,120 + *5004e6: f400 35a0 sll a1,16 + *5004ea: f1a0 9d8e lw a0,430\(a1\) + *5004ee: 6500 nop #pass diff --git a/ld/testsuite/ld-mips-elf/mips16-hilo.s b/ld/testsuite/ld-mips-elf/mips16-hilo.s index 79ac2fb..8b13789 100644 --- a/ld/testsuite/ld-mips-elf/mips16-hilo.s +++ b/ld/testsuite/ld-mips-elf/mips16-hilo.s @@ -1,14 +1 @@ - .data - .globl big_external_data_label -big_external_data_label: - .fill 1000 -# align section end to 16-byte boundary for easier testing on multiple targets - .p2align 4 - - .globl small_external_data_label -small_external_data_label: - .fill 1 - -# align section end to 16-byte boundary for easier testing on multiple targets - .p2align 4 diff --git a/ld/testsuite/ld-mips-elf/mips16e2-hilo-srec.d b/ld/testsuite/ld-mips-elf/mips16e2-hilo-srec.d new file mode 100644 index 0000000..12a2d28 --- /dev/null +++ b/ld/testsuite/ld-mips-elf/mips16e2-hilo-srec.d @@ -0,0 +1,8 @@ +#name: MIPS16e2 R_MIPS16_HI16 and R_MIPS16_LO16 relocs srec +#source: ../../../gas/testsuite/gas/mips/mips-hilo.s +#source: mips-hilo.s +#as: -mips16 -mmips16e2 -march=mips64r2 +#objdump: -mmips:16 -j .sec1 -D +#ld: --oformat=srec -Tmips-hilo.ld -e 0x500000 -N +#notarget: mips*el-ps2-elf* +#dump: mips16e2-hilo.d diff --git a/ld/testsuite/ld-mips-elf/mips16e2-hilo.d b/ld/testsuite/ld-mips-elf/mips16e2-hilo.d new file mode 100644 index 0000000..5aa1624 --- /dev/null +++ b/ld/testsuite/ld-mips-elf/mips16e2-hilo.d @@ -0,0 +1,230 @@ +#name: MIPS16e2 R_MIPS16_HI16 and R_MIPS16_LO16 relocs +#source: ../../../gas/testsuite/gas/mips/mips-hilo.s +#source: mips-hilo.s +#as: -mips16 -mmips16e2 -march=mips64r2 +#objdump: -d +#ld: -Tmips-hilo.ld -e 0x500000 -N +#notarget: mips*el-ps2-elf* + +.*: file format (:?elf.*mips.*|srec) + +Disassembly of section \.(:?text|sec1): + +0*500000 <[^>]*>: + *500000: f000 6c20 lui a0,0x0 + *500004: 4c00 addiu a0,0 + *500006: f060 6c25 lui a0,0x65 + *50000a: f328 4c00 addiu a0,17184 + *50000e: f060 6c25 lui a0,0x65 + *500012: f328 4c04 addiu a0,17188 + *500016: f060 6c25 lui a0,0x65 + *50001a: f328 4c10 addiu a0,17200 + *50001e: f060 6c25 lui a0,0x65 + *500022: f728 4c00 addiu a0,18208 + *500026: f060 6c36 lui a0,0x76 + *50002a: f02b 4c00 addiu a0,22560 + *50002e: f060 6c36 lui a0,0x76 + *500032: f40b 4c08 addiu a0,23560 + *500036: f060 6c36 lui a0,0x76 + *50003a: f42a 4c10 addiu a0,21552 + *50003e: f060 6c36 lui a0,0x76 + *500042: f40b 4c09 addiu a0,23561 + *500046: f000 6c20 lui a0,0x0 + *50004a: 4c01 addiu a0,1 + *50004c: f060 6c25 lui a0,0x65 + *500050: f328 4c01 addiu a0,17185 + *500054: f060 6c25 lui a0,0x65 + *500058: f328 4c05 addiu a0,17189 + *50005c: f060 6c25 lui a0,0x65 + *500060: f328 4c11 addiu a0,17201 + *500064: f060 6c25 lui a0,0x65 + *500068: f728 4c01 addiu a0,18209 + *50006c: f060 6c36 lui a0,0x76 + *500070: f02b 4c01 addiu a0,22561 + *500074: f060 6c36 lui a0,0x76 + *500078: f40b 4c09 addiu a0,23561 + *50007c: f060 6c36 lui a0,0x76 + *500080: f42a 4c11 addiu a0,21553 + *500084: f060 6c36 lui a0,0x76 + *500088: f40b 4c0a addiu a0,23562 + *50008c: f000 6c21 lui a0,0x1 + *500090: f010 4c00 addiu a0,-32768 + *500094: f060 6c26 lui a0,0x66 + *500098: f338 4c00 addiu a0,-15584 + *50009c: f060 6c26 lui a0,0x66 + *5000a0: f338 4c04 addiu a0,-15580 + *5000a4: f060 6c26 lui a0,0x66 + *5000a8: f338 4c10 addiu a0,-15568 + *5000ac: f060 6c26 lui a0,0x66 + *5000b0: f738 4c00 addiu a0,-14560 + *5000b4: f060 6c37 lui a0,0x77 + *5000b8: f03b 4c00 addiu a0,-10208 + *5000bc: f060 6c37 lui a0,0x77 + *5000c0: f41b 4c08 addiu a0,-9208 + *5000c4: f060 6c37 lui a0,0x77 + *5000c8: f43a 4c10 addiu a0,-11216 + *5000cc: f060 6c37 lui a0,0x77 + *5000d0: f41b 4c09 addiu a0,-9207 + *5000d4: f000 6c20 lui a0,0x0 + *5000d8: f010 4c00 addiu a0,-32768 + *5000dc: f060 6c25 lui a0,0x65 + *5000e0: f338 4c00 addiu a0,-15584 + *5000e4: f060 6c25 lui a0,0x65 + *5000e8: f338 4c04 addiu a0,-15580 + *5000ec: f060 6c25 lui a0,0x65 + *5000f0: f338 4c10 addiu a0,-15568 + *5000f4: f060 6c25 lui a0,0x65 + *5000f8: f738 4c00 addiu a0,-14560 + *5000fc: f060 6c36 lui a0,0x76 + *500100: f03b 4c00 addiu a0,-10208 + *500104: f060 6c36 lui a0,0x76 + *500108: f41b 4c08 addiu a0,-9208 + *50010c: f060 6c36 lui a0,0x76 + *500110: f43a 4c10 addiu a0,-11216 + *500114: f060 6c36 lui a0,0x76 + *500118: f41b 4c09 addiu a0,-9207 + *50011c: f000 6c21 lui a0,0x1 + *500120: 4c00 addiu a0,0 + *500122: f060 6c26 lui a0,0x66 + *500126: f328 4c00 addiu a0,17184 + *50012a: f060 6c26 lui a0,0x66 + *50012e: f328 4c04 addiu a0,17188 + *500132: f060 6c26 lui a0,0x66 + *500136: f328 4c10 addiu a0,17200 + *50013a: f060 6c26 lui a0,0x66 + *50013e: f728 4c00 addiu a0,18208 + *500142: f060 6c37 lui a0,0x77 + *500146: f02b 4c00 addiu a0,22560 + *50014a: f060 6c37 lui a0,0x77 + *50014e: f40b 4c08 addiu a0,23560 + *500152: f060 6c37 lui a0,0x77 + *500156: f42a 4c10 addiu a0,21552 + *50015a: f060 6c37 lui a0,0x77 + *50015e: f40b 4c09 addiu a0,23561 + *500162: f000 6c22 lui a0,0x2 + *500166: f5b4 4c05 addiu a0,-23131 + *50016a: f060 6c27 lui a0,0x67 + *50016e: f0dd 4c05 addiu a0,-5947 + *500172: f060 6c27 lui a0,0x67 + *500176: f0dd 4c09 addiu a0,-5943 + *50017a: f060 6c27 lui a0,0x67 + *50017e: f0dd 4c15 addiu a0,-5931 + *500182: f060 6c27 lui a0,0x67 + *500186: f4dd 4c05 addiu a0,-4923 + *50018a: f060 6c38 lui a0,0x78 + *50018e: f5df 4c05 addiu a0,-571 + *500192: f060 6c38 lui a0,0x78 + *500196: f1a0 4c0d addiu a0,429 + *50019a: f060 6c38 lui a0,0x78 + *50019e: f1df 4c15 addiu a0,-1579 + *5001a2: f060 6c38 lui a0,0x78 + *5001a6: f1a0 4c0e addiu a0,430 + *5001aa: f000 6d20 lui a1,0x0 + *5001ae: 9d80 lw a0,0\(a1\) + *5001b0: f060 6d25 lui a1,0x65 + *5001b4: f328 9d80 lw a0,17184\(a1\) + *5001b8: f060 6d25 lui a1,0x65 + *5001bc: f328 9d84 lw a0,17188\(a1\) + *5001c0: f060 6d25 lui a1,0x65 + *5001c4: f328 9d90 lw a0,17200\(a1\) + *5001c8: f060 6d25 lui a1,0x65 + *5001cc: f728 9d80 lw a0,18208\(a1\) + *5001d0: f060 6d36 lui a1,0x76 + *5001d4: f02b 9d80 lw a0,22560\(a1\) + *5001d8: f060 6d36 lui a1,0x76 + *5001dc: f40b 9d88 lw a0,23560\(a1\) + *5001e0: f060 6d36 lui a1,0x76 + *5001e4: f42a 9d90 lw a0,21552\(a1\) + *5001e8: f060 6d36 lui a1,0x76 + *5001ec: f40b 9d89 lw a0,23561\(a1\) + *5001f0: f000 6d20 lui a1,0x0 + *5001f4: f000 9d81 lw a0,1\(a1\) + *5001f8: f060 6d25 lui a1,0x65 + *5001fc: f328 9d81 lw a0,17185\(a1\) + *500200: f060 6d25 lui a1,0x65 + *500204: f328 9d85 lw a0,17189\(a1\) + *500208: f060 6d25 lui a1,0x65 + *50020c: f328 9d91 lw a0,17201\(a1\) + *500210: f060 6d25 lui a1,0x65 + *500214: f728 9d81 lw a0,18209\(a1\) + *500218: f060 6d36 lui a1,0x76 + *50021c: f02b 9d81 lw a0,22561\(a1\) + *500220: f060 6d36 lui a1,0x76 + *500224: f40b 9d89 lw a0,23561\(a1\) + *500228: f060 6d36 lui a1,0x76 + *50022c: f42a 9d91 lw a0,21553\(a1\) + *500230: f060 6d36 lui a1,0x76 + *500234: f40b 9d8a lw a0,23562\(a1\) + *500238: f000 6d21 lui a1,0x1 + *50023c: f010 9d80 lw a0,-32768\(a1\) + *500240: f060 6d26 lui a1,0x66 + *500244: f338 9d80 lw a0,-15584\(a1\) + *500248: f060 6d26 lui a1,0x66 + *50024c: f338 9d84 lw a0,-15580\(a1\) + *500250: f060 6d26 lui a1,0x66 + *500254: f338 9d90 lw a0,-15568\(a1\) + *500258: f060 6d26 lui a1,0x66 + *50025c: f738 9d80 lw a0,-14560\(a1\) + *500260: f060 6d37 lui a1,0x77 + *500264: f03b 9d80 lw a0,-10208\(a1\) + *500268: f060 6d37 lui a1,0x77 + *50026c: f41b 9d88 lw a0,-9208\(a1\) + *500270: f060 6d37 lui a1,0x77 + *500274: f43a 9d90 lw a0,-11216\(a1\) + *500278: f060 6d37 lui a1,0x77 + *50027c: f41b 9d89 lw a0,-9207\(a1\) + *500280: f000 6d20 lui a1,0x0 + *500284: f010 9d80 lw a0,-32768\(a1\) + *500288: f060 6d25 lui a1,0x65 + *50028c: f338 9d80 lw a0,-15584\(a1\) + *500290: f060 6d25 lui a1,0x65 + *500294: f338 9d84 lw a0,-15580\(a1\) + *500298: f060 6d25 lui a1,0x65 + *50029c: f338 9d90 lw a0,-15568\(a1\) + *5002a0: f060 6d25 lui a1,0x65 + *5002a4: f738 9d80 lw a0,-14560\(a1\) + *5002a8: f060 6d36 lui a1,0x76 + *5002ac: f03b 9d80 lw a0,-10208\(a1\) + *5002b0: f060 6d36 lui a1,0x76 + *5002b4: f41b 9d88 lw a0,-9208\(a1\) + *5002b8: f060 6d36 lui a1,0x76 + *5002bc: f43a 9d90 lw a0,-11216\(a1\) + *5002c0: f060 6d36 lui a1,0x76 + *5002c4: f41b 9d89 lw a0,-9207\(a1\) + *5002c8: f000 6d21 lui a1,0x1 + *5002cc: 9d80 lw a0,0\(a1\) + *5002ce: f060 6d26 lui a1,0x66 + *5002d2: f328 9d80 lw a0,17184\(a1\) + *5002d6: f060 6d26 lui a1,0x66 + *5002da: f328 9d84 lw a0,17188\(a1\) + *5002de: f060 6d26 lui a1,0x66 + *5002e2: f328 9d90 lw a0,17200\(a1\) + *5002e6: f060 6d26 lui a1,0x66 + *5002ea: f728 9d80 lw a0,18208\(a1\) + *5002ee: f060 6d37 lui a1,0x77 + *5002f2: f02b 9d80 lw a0,22560\(a1\) + *5002f6: f060 6d37 lui a1,0x77 + *5002fa: f40b 9d88 lw a0,23560\(a1\) + *5002fe: f060 6d37 lui a1,0x77 + *500302: f42a 9d90 lw a0,21552\(a1\) + *500306: f060 6d37 lui a1,0x77 + *50030a: f40b 9d89 lw a0,23561\(a1\) + *50030e: f000 6d22 lui a1,0x2 + *500312: f5b4 9d85 lw a0,-23131\(a1\) + *500316: f060 6d27 lui a1,0x67 + *50031a: f0dd 9d85 lw a0,-5947\(a1\) + *50031e: f060 6d27 lui a1,0x67 + *500322: f0dd 9d89 lw a0,-5943\(a1\) + *500326: f060 6d27 lui a1,0x67 + *50032a: f0dd 9d95 lw a0,-5931\(a1\) + *50032e: f060 6d27 lui a1,0x67 + *500332: f4dd 9d85 lw a0,-4923\(a1\) + *500336: f060 6d38 lui a1,0x78 + *50033a: f5df 9d85 lw a0,-571\(a1\) + *50033e: f060 6d38 lui a1,0x78 + *500342: f1a0 9d8d lw a0,429\(a1\) + *500346: f060 6d38 lui a1,0x78 + *50034a: f1df 9d95 lw a0,-1579\(a1\) + *50034e: f060 6d38 lui a1,0x78 + *500352: f1a0 9d8e lw a0,430\(a1\) + \.\.\. diff --git a/ld/testsuite/ld-mips-elf/pcrel-hilo-srec.d b/ld/testsuite/ld-mips-elf/pcrel-hilo-srec.d new file mode 100644 index 0000000..e9b0956 --- /dev/null +++ b/ld/testsuite/ld-mips-elf/pcrel-hilo-srec.d @@ -0,0 +1,6 @@ +#name: MIPSr6 PCHI16/PCLO16 relocations srec +#as: -mno-pdr +#ld: -e 0 --defsym=baz=0xfedcba98 -T pcrel-hilo.ld --oformat=srec +#objdump: -m mips:isa64r6 -D -j .sec1 +#source: ../../../gas/testsuite/gas/mips/pcrel-hilo.s +#dump: pcrel-hilo.d diff --git a/ld/testsuite/ld-mips-elf/pcrel-hilo.d b/ld/testsuite/ld-mips-elf/pcrel-hilo.d new file mode 100644 index 0000000..ae5d052 --- /dev/null +++ b/ld/testsuite/ld-mips-elf/pcrel-hilo.d @@ -0,0 +1,42 @@ +#name: MIPSr6 PCHI16/PCLO16 relocations +#as: -mno-pdr +#ld: -e 0 --defsym=baz=0xfedcba98 -T pcrel-hilo.ld +#objdump: -m mips:isa64r6 -d +#source: ../../../gas/testsuite/gas/mips/pcrel-hilo.s + +.*: +file format (?:.*mips.*|srec) + +Disassembly of section \.(?:text|sec1): + +0*10000000 <[^>]*>: + *10000000: ec9e2456 auipc a0,0x2456 + *10000004: 3c05fedd lui a1,0xfedd + *10000008: ecde2456 auipc a2,0x2456 + *1000000c: ecfe2457 auipc a3,0x2457 + *10000010: 24847fec addiu a0,a0,32748 + *10000014: 24a5ba98 addiu a1,a1,-17768 + *10000018: 24c67ff0 addiu a2,a2,32752 + *1000001c: 24e7ffe4 addiu a3,a3,-28 + *10000020: ec9e2456 auipc a0,0x2456 + *10000024: 3c05fedd lui a1,0xfedd + *10000028: ecde2456 auipc a2,0x2456 + *1000002c: ecfe2457 auipc a3,0x2457 + \.\.\. + *10030030: 24847fec addiu a0,a0,32748 + *10030034: 24a5ba98 addiu a1,a1,-17768 + *10030038: 24c67ff0 addiu a2,a2,32752 + *1003003c: 24e7ffe4 addiu a3,a3,-28 + *10030040: 24107fec li s0,32748 + *10030044: 2411ba98 li s1,-17768 + *10030048: 24127ff0 li s2,32752 + *1003004c: 2413ffe4 li s3,-28 + *10030050: ec9e2456 auipc a0,0x2456 + *10030054: 3c05fedd lui a1,0xfedd + *10030058: ecde2456 auipc a2,0x2456 + *1003005c: ecfe2457 auipc a3,0x2457 + *10030060: 00902021 addu a0,a0,s0 + *10030064: 00b12821 addu a1,a1,s1 + *10030068: 00d23021 addu a2,a2,s2 + *1003006c: 00f33821 addu a3,a3,s3 + *10030070: d81f0000 jrc ra + \.\.\. diff --git a/ld/testsuite/ld-mips-elf/pcrel-hilo.ld b/ld/testsuite/ld-mips-elf/pcrel-hilo.ld new file mode 100644 index 0000000..77d361d --- /dev/null +++ b/ld/testsuite/ld-mips-elf/pcrel-hilo.ld @@ -0,0 +1,14 @@ +MEMORY +{ + text (rx) : ORIGIN = 0x10000000, LENGTH = 0x40000 + data (w) : ORIGIN = 0x34560000, LENGTH = 0x40000 +} +SECTIONS +{ + .text : { *(.text) } >text + .data : { *(.data) } >data + .symtab : { *(.symtab) } + .strtab : { *(.strtab) } + .shstrtab : { *(.shstrtab) } + /DISCARD/ : { *(*) } +} diff --git a/ld/testsuite/ld-mips-elf/pic-and-nonpic-1-r6.s b/ld/testsuite/ld-mips-elf/pic-and-nonpic-1-r6.s deleted file mode 100644 index e69de29..0000000 --- a/ld/testsuite/ld-mips-elf/pic-and-nonpic-1-r6.s +++ /dev/null diff --git a/ld/testsuite/ld-mips-elf/pr19977-micromips.d b/ld/testsuite/ld-mips-elf/pr19977-micromips.d new file mode 100644 index 0000000..021b29c --- /dev/null +++ b/ld/testsuite/ld-mips-elf/pr19977-micromips.d @@ -0,0 +1,25 @@ +#name: pr19977 microMIPS +#source: ../../../gas/testsuite/gas/mips/pr19977.s +#as: -mmicromips -march=mips64r2 +#objdump: -d +#ld: -Tpr19977.ld -e 0 -N +#notarget: mips*el-ps2-elf* + +.*: file format elf.*mips.* + +Disassembly of section \.text: + +10000000 <[^>]*>: +10000000: 3060 1122 li v1,4386 +10000004: 0063 8000 sll v1,v1,0x10 +10000008: 3063 2988 addiu v1,v1,10632 +1000000c: 3060 1122 li v1,4386 +10000010: 0063 8000 sll v1,v1,0x10 +10000014: 3063 1988 addiu v1,v1,6536 +10000018: 3060 1122 li v1,4386 +1000001c: 0063 8000 sll v1,v1,0x10 +10000020: 3063 a988 addiu v1,v1,-22136 +10000024: 3060 1122 li v1,4386 +10000028: 0063 8000 sll v1,v1,0x10 +1000002c: 3063 9988 addiu v1,v1,-26232 +#pass diff --git a/ld/testsuite/ld-mips-elf/pr19977-mips16.d b/ld/testsuite/ld-mips-elf/pr19977-mips16.d new file mode 100644 index 0000000..c927357 --- /dev/null +++ b/ld/testsuite/ld-mips-elf/pr19977-mips16.d @@ -0,0 +1,24 @@ +#name: pr19977 MIPS16 +#source: ../../../gas/testsuite/gas/mips/pr19977.s +#as: -mips16 -march=mips3 +#objdump: -d +#ld: -Tpr19977.ld -e 0 -N + +.*: file format elf.*mips.* + +Disassembly of section \.text: + +10000000 <[^>]*>: +10000000: f122 6b02 li v1,4386 +10000004: f400 3360 sll v1,16 +10000008: f185 4b08 addiu v1,10632 +1000000c: f122 6b02 li v1,4386 +10000010: f400 3360 sll v1,16 +10000014: f183 4b08 addiu v1,6536 +10000018: f122 6b02 li v1,4386 +1000001c: f400 3360 sll v1,16 +10000020: f195 4b08 addiu v1,-22136 +10000024: f122 6b02 li v1,4386 +10000028: f400 3360 sll v1,16 +1000002c: f193 4b08 addiu v1,-26232 +#pass diff --git a/ld/testsuite/ld-mips-elf/pr19977-r-micromips.d b/ld/testsuite/ld-mips-elf/pr19977-r-micromips.d new file mode 100644 index 0000000..db99b97 --- /dev/null +++ b/ld/testsuite/ld-mips-elf/pr19977-r-micromips.d @@ -0,0 +1,8 @@ +#name: pr19977 microMIPS -r +#source: pr19977-r.s +#source: ../../../gas/testsuite/gas/mips/pr19977.s +#as: -mmicromips -march=mips64r2 +#objdump: -dr +#ld: -r +#notarget: mips*el-ps2-elf* +#dump: pr19977-r.d diff --git a/ld/testsuite/ld-mips-elf/pr19977-r-mips16.d b/ld/testsuite/ld-mips-elf/pr19977-r-mips16.d new file mode 100644 index 0000000..dafa793 --- /dev/null +++ b/ld/testsuite/ld-mips-elf/pr19977-r-mips16.d @@ -0,0 +1,7 @@ +#name: pr19977 MIPS16 -r +#source: pr19977-r.s +#source: ../../../gas/testsuite/gas/mips/pr19977.s +#as: -mips16 -march=mips3 +#objdump: -dr +#ld: -r +#dump: pr19977-r.d diff --git a/ld/testsuite/ld-mips-elf/pr19977-r.d b/ld/testsuite/ld-mips-elf/pr19977-r.d new file mode 100644 index 0000000..166194b --- /dev/null +++ b/ld/testsuite/ld-mips-elf/pr19977-r.d @@ -0,0 +1,32 @@ +#name: pr19977 MIPS -r +#source: pr19977-r.s +#source: ../../../gas/testsuite/gas/mips/pr19977.s +#objdump: -dr +#ld: -r + +.* + +Disassembly of section \.text: + +0+ <foo>: + 0: .* li v1,4387 + 0: R_(|MICRO)MIPS(|16)_TLS_TPREL_HI16 \$loc0 + 4: .* sll .* + 8: .* addiu v1(|,v1),-26232 + 8: R_(|MICRO)MIPS(|16)_TLS_TPREL_LO16 \$loc0 + c: .* li v1,4387 + c: R_(|MICRO)MIPS(|16)_TLS_DTPREL_HI16 \$loc0 + 10: .* sll .* + 14: .* addiu v1(|,v1),-26232 + 14: R_(|MICRO)MIPS(|16)_TLS_DTPREL_LO16 \$loc0 + 18: .* li v1,4387 + 18: R_(|MICRO)MIPS(|16)_TLS_TPREL_HI16 \.tdata + 1c: .* sll .* + 20: .* addiu v1(|,v1),-30328 + 20: R_(|MICRO)MIPS(|16)_TLS_TPREL_LO16 \.tdata + 24: .* li v1,4387 + 24: R_(|MICRO)MIPS(|16)_TLS_DTPREL_HI16 \.tdata + 28: .* sll .* + 2c: .* addiu v1(|,v1),-30328 + 2c: R_(|MICRO)MIPS(|16)_TLS_DTPREL_LO16 \.tdata +#pass diff --git a/ld/testsuite/ld-mips-elf/pr19977-r.s b/ld/testsuite/ld-mips-elf/pr19977-r.s new file mode 100644 index 0000000..4a46b30 --- /dev/null +++ b/ld/testsuite/ld-mips-elf/pr19977-r.s @@ -0,0 +1,2 @@ + .section .tdata,"awT",%progbits + .space 28672 diff --git a/ld/testsuite/ld-mips-elf/pr19977.d b/ld/testsuite/ld-mips-elf/pr19977.d new file mode 100644 index 0000000..145f697 --- /dev/null +++ b/ld/testsuite/ld-mips-elf/pr19977.d @@ -0,0 +1,23 @@ +#name: pr19977 MIPS +#source: ../../../gas/testsuite/gas/mips/pr19977.s +#objdump: -d +#ld: -Tpr19977.ld -e 0 -N + +.*: file format elf.*mips.* + +Disassembly of section \.text: + +10000000 <[^>]*>: +10000000: 24031122 li v1,4386 +10000004: 00031c00 sll v1,v1,0x10 +10000008: 24632988 addiu v1,v1,10632 +1000000c: 24031122 li v1,4386 +10000010: 00031c00 sll v1,v1,0x10 +10000014: 24631988 addiu v1,v1,6536 +10000018: 24031122 li v1,4386 +1000001c: 00031c00 sll v1,v1,0x10 +10000020: 2463a988 addiu v1,v1,-22136 +10000024: 24031122 li v1,4386 +10000028: 00031c00 sll v1,v1,0x10 +1000002c: 24639988 addiu v1,v1,-26232 +#pass diff --git a/ld/testsuite/ld-mips-elf/pr19977.ld b/ld/testsuite/ld-mips-elf/pr19977.ld new file mode 100644 index 0000000..0b2f7c1 --- /dev/null +++ b/ld/testsuite/ld-mips-elf/pr19977.ld @@ -0,0 +1,14 @@ +MEMORY +{ + text (rx) : ORIGIN = 0x10000000, LENGTH = 0x40000 + data (w) : ORIGIN = 0x34560000, LENGTH = 0x40000 +} +SECTIONS +{ + .text : { *(.text) } >text + .tdata : { *(.tdata) } >data + .symtab : { *(.symtab) } + .strtab : { *(.strtab) } + .shstrtab : { *(.shstrtab) } + /DISCARD/ : { *(*) } +} diff --git a/ld/testsuite/ld-mips-elf/vxworks2.sd b/ld/testsuite/ld-mips-elf/vxworks2.sd index 5ff87d3..4f56f2a 100644 --- a/ld/testsuite/ld-mips-elf/vxworks2.sd +++ b/ld/testsuite/ld-mips-elf/vxworks2.sd @@ -6,7 +6,7 @@ Program Headers: Type .* PHDR .* #... - LOAD .* 0x00080000 0x00080000 .* R E 0x1000 + LOAD .* 0x0007f000 0x0007f000 .* R E 0x1000 LOAD .* 0x00081000 0x00081000 .* RW 0x1000 DYNAMIC .* diff --git a/ld/testsuite/ld-pe/image-fixup-16.d b/ld/testsuite/ld-pe/image-fixup-16.d new file mode 100644 index 0000000..b874294 --- /dev/null +++ b/ld/testsuite/ld-pe/image-fixup-16.d @@ -0,0 +1,16 @@ +#name: PE-COFF 16-bit image fixup +#source: image-fixup-16.s +#ld: -image-base=0x1000 -Tdata=0x2000 +#objdump: -p +#notarget: aarch64-*-* arm-wince-pe arm-*-wince arm*-*-mingw32ce* +#notarget: arm*-*-cegcc* mcore-*-* sh-*-* + +.*: +file format pei-.* + +#... +PE File Base Relocations \(interpreted \.reloc section contents\) + +Virtual Address: 00001000 Chunk size 12 \(0xc\) Number of fixups 2 + reloc 0 offset 2 \[1002\] LOW + reloc 1 offset 0 \[1000\] ABSOLUTE +#pass diff --git a/ld/testsuite/ld-pe/image-fixup-16.s b/ld/testsuite/ld-pe/image-fixup-16.s new file mode 100644 index 0000000..ab94447 --- /dev/null +++ b/ld/testsuite/ld-pe/image-fixup-16.s @@ -0,0 +1,4 @@ + .data +foo: + .2byte 0 + .2byte foo diff --git a/ld/testsuite/ld-pe/image-fixup-32.d b/ld/testsuite/ld-pe/image-fixup-32.d new file mode 100644 index 0000000..f6a66d2 --- /dev/null +++ b/ld/testsuite/ld-pe/image-fixup-32.d @@ -0,0 +1,14 @@ +#name: PE-COFF 32-bit image fixup +#ld: -e 0 -image-base=0x10000000 -Tdata=0x20000000 +#objdump: -p +#xfail: mcore-*-* + +.*: +file format pei-.* + +#... +PE File Base Relocations \(interpreted \.reloc section contents\) + +Virtual Address: 10000000 Chunk size 12 \(0xc\) Number of fixups 2 + reloc 0 offset 4 \[10000004\] HIGHLOW + reloc 1 offset 0 \[10000000\] ABSOLUTE +#pass diff --git a/ld/testsuite/ld-pe/image-fixup-32.s b/ld/testsuite/ld-pe/image-fixup-32.s new file mode 100644 index 0000000..11ae431 --- /dev/null +++ b/ld/testsuite/ld-pe/image-fixup-32.s @@ -0,0 +1,4 @@ + .data +foo: + .4byte 0 + .4byte foo diff --git a/ld/testsuite/ld-pe/image-fixup-64.d b/ld/testsuite/ld-pe/image-fixup-64.d new file mode 100644 index 0000000..9ee5cc5 --- /dev/null +++ b/ld/testsuite/ld-pe/image-fixup-64.d @@ -0,0 +1,14 @@ +#name: PE-COFF 64-bit image fixup +#ld: -e 0 -image-base=0x10000000 -Tdata=0x20000000 +#objdump: -p +#notarget: arm-*-* i\[3-7\]86-*-* mcore-*-* sh-*-* + +.*: +file format pei-.* + +#... +PE File Base Relocations \(interpreted \.reloc section contents\) + +Virtual Address: 10000000 Chunk size 12 \(0xc\) Number of fixups 2 + reloc 0 offset 8 \[10000008\] DIR64 + reloc 1 offset 0 \[10000000\] ABSOLUTE +#pass diff --git a/ld/testsuite/ld-pe/image-fixup-64.s b/ld/testsuite/ld-pe/image-fixup-64.s new file mode 100644 index 0000000..0bc51f3 --- /dev/null +++ b/ld/testsuite/ld-pe/image-fixup-64.s @@ -0,0 +1,4 @@ + .data +foo: + .8byte 0 + .8byte foo diff --git a/ld/testsuite/ld-pe/pe-aarch64.d b/ld/testsuite/ld-pe/pe-aarch64.d index 18b1c9b..ac287a6 100644 --- a/ld/testsuite/ld-pe/pe-aarch64.d +++ b/ld/testsuite/ld-pe/pe-aarch64.d @@ -6,7 +6,7 @@ Disassembly of section .text: -0000000140001000 <___tls_end__>: +0000000140001000 <_start>: 140001000: d2800281 mov x1, #0x14 // #20 140001004: 14000001 b 140001008 <foo> diff --git a/ld/testsuite/ld-pe/pe-aarch64.s b/ld/testsuite/ld-pe/pe-aarch64.s index 5d49350..b9e7dae 100644 --- a/ld/testsuite/ld-pe/pe-aarch64.s +++ b/ld/testsuite/ld-pe/pe-aarch64.s @@ -4,6 +4,11 @@ .section .text + .global _start + .def _start + .scl 2 /* C_EXT */ + .type 32 /* DT_FUNC */ + .endef _start: mov x1, 20 b foo diff --git a/ld/testsuite/ld-pe/pe.exp b/ld/testsuite/ld-pe/pe.exp index 2e8cd17..41b7330 100644 --- a/ld/testsuite/ld-pe/pe.exp +++ b/ld/testsuite/ld-pe/pe.exp @@ -137,6 +137,9 @@ run_dump_test "orphan" run_dump_test "orphan_nu" run_dump_test "reloc" +run_dump_test "reloc2a" +run_dump_test "reloc2b" +run_dump_test "reloc2c" run_dump_test "weakdef-1" @@ -189,3 +192,7 @@ if [check_shared_lib_support] { run_dump_test "symbols-ordinals-hints-imports-dlltool" set ASFLAGS $old_ASFLAGS } + +run_dump_test "image-fixup-16" +run_dump_test "image-fixup-32" +run_dump_test "image-fixup-64" diff --git a/ld/testsuite/ld-pe/reloc.d b/ld/testsuite/ld-pe/reloc.d index eab8dfb..55888c3 100644 --- a/ld/testsuite/ld-pe/reloc.d +++ b/ld/testsuite/ld-pe/reloc.d @@ -1,7 +1,6 @@ #name: PE base relocations #ld: --enable-reloc-section #objdump: -p -#xfail: mcore-*-* .*: file format .* diff --git a/ld/testsuite/ld-pe/reloc2.s b/ld/testsuite/ld-pe/reloc2.s new file mode 100644 index 0000000..ddcfeba --- /dev/null +++ b/ld/testsuite/ld-pe/reloc2.s @@ -0,0 +1,19 @@ + .text + .global _start +_start: + .nop + + .section .rdata, "r" + .dc.a _start + .dc.a . + + .data +.L1: .rva _start +.L2: .rva . + + .section .reloc, "r" + .p2align 2 + .rva .data + .long 2 * 4 + 2 * 2 + .short .L1 - .data + (3 << 12) + .short .L2 - .data + (3 << 12) diff --git a/ld/testsuite/ld-pe/reloc2a.d b/ld/testsuite/ld-pe/reloc2a.d new file mode 100644 index 0000000..11fe9b6 --- /dev/null +++ b/ld/testsuite/ld-pe/reloc2a.d @@ -0,0 +1,35 @@ +#source: reloc2.s +#as: --no-pad-sections +#name: PE .reloc section attributes (builtin+custom) +#ld: --enable-reloc-section --section-align=0x1000 -e _start +#objdump: -hpwPsections + +.*: file format .* + +#... +PE File Base Relocations.* +Virtual Address: .* Number of fixups 2 +[ ]*reloc 0 offset 0 .* HIGHLOW +[ ]*reloc 1 offset [48] .* HIGHLOW + +Virtual Address: .* Number of fixups 2 +[ ]*reloc 0 offset 0 .* (HIGHLOW|DIR64) +[ ]*reloc 1 offset [48] .* (HIGHLOW|DIR64) + +#?private flags = .* + +Section headers.*: + # Name *paddr *vaddr *size .* Flags + 1 \.text *0000.* 0.*000 0*200 .* EXECUTE,READ,CODE + 2 \.data *0000.* 0.*000 0*200 .* READ,WRITE,INITIALIZED DATA + 3 \.rdata *0000.* 0.*000 0*200 .* READ,INITIALIZED DATA + 4 \.idata *0000.* 0.*000 0*200 .* READ,INITIALIZED DATA + 5 \.reloc *0000.* 0.*000 0*200 .* READ,INITIALIZED DATA + +Sections: +Idx Name *Size *VMA *LMA *File off .* Flags + 0 \.text *0*(1?4|8|10) .*000 .*000 0*0000... .* CONTENTS, ALLOC, LOAD, READONLY, CODE + 1 \.data *0*(8|10) .*000 .*000 0*0000... .* CONTENTS, ALLOC, LOAD, DATA + 2 \.rdata *0*0000.. .*000 .*000 0*0000... .* CONTENTS, ALLOC, LOAD, READONLY, DATA + 3 \.idata *0*1(4|8) .*000 .*000 0*0000... .* CONTENTS, ALLOC, LOAD, READONLY, DATA + 4 \.reloc *0*000018 .*000 .*000 0*0000... .* CONTENTS, ALLOC, LOAD, READONLY, DATA diff --git a/ld/testsuite/ld-pe/reloc2b.d b/ld/testsuite/ld-pe/reloc2b.d new file mode 100644 index 0000000..cdd9a18 --- /dev/null +++ b/ld/testsuite/ld-pe/reloc2b.d @@ -0,0 +1,32 @@ +#source: reloc2.s RUN_OBJCOPY +#as: --no-pad-sections +#name: PE .reloc section attributes (builtin only) +#objcopy_objects: --rename-section .reloc=.rdata$1 +#ld: --enable-reloc-section --section-align=0x1000 -e _start +#objdump: -hpwPsections + +.*: file format .* + +#... +PE File Base Relocations.* +Virtual Address: .* Number of fixups 2 +[ ]*reloc 0 offset 0 .* (HIGHLOW|DIR64) +[ ]*reloc 1 offset [48] .* (HIGHLOW|DIR64) + +#?private flags = .* + +Section headers.*: + # Name *paddr *vaddr *size .* Flags + 1 \.text *0000.* 0.*000 0*200 .* EXECUTE,READ,CODE + 2 \.data *0000.* 0.*000 0*200 .* READ,WRITE,INITIALIZED DATA + 3 \.rdata *0000.* 0.*000 0*200 .* READ,INITIALIZED DATA + 4 \.idata *0000.* 0.*000 0*200 .* READ,INITIALIZED DATA + 5 \.reloc *0000.* 0.*000 0*200 .* DISCARDABLE,READ,INITIALIZED DATA + +Sections: +Idx Name *Size *VMA *LMA *File off .* Flags + 0 \.text *0*(1?4|8|10) .*000 .*000 0*0000... .* CONTENTS, ALLOC, LOAD, READONLY, CODE + 1 \.data *0*(8|10) .*000 .*000 0*0000... .* CONTENTS, ALLOC, LOAD, DATA + 2 \.rdata *0*0000.. .*000 .*000 0*0000... .* CONTENTS, ALLOC, LOAD, READONLY, DATA + 3 \.idata *0*1(4|8) .*000 .*000 0*0000... .* CONTENTS, ALLOC, LOAD, READONLY, DATA + 4 \.reloc *0*00000c .*000 .*000 0*0000... .* CONTENTS, LOAD, READONLY, DATA diff --git a/ld/testsuite/ld-pe/reloc2c.d b/ld/testsuite/ld-pe/reloc2c.d new file mode 100644 index 0000000..fbc1ab1 --- /dev/null +++ b/ld/testsuite/ld-pe/reloc2c.d @@ -0,0 +1,31 @@ +#source: reloc2.s +#as: --no-pad-sections +#name: PE .reloc section attributes (custom only) +#ld: --disable-reloc-section --section-align=0x1000 -e _start +#objdump: -hpwPsections + +.*: file format .* + +#... +PE File Base Relocations.* +Virtual Address: .* Number of fixups 2 +[ ]*reloc 0 offset 0 .* HIGHLOW +[ ]*reloc 1 offset [48] .* HIGHLOW + +#?private flags = .* + +Section headers.*: + # Name *paddr *vaddr *size .* Flags + 1 \.text *0000.* 0.*000 0*200 .* EXECUTE,READ,CODE + 2 \.data *0000.* 0.*000 0*200 .* READ,WRITE,INITIALIZED DATA + 3 \.rdata *0000.* 0.*000 0*200 .* READ,INITIALIZED DATA + 4 \.idata *0000.* 0.*000 0*200 .* READ,INITIALIZED DATA + 5 \.reloc *0000.* 0.*000 0*200 .* READ,INITIALIZED DATA + +Sections: +Idx Name *Size *VMA *LMA *File off .* Flags + 0 \.text *0*(1?4|8|10) .*000 .*000 0*0000... .* CONTENTS, ALLOC, LOAD, READONLY, CODE + 1 \.data *0*(8|10) .*000 .*000 0*0000... .* CONTENTS, ALLOC, LOAD, DATA + 2 \.rdata *0*0000.. .*000 .*000 0*0000... .* CONTENTS, ALLOC, LOAD, READONLY, DATA + 3 \.idata *0*1(4|8) .*000 .*000 0*0000... .* CONTENTS, ALLOC, LOAD, READONLY, DATA + 4 \.reloc *0*00000c .*000 .*000 0*0000... .* CONTENTS, ALLOC, LOAD, READONLY, DATA diff --git a/ld/testsuite/ld-pie/pie.exp b/ld/testsuite/ld-pie/pie.exp index 8989009..fc4884e 100644 --- a/ld/testsuite/ld-pie/pie.exp +++ b/ld/testsuite/ld-pie/pie.exp @@ -19,9 +19,7 @@ # MA 02110-1301, USA. # -if { ![istarget *-*-linux*] - && ![istarget *-*-nacl*] - && ![istarget *-*-gnu*] } { +if { ![istarget *-*-linux*] && ![istarget *-*-gnu*] } { return } diff --git a/ld/testsuite/ld-plugin/lto-binutils.exp b/ld/testsuite/ld-plugin/lto-binutils.exp new file mode 100644 index 0000000..1e156e4 --- /dev/null +++ b/ld/testsuite/ld-plugin/lto-binutils.exp @@ -0,0 +1,530 @@ +# Expect script for binutils tests with LTO +# Copyright (C) 2025 Free Software Foundation, Inc. +# +# This file is part of the GNU Binutils. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, +# MA 02110-1301, USA. +# + +# Make sure that binutils can correctly handle LTO IR in ELF. + +if { !([istarget *-*-linux*] + || [istarget arm*-*-uclinuxfdpiceabi] + || [istarget *-*-gnu*]) || [istarget *ecoff] } then { + return +} + +# Check to see if the C and C++ compilers work +if { ![check_compiler_available] || [which $CXX_FOR_TARGET] == 0 } { + return +} + +# These tests require plugin and LTO. +if { ![check_plugin_api_available] + || ![check_lto_available] } { + return +} + +set lto_fat "" +set lto_no_fat "" +if { [check_lto_fat_available] } { + set lto_fat "-ffat-lto-objects" + set lto_no_fat "-fno-fat-lto-objects" + set no_lto "-fno-lto" +} + +# List contains test-items: +# 0:program name +# 1:program options +# 2:input file +# 3:output file +# 4:action list (optional) +# +proc run_lto_binutils_test { lto_tests } { + global srcdir + global subdir + global nm + global objcopy + global objdump + global READELF + global strip + global plug_opt + + foreach testitem $lto_tests { + set prog_name [lindex $testitem 0] + set prog_options [lindex $testitem 1] + set input tmpdir/[lindex $testitem 2] + set output tmpdir/[lindex $testitem 3] + set actions [lindex $testitem 4] + set objfiles {} + set is_unresolved 0 + set failed 0 + +# eval set prog \$$prog_name + switch -- $prog_name { + objcopy + { + set prog $objcopy + set prog_output "$output" + } + strip + { + set prog $strip + set prog_output "-o $output" + } + default + { + perror "Unrecognized action $action" + set is_unresolved 1 + break + } + } + + # Don't leave previous output around + if { $output ne "tmpdir/" } { + remote_file host delete $output + } + + append prog_options " $plug_opt" + + set cmd_options "$prog_options $prog_output $input" + set test_name "$prog_name $cmd_options" + + set cmd "$prog $cmd_options" + send_log "$cmd\n" + set got [remote_exec host "$cmd"] + if { [lindex $got 0] != 0 || ![string match "" [lindex $got 1]] } then { + send_log "$got\n" + fail "$test_name" + continue + } + + if { $failed == 0 } { + foreach actionlist $actions { + set action [lindex $actionlist 0] + set progopts [lindex $actionlist 1] + + # There are actions where we run regexp_diff on the + # output, and there are other actions (presumably). + # Handling of the former look the same. + set dump_prog "" + switch -- $action { + objdump + { set dump_prog $objdump } + nm + { set dump_prog "$nm $plug_opt" } + readelf + { set dump_prog $READELF } + default + { + perror "Unrecognized action $action" + set is_unresolved 1 + break + } + } + + if { $dump_prog != "" } { + set dumpfile [lindex $actionlist 2] + set binary $dump_prog + + # Ensure consistent sorting of symbols + if {[info exists env(LC_ALL)]} { + set old_lc_all $env(LC_ALL) + } + set env(LC_ALL) "C" + set cmd "$binary $progopts $output > tmpdir/dump.out" + send_log "$cmd\n" + catch "exec $cmd" comp_output + if {[info exists old_lc_all]} { + set env(LC_ALL) $old_lc_all + } else { + unset env(LC_ALL) + } + set comp_output [prune_warnings $comp_output] + + if ![string match "" $comp_output] then { + send_log "$comp_output\n" + set failed 1 + break + } + + if { [regexp_diff "tmpdir/dump.out" "$srcdir/$subdir/$dumpfile"] } then { + verbose -log "output is [file_contents "tmpdir/dump.out"]" 2 + set failed 1 + break + } + } + } + } + + if { $failed } { + fail $test_name + } elseif { $is_unresolved } { + unresolved $test_name + } else { + pass $test_name + } + } +} + +run_cc_link_tests [list \ + [list \ + "Build strip-1a.o" \ + "" \ + "-O2 -flto $lto_no_fat" \ + { strip-1a.c } \ + ] \ + [list \ + "Build libstrip-1a.a" \ + "$plug_opt" \ + "-O2 -flto $lto_no_fat" \ + { strip-1a.c } \ + {} \ + "libstrip-1a.a" \ + ] \ + [list \ + "Build strip-1a-fat.o" \ + "" \ + "-O2 -flto $lto_fat" \ + { strip-1a-fat.c } \ + ] \ + [list \ + "Build libstrip-1a-fat.a" \ + "$plug_opt" \ + "-O2 -flto $lto_fat" \ + { strip-1a-fat.c } \ + {} \ + "libstrip-1a-fat.a" \ + ] \ +] + +run_lto_binutils_test [list \ + [list \ + "strip" \ + "--strip-unneeded" \ + "libstrip-1a.a" \ + "libstrip-1a-s.a" \ + ] \ + [list \ + "strip" \ + "--strip-unneeded" \ + "strip-1a.o" \ + "strip-1a-s.o" \ + ] \ + [list \ + "strip" \ + "--strip-unneeded -R .gnu.*lto_* -N __gnu_lto_v1" \ + "libstrip-1a-fat.a" \ + "libstrip-1a-fat-s.a" \ + {{readelf -SW strip-1a-fat.rd}} \ + ] \ + [list \ + "strip" \ + "--strip-unneeded -R .gnu.*lto_* -N __gnu_lto_v1" \ + "strip-1a-fat.o" \ + "strip-1a-fat-s.o" \ + {{readelf -SW strip-1a-fat.rd}} \ + ] \ + [list \ + "strip" \ + "--strip-unneeded -R .gnu.debuglto_*" \ + "libstrip-1a-fat.a" \ + "libstrip-1b-fat-s.a" \ + {{readelf -SW strip-1b-fat.rd}} \ + ] \ + [list \ + "strip" \ + "--strip-unneeded -R .gnu.debuglto_*" \ + "strip-1a-fat.o" \ + "strip-1b-fat-s.o" \ + {{readelf -SW strip-1b-fat.rd}} \ + ] \ +] + +run_lto_binutils_test [list \ + [list \ + "strip" \ + "-R .gnu.*lto_* -N __gnu_lto_v1" \ + "strip-1a.o" \ + "strip-1a-s-all.o" \ + {{nm -n strip-1a-s-all.nd}} \ + ] \ + [list \ + "strip" \ + "-R .gnu.*lto_* -N __gnu_lto_v1" \ + "libstrip-1a.a" \ + "libstrip-1a-s-all.a" \ + {{nm -n strip-1a-s-all.nd}} \ + ] \ +] + +run_cc_link_tests [list \ + [list \ + "Build strip-1a (strip-1a.o)" \ + "" \ + "-O2 -flto $lto_no_fat" \ + { strip-1b.c } \ + {} \ + "libstrip-1a" \ + "C" \ + "tmpdir/strip-1a.o" \ + ] \ + [list \ + "Build strip-1b (strip-1a-s.o)" \ + "" \ + "-O2 -flto $lto_no_fat" \ + { strip-1b.c } \ + {} \ + "libstrip-1b" \ + "C" \ + "tmpdir/strip-1a-s.o" \ + ] \ + [list \ + "Build strip-1c (libstrip-1a.a)" \ + "" \ + "-O2 -flto $lto_no_fat" \ + { strip-1b.c } \ + {} \ + "libstrip-1c" \ + "C" \ + "tmpdir/libstrip-1a.a" \ + ] \ + [list \ + "Build strip-1d (libstrip-1a-s.a)" \ + "" \ + "-O2 -flto $lto_no_fat" \ + { strip-1b.c } \ + {} \ + "libstrip-1d" \ + "C" \ + "tmpdir/libstrip-1a-s.a" \ + ] \ + [list \ + "Build strip-1e (strip-1a-fat-s.o)" \ + "" \ + "-O2 -flto $lto_fat" \ + { strip-1b-fat.c } \ + {} \ + "libstrip-1e" \ + "C" \ + "tmpdir/strip-1a-fat-s.o" \ + ] \ + [list \ + "Build strip-1f (libstrip-1a-fat-s.a)" \ + "" \ + "-O2 -flto $lto_fat" \ + { strip-1b-fat.c } \ + {} \ + "libstrip-1f" \ + "C" \ + "tmpdir/libstrip-1a-fat-s.a" \ + ] \ + [list \ + "Build strip-1g (strip-1b-fat-s.o)" \ + "" \ + "-O2 -flto $lto_fat" \ + { strip-1b-fat.c } \ + {} \ + "libstrip-1g" \ + "C" \ + "tmpdir/strip-1b-fat-s.o" \ + ] \ + [list \ + "Build strip-1h (libstrip-1b-fat-s.a)" \ + "" \ + "-O2 -flto $lto_fat" \ + { strip-1b-fat.c } \ + {} \ + "libstrip-1h" \ + "C" \ + "tmpdir/libstrip-1b-fat-s.a" \ + ] \ +] + +proc run_pr33246_test { llvm fat } { + global srcdir + global subdir + global plug_opt + global llvm_plug_opt + global ar + global CLANG_FOR_TARGET + global CC_FOR_TARGET + global NM + global READELF + global strip + + set strip_flags "--strip-debug --enable-deterministic-archives" + + set test pr33246 + set testname "${test}${llvm}${fat} with $strip_flags" + + if { "$llvm" == "-llvm" } { + # Skip native x32 and i?86 targets since system LLVMgold.so may + # not be compatible with native x32 and i?86 targets binutils. + if { [istarget "x86_64-*-linux*-gnux32"] + || [istarget "i?86-*-*"] + || ![info exists CLANG_FOR_TARGET] + || [string match "" $llvm_plug_opt] } then { + untested $testname + return + } + set CC $CLANG_FOR_TARGET + set binutils_plug_opt "$llvm_plug_opt" + } else { + if { ![info exists CC_FOR_TARGET] + || [string match "" $plug_opt] } then { + untested $testname + return + } + set CC $CC_FOR_TARGET + set binutils_plug_opt "$plug_opt" + } + + append strip_flags " $binutils_plug_opt" + + set src $srcdir/$subdir/${test}.c + set obj tmpdir/${test}${llvm}${fat}.o + set archive tmpdir/${test}${llvm}${fat}.a + set CFLAGS "-c -g -O2 -flto" + if { "$fat" == "-fat" } { + append CFLAGS " -ffat-lto-objects" + } else { + append CFLAGS " -fno-fat-lto-objects" + } + + set cmd "$CC $CFLAGS -o $obj $src" + send_log "$cmd\n" + verbose "$cmd" 1 + catch "exec $cmd" got + if ![string match "" $got] then { + send_log "$got\n" + verbose "$got" 1 + fail "$testname ($obj)" + return + } + + set cmd "$strip $strip_flags $obj -o ${obj}.strip" + send_log "$cmd\n" + verbose "$cmd" 1 + catch "exec $cmd" got + if ![string match "" $got] then { + send_log "$got\n" + verbose "$got" 1 + fail "$testname (strip $obj)" + return + } + + set cmd "$NM $binutils_plug_opt ${obj}.strip" + send_log "$cmd\n" + verbose "$cmd" 1 + catch "exec $cmd" got + if ![regexp "0+ T foo" $got] then { + send_log "$got\n" + verbose "$got" 1 + fail "$testname (strip $obj)" + return + } + + if { "$fat" == "-fat" } { + set cmd "$READELF -SW ${obj}.strip" + send_log "$cmd\n" + verbose "$cmd" 1 + catch "exec $cmd" got + if [regexp " \.debug_" $got] then { + send_log "$got\n" + verbose "$got" 1 + fail "$testname (strip $obj)" + return + } + } else { + set cmd "cmp $obj ${obj}.strip" + send_log "$cmd\n" + verbose "$cmd" 1 + catch "exec $cmd" got + if ![string match "" $got] then { + send_log "$got\n" + verbose "$got" 1 + fail "$testname (strip $obj)" + return + } + } + + pass "$testname (strip $obj)" + + set cmd "$ar $binutils_plug_opt -D -s -r -c $archive $obj" + send_log "$cmd\n" + verbose "$cmd" 1 + catch "exec $cmd" got + if ![string match "" $got] then { + send_log "$got\n" + verbose "$got" 1 + fail "$testname ($archive)" + return + } + + set cmd "$strip $strip_flags $archive -o ${archive}.strip" + send_log "$cmd\n" + verbose "$cmd" 1 + catch "exec $cmd" got + if ![string match "" $got] then { + send_log "$got\n" + verbose "$got" 1 + fail "$testname (strip $archive)" + return + } + + set cmd "$NM $binutils_plug_opt ${archive}.strip" + send_log "$cmd\n" + verbose "$cmd" 1 + catch "exec $cmd" got + if ![regexp "0+ T foo" $got] then { + send_log "$got\n" + verbose "$got" 1 + fail "$testname (strip $archive)" + return + } + + if { "$fat" == "-fat" } { + set cmd "$READELF -SW ${archive}.strip" + send_log "$cmd\n" + verbose "$cmd" 1 + catch "exec $cmd" got + if [regexp " \.debug_" $got] then { + send_log "$got\n" + verbose "$got" 1 + fail "$testname (strip $archive)" + return + } + } else { + set cmd "cmp $archive ${archive}.strip" + send_log "$cmd\n" + verbose "$cmd" 1 + catch "exec $cmd" got + if ![string match "" $got] then { + send_log "$got\n" + verbose "$got" 1 + fail "$testname (strip $archive)" + return + } + } + + pass "$testname (strip $archive)" +} + +run_pr33246_test "" "" +run_pr33246_test "" "-fat" +run_pr33246_test "-llvm" "" +run_pr33246_test "-llvm" "-fat" diff --git a/ld/testsuite/ld-plugin/lto.exp b/ld/testsuite/ld-plugin/lto.exp index 3a56fb5..9ac3cf6 100644 --- a/ld/testsuite/ld-plugin/lto.exp +++ b/ld/testsuite/ld-plugin/lto.exp @@ -51,6 +51,11 @@ if { [check_lto_fat_available] } { set no_lto "-fno-lto" } +set as_gsframe "" +if { [gas_sframe_check] } { + set as_gsframe "-Wa,--gsframe" +} + # Simple LTO tests and generate input files for complex LTO tests. set lto_link_tests [list \ [list "LTO 1" \ @@ -76,10 +81,10 @@ set lto_link_tests [list \ "" "-flto $lto_fat" \ {lto-4a.c} {} ""] \ [list "Compile 4b" \ - "" "-O2" \ + "" "-O2 $as_gsframe" \ {lto-4b.c} {} ""] \ [list "Compile 4c" \ - "" "-O2" \ + "" "-O2 $as_gsframe" \ {lto-4c.c} {} ""] \ [list "Compile 5a" \ "" "-flto $lto_fat" \ @@ -1004,7 +1009,7 @@ run_cc_link_tests [list \ set board_flags [get_board_flags] set exec_output [run_host_cmd "sh" \ - "-c \"ulimit -n 20; \ + "-c \"ulimit -n 25; \ $CC_FOR_TARGET $gcc_B_opt $CFLAGS_FOR_TARGET \ $board_flags $ld_L_opt -o tmpdir/pr28138 \ tmpdir/pr28138.o tmpdir/pr28138.a\""] @@ -1158,9 +1163,8 @@ remote_exec host "mv" "tmpdir/dump tmpdir/lto-5.o" run_dump_test "lto-10r" remote_exec host "mv" "tmpdir/dump tmpdir/lto-10.o" set testname "nm mixed object" -set lto_plugin [string trim [run_host_cmd "$CC_FOR_TARGET" "-print-prog-name=liblto_plugin.so"]] -if { [ regexp "liblto_plugin.so" $lto_plugin ] } { - set exec_output [run_host_cmd "$NM" "--plugin $lto_plugin tmpdir/lto-10.o"] +if { $plug_opt != "" } { + set exec_output [run_host_cmd "$NM" "$plug_opt tmpdir/lto-10.o"] if { [ regexp "(D|T) main" $exec_output ] } { pass $testname } else { diff --git a/ld/testsuite/ld-plugin/plugin.exp b/ld/testsuite/ld-plugin/plugin.exp index 38a4036..2e148e4 100644 --- a/ld/testsuite/ld-plugin/plugin.exp +++ b/ld/testsuite/ld-plugin/plugin.exp @@ -87,11 +87,11 @@ set regcln "-plugin-opt registercleanup" set failed_compile 0 set _ "" set plugin_nm_output "" -set old_CFLAGS "$CFLAGS_FOR_TARGET" -append CFLAGS_FOR_TARGET " $NOSANITIZE_CFLAGS $NOLTO_CFLAGS" +set old_CFLAGS "$CFLAGS_FOR_TARGET_TEST" +append CFLAGS_FOR_TARGET_TEST " $NOSANITIZE_CFLAGS $NOLTO_CFLAGS" if { [istarget m681*-*-*] || [istarget m68hc1*-*-*] || [istarget m9s12x*-*-*] } { # otherwise get FAILS due to _.frame - append CFLAGS_FOR_TARGET " -fomit-frame-pointer" + append CFLAGS_FOR_TARGET_TEST " -fomit-frame-pointer" } if { $can_compile && \ @@ -291,7 +291,7 @@ if { !$can_compile || $failed_compile } { unsupported [lindex $testitem 0] } } - set CFLAGS_FOR_TARGET "$old_CFLAGS" + set CFLAGS_FOR_TARGET_TEST "$old_CFLAGS" return } @@ -394,4 +394,4 @@ if [ar_simple_create $ar "--plugin $plugin4_path" "tmpdir/libpr20070.a" \ unsupported "PR ld/20070" } -set CFLAGS_FOR_TARGET "$old_CFLAGS" +set CFLAGS_FOR_TARGET_TEST "$old_CFLAGS" diff --git a/ld/testsuite/ld-plugin/pr25618a.h b/ld/testsuite/ld-plugin/pr25618a.h index 9bf857c..04be194 100644 --- a/ld/testsuite/ld-plugin/pr25618a.h +++ b/ld/testsuite/ld-plugin/pr25618a.h @@ -1,2 +1 @@ -#pragma once __attribute__((visibility("default"))) int bar(); diff --git a/ld/testsuite/ld-plugin/pr25618b.h b/ld/testsuite/ld-plugin/pr25618b.h index cd80074..65e72a0 100644 --- a/ld/testsuite/ld-plugin/pr25618b.h +++ b/ld/testsuite/ld-plugin/pr25618b.h @@ -1,2 +1 @@ -#pragma once __attribute__((visibility("default"))) int foo(); diff --git a/ld/testsuite/ld-plugin/pr33246.c b/ld/testsuite/ld-plugin/pr33246.c new file mode 100644 index 0000000..cd0130c --- /dev/null +++ b/ld/testsuite/ld-plugin/pr33246.c @@ -0,0 +1,4 @@ +void +foo (void) +{ +} diff --git a/ld/testsuite/ld-plugin/strip-1a-fat.c b/ld/testsuite/ld-plugin/strip-1a-fat.c new file mode 100644 index 0000000..03b2a5c --- /dev/null +++ b/ld/testsuite/ld-plugin/strip-1a-fat.c @@ -0,0 +1 @@ +#include "strip-1a.c" diff --git a/ld/testsuite/ld-plugin/strip-1a-fat.rd b/ld/testsuite/ld-plugin/strip-1a-fat.rd new file mode 100644 index 0000000..aefe1c5 --- /dev/null +++ b/ld/testsuite/ld-plugin/strip-1a-fat.rd @@ -0,0 +1,6 @@ +#failif +#... +Section Headers: +#... + \[[ 0-9]+\] \.gnu.lto_.* +#... diff --git a/ld/testsuite/ld-plugin/strip-1a-s-all.nd b/ld/testsuite/ld-plugin/strip-1a-s-all.nd new file mode 100644 index 0000000..52265c2 --- /dev/null +++ b/ld/testsuite/ld-plugin/strip-1a-s-all.nd @@ -0,0 +1,6 @@ +#... + + U foo2 + + U foo3 +0+ T foo1 +0+ T main +#pass diff --git a/ld/testsuite/ld-plugin/strip-1a.c b/ld/testsuite/ld-plugin/strip-1a.c new file mode 100644 index 0000000..d84af20 --- /dev/null +++ b/ld/testsuite/ld-plugin/strip-1a.c @@ -0,0 +1,4 @@ +extern void foo2(void); +extern void foo3(void); +void foo1(void) { foo3(); } +int main(void) { foo2(); } diff --git a/ld/testsuite/ld-plugin/strip-1b-fat.c b/ld/testsuite/ld-plugin/strip-1b-fat.c new file mode 100644 index 0000000..1a2e4d2 --- /dev/null +++ b/ld/testsuite/ld-plugin/strip-1b-fat.c @@ -0,0 +1 @@ +#include "strip-1b.c" diff --git a/ld/testsuite/ld-plugin/strip-1b-fat.rd b/ld/testsuite/ld-plugin/strip-1b-fat.rd new file mode 100644 index 0000000..e3a266f --- /dev/null +++ b/ld/testsuite/ld-plugin/strip-1b-fat.rd @@ -0,0 +1,5 @@ +#... +Section Headers: +#... + \[[ 0-9]+\] \.gnu.lto_.* +#pass diff --git a/ld/testsuite/ld-plugin/strip-1b.c b/ld/testsuite/ld-plugin/strip-1b.c new file mode 100644 index 0000000..967872a --- /dev/null +++ b/ld/testsuite/ld-plugin/strip-1b.c @@ -0,0 +1,3 @@ +extern void foo1(void); +void foo2(void) { foo1(); } +void foo3(void) {} diff --git a/ld/testsuite/ld-powerpc/elfv2-2so.d b/ld/testsuite/ld-powerpc/elfv2-2so.d index 56b1434..18bc87f 100644 --- a/ld/testsuite/ld-powerpc/elfv2-2so.d +++ b/ld/testsuite/ld-powerpc/elfv2-2so.d @@ -2,4 +2,4 @@ #source: elfv2-2b.s #as: -a64 #ld: -melf64ppc -shared -e f1 -#error: .* R_PPC64_ADDR64_LOCAL reloc unsupported in shared libraries and PIEs.* +#error: .* R_PPC64_ADDR64_LOCAL unsupported in shared libraries and PIEs.* diff --git a/ld/testsuite/ld-riscv-elf/absolute-no-relative.d b/ld/testsuite/ld-riscv-elf/absolute-no-relative.d new file mode 100644 index 0000000..6699ac1 --- /dev/null +++ b/ld/testsuite/ld-riscv-elf/absolute-no-relative.d @@ -0,0 +1,9 @@ +#source: absolute-no-relative.s +#as: +#ld: -Tabsolute-no-relative.ld -pie +#readelf: -Wr + +Relocation section '.rela.dyn' at .* +[ ]+Offset[ ]+Info[ ]+Type[ ]+.* +0+[ ]+0+[ ]+R_RISCV_NONE[ ]+0 +0+[ ]+0+[ ]+R_RISCV_NONE[ ]+0 diff --git a/ld/testsuite/ld-riscv-elf/absolute-no-relative.ld b/ld/testsuite/ld-riscv-elf/absolute-no-relative.ld new file mode 100644 index 0000000..34bbcba --- /dev/null +++ b/ld/testsuite/ld-riscv-elf/absolute-no-relative.ld @@ -0,0 +1,6 @@ +ENTRY(_start) +SECTIONS { + __symbol_abs__ = 0x1234; + .text 0x10000 : { *(.text*)} + .got 0x20000 : { *(.got*) } +} diff --git a/ld/testsuite/ld-riscv-elf/absolute-no-relative.s b/ld/testsuite/ld-riscv-elf/absolute-no-relative.s new file mode 100644 index 0000000..4515661 --- /dev/null +++ b/ld/testsuite/ld-riscv-elf/absolute-no-relative.s @@ -0,0 +1,8 @@ +.text +.global _start +_start: +lga x1, symbol_abs +lga x1, __symbol_abs__ + +.global symbol_abs +.set symbol_abs, 0x100 diff --git a/ld/testsuite/ld-riscv-elf/discard-exe.d b/ld/testsuite/ld-riscv-elf/discard-exe.d new file mode 100644 index 0000000..7bdb16b1 --- /dev/null +++ b/ld/testsuite/ld-riscv-elf/discard-exe.d @@ -0,0 +1,6 @@ +#source: discard.s +#as: +#ld: -Tdiscard.ld +#readelf: -rW + +There are no relocations in this file. diff --git a/ld/testsuite/ld-riscv-elf/discard-pic.d b/ld/testsuite/ld-riscv-elf/discard-pic.d new file mode 100644 index 0000000..9ac2cc6 --- /dev/null +++ b/ld/testsuite/ld-riscv-elf/discard-pic.d @@ -0,0 +1,9 @@ +#source: discard.s +#as: +#ld: -shared -Tdiscard.ld +#readelf: -rW + +Relocation section '\.rela\.dyn'.* +[ ]+Offset[ ]+Info[ ]+Type.* +0+0[ ]+0+0[ ]+R_RISCV_NONE[ ]+0 +0+(20008|20010)[ ]+[0-9a-f]+[ ]+R_RISCV_(32|64)[ ]+0+10008[ ]+sym_global \+ 0 diff --git a/ld/testsuite/ld-riscv-elf/discard-pie.d b/ld/testsuite/ld-riscv-elf/discard-pie.d new file mode 100644 index 0000000..cb95c4a --- /dev/null +++ b/ld/testsuite/ld-riscv-elf/discard-pie.d @@ -0,0 +1,9 @@ +#source: discard.s +#as: +#ld: -pie -Tdiscard.ld +#readelf: -rW + +Relocation section '\.rela\.dyn'.* +[ ]+Offset[ ]+Info[ ]+Type.* +0+0[ ]+0+0[ ]+R_RISCV_NONE[ ]+0 +0+0[ ]+0+0[ ]+R_RISCV_NONE[ ]+0 diff --git a/ld/testsuite/ld-riscv-elf/discard.ld b/ld/testsuite/ld-riscv-elf/discard.ld new file mode 100644 index 0000000..3afed21 --- /dev/null +++ b/ld/testsuite/ld-riscv-elf/discard.ld @@ -0,0 +1,13 @@ +OUTPUT_ARCH(riscv) +ENTRY(_start) +SECTIONS +{ + /DISCARD/ : { *(.discard.*) } + + . = 0x10000; + .text : { *(.text) } + . = 0x20000; + .got : { *(.got) *(.got.plt)} + . = 0x30000; + .data : { *(.data) *(.data.*) } +} diff --git a/ld/testsuite/ld-riscv-elf/discard.s b/ld/testsuite/ld-riscv-elf/discard.s new file mode 100644 index 0000000..f03ea2b --- /dev/null +++ b/ld/testsuite/ld-riscv-elf/discard.s @@ -0,0 +1,65 @@ +.text +.option pic +.option norvc +.p2align 3 +.global _start +_start: + nop + +sym_local: + nop + +.global sym_global +sym_global: + nop + +.global sym_hidden +.hidden sym_hidden +sym_hidden: + nop + +.global sym_global_abs +.set sym_global_abs, 42 + +.global sym_weak_undef +.weak sym_weak_undef + +# Got + +.section .discard.got_local, "ax" + la x1, sym_local + +.section .discard.got_global, "ax" + la x1, sym_global + +# Data + +.section .discard.local,"a" +.p2align 1 +discard_local: +.quad sym_local + +.section .discard.global,"a" +.p2align 1 +discard_global: +.quad sym_global + +.section .discard.hidden,"a" +.p2align 1 +discard_hidden: +.quad sym_hidden + +.section .discard.global_abs,"a" +.p2align 1 +discard_global_abs: +.quad sym_global_abs + +.section .discard.weak_undef,"a" +.p2align 1 +discard_weak_undef: +.quad sym_weak_undef + +.section .discard._DYNAMIC,"a" +.p2align 1 +discard_DYNAMIC: +.quad _DYNAMIC diff --git a/ld/testsuite/ld-riscv-elf/ld-riscv-elf.exp b/ld/testsuite/ld-riscv-elf/ld-riscv-elf.exp index 9cb847d..b0d510a 100644 --- a/ld/testsuite/ld-riscv-elf/ld-riscv-elf.exp +++ b/ld/testsuite/ld-riscv-elf/ld-riscv-elf.exp @@ -227,6 +227,21 @@ if [istarget "riscv*-*-*"] { run_dump_test "data-reloc-rv64-addr32-pic" run_dump_test "data-reloc-rv64-undef32-pic" + run_dump_test "property-zicfilp-unlabeled" + run_dump_test "property-zicfiss" + run_dump_test "property-combine-and-1" + run_dump_test "property-combine-and-2" + run_dump_test "property-combine-and-3" + + run_dump_test "zicfilp-unlabeled-plt" + + run_dump_test "pie-bind-locally-rv32" + run_dump_test "pie-bind-locally-rv64" + + run_dump_test "discard-exe" + run_dump_test "discard-pie" + run_dump_test "discard-pic" + # IFUNC testcases. # Check IFUNC by single type relocs. run_dump_test_ifunc "ifunc-reloc-call-01" rv32 exe @@ -323,4 +338,5 @@ if [istarget "riscv*-*-*"] { } run_dump_test "tls" run_dump_test "tlsbin" + run_dump_test "absolute-no-relative" } diff --git a/ld/testsuite/ld-riscv-elf/pcgp-relax-01-norelaxgp.d b/ld/testsuite/ld-riscv-elf/pcgp-relax-01-norelaxgp.d index d134457..c60e48a 100644 --- a/ld/testsuite/ld-riscv-elf/pcgp-relax-01-norelaxgp.d +++ b/ld/testsuite/ld-riscv-elf/pcgp-relax-01-norelaxgp.d @@ -1,5 +1,6 @@ #source: pcgp-relax-01.s -#ld: --no-relax-gp --relax +#as: -march=rv64i +#ld: --no-relax-gp --relax -m[riscv_choose_lp64_emul] #objdump: -d -Mno-aliases .*:[ ]+file format .* diff --git a/ld/testsuite/ld-riscv-elf/pcgp-relax-01.d b/ld/testsuite/ld-riscv-elf/pcgp-relax-01.d index f942567..24f9c49 100644 --- a/ld/testsuite/ld-riscv-elf/pcgp-relax-01.d +++ b/ld/testsuite/ld-riscv-elf/pcgp-relax-01.d @@ -1,5 +1,6 @@ #source: pcgp-relax-01.s -#ld: --relax +#as: -march=rv64i +#ld: --relax -m[riscv_choose_lp64_emul] #objdump: -d -Mno-aliases .*:[ ]+file format .* diff --git a/ld/testsuite/ld-riscv-elf/pie-bind-locally-a.s b/ld/testsuite/ld-riscv-elf/pie-bind-locally-a.s new file mode 100644 index 0000000..c1ff19b --- /dev/null +++ b/ld/testsuite/ld-riscv-elf/pie-bind-locally-a.s @@ -0,0 +1,5 @@ + .text + .global _start +_start: + .option pic + la a0, _start diff --git a/ld/testsuite/ld-riscv-elf/pie-bind-locally-b.s b/ld/testsuite/ld-riscv-elf/pie-bind-locally-b.s new file mode 100644 index 0000000..e5f16cd --- /dev/null +++ b/ld/testsuite/ld-riscv-elf/pie-bind-locally-b.s @@ -0,0 +1,8 @@ + .section .data.rel,"aw",%progbits + .type q, %object +q: +.ifdef __64_bit__ + .quad _start +.else + .word _start +.endif diff --git a/ld/testsuite/ld-riscv-elf/pie-bind-locally-rv32.d b/ld/testsuite/ld-riscv-elf/pie-bind-locally-rv32.d new file mode 100644 index 0000000..0133995 --- /dev/null +++ b/ld/testsuite/ld-riscv-elf/pie-bind-locally-rv32.d @@ -0,0 +1,10 @@ +#source: pie-bind-locally-a.s +#source: pie-bind-locally-b.s +#as: -march=rv32i -mabi=ilp32 +#ld: -m[riscv_choose_ilp32_emul] -pie +#readelf: -Wr + +Relocation section '\.rela\.dyn' at offset .* contains 2 entries: +[ ]+Offset[ ]+Info[ ]+Type[ ]+.* +[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_RISCV_RELATIVE[ ].* +[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_RISCV_RELATIVE[ ].* diff --git a/ld/testsuite/ld-riscv-elf/pie-bind-locally-rv64.d b/ld/testsuite/ld-riscv-elf/pie-bind-locally-rv64.d new file mode 100644 index 0000000..6ae627a --- /dev/null +++ b/ld/testsuite/ld-riscv-elf/pie-bind-locally-rv64.d @@ -0,0 +1,10 @@ +#source: pie-bind-locally-a.s +#source: pie-bind-locally-b.s +#as: -march=rv64i -mabi=lp64 -defsym __64_bit__=1 +#ld: -m[riscv_choose_lp64_emul] -pie +#readelf: -Wr + +Relocation section '\.rela\.dyn' at offset .* contains 2 entries: +[ ]+Offset[ ]+Info[ ]+Type[ ]+.* +[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_RISCV_RELATIVE[ ].* +[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_RISCV_RELATIVE[ ].* diff --git a/ld/testsuite/ld-riscv-elf/property-combine-and-1.d b/ld/testsuite/ld-riscv-elf/property-combine-and-1.d new file mode 100644 index 0000000..571620f --- /dev/null +++ b/ld/testsuite/ld-riscv-elf/property-combine-and-1.d @@ -0,0 +1,6 @@ +#name: RISC-V GNU Property (multiple inputs, combine section) - 1 +#source: property1.s +#source: property2.s +#as: -march=rv64g +#ld: -shared -melf64lriscv +#readelf: -n diff --git a/ld/testsuite/ld-riscv-elf/property-combine-and-2.d b/ld/testsuite/ld-riscv-elf/property-combine-and-2.d new file mode 100644 index 0000000..23482af --- /dev/null +++ b/ld/testsuite/ld-riscv-elf/property-combine-and-2.d @@ -0,0 +1,11 @@ +#name: RISC-V GNU Property (multiple inputs, combine section) - 2 +#source: property1.s +#source: property3.s +#as: -march=rv64g +#ld: -shared -melf64lriscv +#readelf: -n + +Displaying notes found in: .note.gnu.property +[ ]+Owner[ ]+Data size[ ]+Description +[ ]+GNU[ ]+0x00000010[ ]+NT_GNU_PROPERTY_TYPE_0 +[ ]+Properties: RISC-V AND feature: CFI_LP_UNLABELED diff --git a/ld/testsuite/ld-riscv-elf/property-combine-and-3.d b/ld/testsuite/ld-riscv-elf/property-combine-and-3.d new file mode 100644 index 0000000..b57a0f7 --- /dev/null +++ b/ld/testsuite/ld-riscv-elf/property-combine-and-3.d @@ -0,0 +1,11 @@ +#name: RISC-V GNU Property (multiple inputs, combine section) - 3 +#source: property1.s +#source: property4.s +#as: -march=rv64g +#ld: -shared -melf64lriscv +#readelf: -n + +Displaying notes found in: .note.gnu.property +[ ]+Owner[ ]+Data size[ ]+Description +[ ]+GNU[ ]+0x00000010[ ]+NT_GNU_PROPERTY_TYPE_0 +[ ]+Properties: RISC-V AND feature: CFI_SS diff --git a/ld/testsuite/ld-riscv-elf/property-zicfilp-unlabeled.d b/ld/testsuite/ld-riscv-elf/property-zicfilp-unlabeled.d new file mode 100644 index 0000000..48d60d6 --- /dev/null +++ b/ld/testsuite/ld-riscv-elf/property-zicfilp-unlabeled.d @@ -0,0 +1,10 @@ +#name: GNU Property (single input, CFI_LP_UNLABELED) +#source: property-zicfilp-unlabeled.s +#as: -march=rv64g +#ld: -shared -melf64lriscv +#readelf: -n + +Displaying notes found in: .note.gnu.property +[ ]+Owner[ ]+Data size[ ]+Description +[ ]+GNU[ ]+0x00000010[ ]+NT_GNU_PROPERTY_TYPE_0 +[ ]+Properties: RISC-V AND feature: CFI_LP_UNLABELED diff --git a/ld/testsuite/ld-riscv-elf/property-zicfilp-unlabeled.s b/ld/testsuite/ld-riscv-elf/property-zicfilp-unlabeled.s new file mode 100644 index 0000000..b0192c0 --- /dev/null +++ b/ld/testsuite/ld-riscv-elf/property-zicfilp-unlabeled.s @@ -0,0 +1,21 @@ + .text + .globl _start + .type _start,@function +_start: + ret + + .section ".note.gnu.property", "a" + .p2align 3 + .long 1f - 0f /* name length */ + .long 5f - 2f /* data length */ + .long 5 /* note type */ +0: .asciz "GNU" /* vendor name */ +1: + .p2align 3 +2: .long 0xc0000000 /* pr_type. */ + .long 4f - 3f /* pr_datasz. */ +3: + .long 0x1 /* GNU_PROPERTY_RISCV_FEATURE_1_CFI_LP_UNLABELED. */ +4: + .p2align 3 +5: diff --git a/ld/testsuite/ld-riscv-elf/property-zicfiss.d b/ld/testsuite/ld-riscv-elf/property-zicfiss.d new file mode 100644 index 0000000..0dec1a1 --- /dev/null +++ b/ld/testsuite/ld-riscv-elf/property-zicfiss.d @@ -0,0 +1,10 @@ +#name: GNU Property (single input, CFI_SS) +#source: property-zicfiss.s +#as: -march=rv64g +#ld: -shared -melf64lriscv +#readelf: -n + +Displaying notes found in: .note.gnu.property +[ ]+Owner[ ]+Data size[ ]+Description +[ ]+GNU[ ]+0x00000010[ ]+NT_GNU_PROPERTY_TYPE_0 +[ ]+Properties: RISC-V AND feature: CFI_SS diff --git a/ld/testsuite/ld-riscv-elf/property-zicfiss.s b/ld/testsuite/ld-riscv-elf/property-zicfiss.s new file mode 100644 index 0000000..21342ef --- /dev/null +++ b/ld/testsuite/ld-riscv-elf/property-zicfiss.s @@ -0,0 +1,21 @@ + .text + .globl _start + .type _start,@function +_start: + ret + + .section ".note.gnu.property", "a" + .p2align 3 + .long 1f - 0f /* name length */ + .long 5f - 2f /* data length */ + .long 5 /* note type */ +0: .asciz "GNU" /* vendor name */ +1: + .p2align 3 +2: .long 0xc0000000 /* pr_type. */ + .long 4f - 3f /* pr_datasz. */ +3: + .long 0x2 /* GNU_PROPERTY_RISCV_FEATURE_1_CFI_SS. */ +4: + .p2align 3 +5: diff --git a/ld/testsuite/ld-riscv-elf/property1.s b/ld/testsuite/ld-riscv-elf/property1.s new file mode 100644 index 0000000..622bbcb --- /dev/null +++ b/ld/testsuite/ld-riscv-elf/property1.s @@ -0,0 +1,21 @@ + .text + .globl _start + .type _start,@function +_start: + ret + + .section ".note.gnu.property", "a" + .p2align 3 + .long 1f - 0f /* name length */ + .long 5f - 2f /* data length */ + .long 5 /* note type */ +0: .asciz "GNU" /* vendor name */ +1: + .p2align 3 +2: .long 0xc0000000 /* pr_type. */ + .long 4f - 3f /* pr_datasz. */ +3: + .long 0x3 /* CFI_LP_UNLABELED and CFI_SS. */ +4: + .p2align 3 +5: diff --git a/ld/testsuite/ld-riscv-elf/property2.s b/ld/testsuite/ld-riscv-elf/property2.s new file mode 100644 index 0000000..4d1610c --- /dev/null +++ b/ld/testsuite/ld-riscv-elf/property2.s @@ -0,0 +1,5 @@ + .text + .globl foo + .type foo,@function +foo: + ret diff --git a/ld/testsuite/ld-riscv-elf/property3.s b/ld/testsuite/ld-riscv-elf/property3.s new file mode 100644 index 0000000..61518fb --- /dev/null +++ b/ld/testsuite/ld-riscv-elf/property3.s @@ -0,0 +1,21 @@ + .text + .globl _start + .type _start,@function +bar: + ret + + .section ".note.gnu.property", "a" + .p2align 3 + .long 1f - 0f /* name length */ + .long 5f - 2f /* data length */ + .long 5 /* note type */ +0: .asciz "GNU" /* vendor name */ +1: + .p2align 3 +2: .long 0xc0000000 /* pr_type. */ + .long 4f - 3f /* pr_datasz. */ +3: + .long 0x1 /* CFI_LP_UNLABELED. */ +4: + .p2align 3 +5: diff --git a/ld/testsuite/ld-riscv-elf/property4.s b/ld/testsuite/ld-riscv-elf/property4.s new file mode 100644 index 0000000..54098a5 --- /dev/null +++ b/ld/testsuite/ld-riscv-elf/property4.s @@ -0,0 +1,21 @@ + .text + .globl _start + .type _start,@function +zoo: + ret + + .section ".note.gnu.property", "a" + .p2align 3 + .long 1f - 0f /* name length */ + .long 5f - 2f /* data length */ + .long 5 /* note type */ +0: .asciz "GNU" /* vendor name */ +1: + .p2align 3 +2: .long 0xc0000000 /* pr_type. */ + .long 4f - 3f /* pr_datasz. */ +3: + .long 0x2 /* CFI_LP_SS. */ +4: + .p2align 3 +5: diff --git a/ld/testsuite/ld-riscv-elf/relax-max-align-gp.d b/ld/testsuite/ld-riscv-elf/relax-max-align-gp.d index 5832835..a4a94db 100644 --- a/ld/testsuite/ld-riscv-elf/relax-max-align-gp.d +++ b/ld/testsuite/ld-riscv-elf/relax-max-align-gp.d @@ -1,5 +1,6 @@ #source: relax-max-align-gp.s -#ld: +#as: -march=rv64i +#ld: -m[riscv_choose_lp64_emul] #objdump: -d .*:[ ]+file format .* diff --git a/ld/testsuite/ld-riscv-elf/relro-relax-lui.d b/ld/testsuite/ld-riscv-elf/relro-relax-lui.d index d29aa9d..2b0670e 100644 --- a/ld/testsuite/ld-riscv-elf/relro-relax-lui.d +++ b/ld/testsuite/ld-riscv-elf/relro-relax-lui.d @@ -1,5 +1,6 @@ #source: relro-relax-lui.s -#ld: -zrelro --relax +#as: -march=rv64i +#ld: -zrelro --relax -m[riscv_choose_lp64_emul] #objdump: -d -Mno-aliases .*:[ ]+file format .* diff --git a/ld/testsuite/ld-riscv-elf/shared-lib-nopic-02.d b/ld/testsuite/ld-riscv-elf/shared-lib-nopic-02.d index f866d01..67ac439 100644 --- a/ld/testsuite/ld-riscv-elf/shared-lib-nopic-02.d +++ b/ld/testsuite/ld-riscv-elf/shared-lib-nopic-02.d @@ -1,4 +1,4 @@ #source: shared-lib-nopic-02.s #as: #ld: -shared -#error: .*relocation R_RISCV_JAL against `foo_default' which may bind externally can not be used when making a shared object; recompile with -fPIC +#error: .*relocation (R_RISCV_RVC_JUMP|R_RISCV_JAL) against `foo_default' which may bind externally can not be used when making a shared object; recompile with -fPIC diff --git a/ld/testsuite/ld-riscv-elf/variant_cc-now.d b/ld/testsuite/ld-riscv-elf/variant_cc-now.d index 9453554..b46b03c 100644 --- a/ld/testsuite/ld-riscv-elf/variant_cc-now.d +++ b/ld/testsuite/ld-riscv-elf/variant_cc-now.d @@ -1,6 +1,7 @@ #source: variant_cc-1.s #source: variant_cc-2.s -#ld: -shared --hash-style=sysv -Ttext 0x8000 -z now +#as: -march=rv64i -mabi=lp64 +#ld: -shared --hash-style=sysv -Ttext 0x8000 -z now -m[riscv_choose_lp64_emul] #readelf: -rsW Relocation section '.rela.plt' at .* diff --git a/ld/testsuite/ld-riscv-elf/variant_cc-shared.d b/ld/testsuite/ld-riscv-elf/variant_cc-shared.d index ffb69a3..df7a134 100644 --- a/ld/testsuite/ld-riscv-elf/variant_cc-shared.d +++ b/ld/testsuite/ld-riscv-elf/variant_cc-shared.d @@ -1,6 +1,7 @@ #source: variant_cc-1.s #source: variant_cc-2.s -#ld: -shared --hash-style=sysv -Ttext 0x8000 +#as: -march=rv64i -mabi=lp64 +#ld: -shared --hash-style=sysv -Ttext 0x8000 -m[riscv_choose_lp64_emul] #readelf: -rsW Relocation section '.rela.plt' at .* diff --git a/ld/testsuite/ld-riscv-elf/zicfilp-unlabeled-plt.d b/ld/testsuite/ld-riscv-elf/zicfilp-unlabeled-plt.d new file mode 100644 index 0000000..bb888d1 --- /dev/null +++ b/ld/testsuite/ld-riscv-elf/zicfilp-unlabeled-plt.d @@ -0,0 +1,35 @@ +#name: Unlabled landing pad PLT +#source: zicfilp-unlabeled-plt.s +#ld: -shared -melf64lriscv +#objdump: -dr -j .plt +#as: -march=rv64gc_zicfilp + +[^:]*: *file format elf64-.*riscv + +Disassembly of section \.plt: + +[0-9a-f]+ <\.plt>: +.*:[ ]+[0-9a-f]+[ ]+lpad[ ]+0x0 +.*:[ ]+[0-9a-f]+[ ]+auipc[ ]+t2,0x[0-9a-f]+ +.*:[ ]+[0-9a-f]+[ ]+sub[ ]+t1,t1,t3 +.*:[ ]+[0-9a-f]+[ ]+ld[ ]+t3,[0-9]+\(t2\) # [0-9a-f]+ <\.got\.plt> +.*:[ ]+[0-9a-f]+[ ]+addi[ ]+t1,t1,-64 +.*:[ ]+[0-9a-f]+[ ]+addi[ ]+t0,t2,[0-9]+ +.*:[ ]+[0-9a-f]+[ ]+srli[ ]+t1,t1,0x1 +.*:[ ]+[0-9a-f]+[ ]+ld[ ]+t0,8\(t0\) +.*:[ ]+[0-9a-f]+[ ]+jr[ ]+t3 +.*:[ ]+[0-9a-f]+[ ]+nop +.*:[ ]+[0-9a-f]+[ ]+nop +.*:[ ]+[0-9a-f]+[ ]+nop + +[0-9a-f]+ <foo@plt>: +.*:[ ]+[0-9a-f]+[ ]+lpad[ ]+0x0 +.*:[ ]+[0-9a-f]+[ ]+auipc[ ]+t3,0x[0-9a-f]+ +.*:[ ]+[0-9a-f]+[ ]+ld[ ]+t3,[0-9]+\(t3\) # [0-9a-f]+ <foo> +.*:[ ]+[0-9a-f]+[ ]+jalr[ ]+t1,t3 + +[0-9a-f]+ <bar@plt>: +.*:[ ]+[0-9a-f]+[ ]+lpad[ ]+0x0 +.*:[ ]+[0-9a-f]+[ ]+auipc[ ]+t3,0x1 +.*:[ ]+[0-9a-f]+[ ]+ld[ ]+t3,[0-9]+\(t3\) # [0-9a-f]+ <bar> +.*:[ ]+[0-9a-f]+[ ]+jalr[ ]+t1,t3 diff --git a/ld/testsuite/ld-riscv-elf/zicfilp-unlabeled-plt.s b/ld/testsuite/ld-riscv-elf/zicfilp-unlabeled-plt.s new file mode 100644 index 0000000..628fca8 --- /dev/null +++ b/ld/testsuite/ld-riscv-elf/zicfilp-unlabeled-plt.s @@ -0,0 +1,21 @@ + .text + .globl _start + .type _start,@function +_start: + call foo + call bar + .section ".note.gnu.property", "a" + .p2align 3 + .long 1f - 0f /* name length */ + .long 5f - 2f /* data length */ + .long 5 /* note type */ +0: .asciz "GNU" /* vendor name */ +1: + .p2align 3 +2: .long 0xc0000000 /* pr_type. */ + .long 4f - 3f /* pr_datasz. */ +3: + .long 0x1 /* CFI_LP. */ +4: + .p2align 3 +5: diff --git a/ld/testsuite/ld-s390/pr32969_64-1.dd b/ld/testsuite/ld-s390/pr32969_64-1.dd new file mode 100644 index 0000000..fce262f --- /dev/null +++ b/ld/testsuite/ld-s390/pr32969_64-1.dd @@ -0,0 +1,15 @@ +tmpdir/pr32969_64-1: file format elf64-s390 + +Disassembly of section .text: + +.* <_start>: +.*: c0 10 00 00 00 0e [ ]*larl %r1,10000cc <foo> +.*: c4 18 00 00 08 1d [ ]*lgrl %r1,10010f0 <_GLOBAL_OFFSET_TABLE_\+0x20> + +.* <b>: +.*: c4 18 00 00 08 1a [ ]*lgrl %r1,10010f0 <_GLOBAL_OFFSET_TABLE_\+0x20> +#?.* 07 07 [ ]*nopr %r7 + +.* <c>: +.* c4 18 00 00 08 16 [ ]*lgrl %r1,10010f0 <_GLOBAL_OFFSET_TABLE_\+0x20> +#?.* 07 07 [ ]*nopr %r7 diff --git a/ld/testsuite/ld-s390/pr32969_64-2.dd b/ld/testsuite/ld-s390/pr32969_64-2.dd new file mode 100644 index 0000000..88c770e --- /dev/null +++ b/ld/testsuite/ld-s390/pr32969_64-2.dd @@ -0,0 +1,15 @@ +tmpdir/pr32969_64-2: file format elf64-s390 + +Disassembly of section .text: + +.* <_start>: +.*: c0 10 00 00 00 0e [ ]*larl %r1,10000cc <foo> +.*: c0 10 00 00 00 0c [ ]*larl %r1,10000ce <bar> + +.* <c>: +.*: c0 10 00 00 00 09 [ ]*larl %r1,10000ce <bar> +#?.* 07 07 [ ]*nopr %r7 + +.* <b>: +.* c0 10 00 00 00 05 [ ]*larl %r1,10000ce <bar> +#?.* 07 07 [ ]*nopr %r7 diff --git a/ld/testsuite/ld-s390/pr32969a.s b/ld/testsuite/ld-s390/pr32969a.s new file mode 100644 index 0000000..baee6ca --- /dev/null +++ b/ld/testsuite/ld-s390/pr32969a.s @@ -0,0 +1,14 @@ + .text + .globl _start + .type _start,@function +_start: + lgrl %r1,foo@GOTENT + lgrl %r1,bar@GOTENT + + .section .rodata,"a",@progbits + .align 1 + .globl foo + .type foo,@object +foo: + .byte 0xa + .size foo, .-foo diff --git a/ld/testsuite/ld-s390/pr32969b.s b/ld/testsuite/ld-s390/pr32969b.s new file mode 100644 index 0000000..54ee369 --- /dev/null +++ b/ld/testsuite/ld-s390/pr32969b.s @@ -0,0 +1,10 @@ +b: + lgrl %r1,bar@GOTENT + + .section .rodata,"aG",@progbits,bar_group,comdat + .align 1 + .globl bar + .type bar,@object +bar: + .byte 0xb + .size bar, .-bar diff --git a/ld/testsuite/ld-s390/pr32969c.s b/ld/testsuite/ld-s390/pr32969c.s new file mode 100644 index 0000000..02cf584 --- /dev/null +++ b/ld/testsuite/ld-s390/pr32969c.s @@ -0,0 +1,10 @@ +c: + lgrl %r1,bar@GOTENT + + .section .rodata,"aG",@progbits,bar_group,comdat + .align 2 + .globl bar + .type bar,@object +bar: + .byte 0xc + .size bar, .-bar diff --git a/ld/testsuite/ld-s390/s390.exp b/ld/testsuite/ld-s390/s390.exp index d91eeac..452811d 100644 --- a/ld/testsuite/ld-s390/s390.exp +++ b/ld/testsuite/ld-s390/s390.exp @@ -125,20 +125,30 @@ set s390xtests { "-m elf64_s390 tmpdir/libpltlib_64.so" "" "-m64" {plt_64-1.s} {{objdump "-dzrj.plt" plt_64-1.pd} {readelf "-wf" plt_64-1_eh.wf}} "plt_64-1_eh"} + {"PR32969-1: do not rewrite load of misaligned COMDAT symbol address" + "-m elf64_s390" "" "-m64" {pr32969a.s pr32969b.s pr32969c.s} + {{objdump "-dzrj.text" pr32969_64-1.dd}} + "pr32969_64-1"} + {"PR32969-2: rewrite load of aligned COMDAT symbol address" + "-m elf64_s390" "" "-m64" {pr32969a.s pr32969c.s pr32969b.s} + {{objdump "-dzrj.text" pr32969_64-2.dd}} + "pr32969_64-2"} } -if [istarget "s390-*-*"] { +if { [istarget "s390-*-*"] || [istarget "s390x-*-*"] } { run_ld_link_tests $s390tests + + run_dump_test "pr26918-1" + run_dump_test "reloccheck-1" + run_dump_test "reloctlsle-1" + } if [istarget "s390x-*-*"] { - run_ld_link_tests $s390tests run_ld_link_tests $s390xtests -} -set test_list [lsort [glob -nocomplain $srcdir/$subdir/*.d]] -foreach t $test_list { - # We need to strip the ".d", but can leave the dirname. - verbose [file rootname $t] - run_dump_test [file rootname $t] + if { ![skip_sframe_tests] } { + run_dump_test "sframe-simple-1" + run_dump_test "sframe-plt-1" + } } diff --git a/ld/testsuite/ld-s390/sframe-bar.s b/ld/testsuite/ld-s390/sframe-bar.s new file mode 100644 index 0000000..f707569 --- /dev/null +++ b/ld/testsuite/ld-s390/sframe-bar.s @@ -0,0 +1,21 @@ + .text + .globl bar + .type bar, @function +bar: + .cfi_startproc + stmg %r14,%r15,112(%r15) + .cfi_rel_offset %r14, 112 + .cfi_rel_offset %r15, 120 + lay %r15,-160(%r15) + .cfi_adjust_cfa_offset 160 + clgfi %r2,1000 + jle .Lreturn + brasl %r14,foo@PLT +.Lreturn: + lay %r15,160(%r15) + .cfi_adjust_cfa_offset -160 + lg %r14,112(%r15) + .cfi_restore %r14 + br %r14 + .cfi_endproc + .size bar, .-bar diff --git a/ld/testsuite/ld-s390/sframe-foo.s b/ld/testsuite/ld-s390/sframe-foo.s new file mode 100644 index 0000000..75657e9 --- /dev/null +++ b/ld/testsuite/ld-s390/sframe-foo.s @@ -0,0 +1,9 @@ + .text + .globl foo + .type foo, @function +foo: + .cfi_startproc + msgfi %r2,42 + br %r14 + .cfi_endproc + .size foo, .-foo diff --git a/ld/testsuite/ld-s390/sframe-plt-1.d b/ld/testsuite/ld-s390/sframe-plt-1.d new file mode 100644 index 0000000..db09030 --- /dev/null +++ b/ld/testsuite/ld-s390/sframe-plt-1.d @@ -0,0 +1,29 @@ +#as: --gsframe +#source: sframe-foo.s +#source: sframe-bar.s +#objdump: --sframe=.sframe +#ld: -shared --no-rosegment +#name: SFrame for plt0 and pltN + +.*: +file format .* + +Contents of the SFrame section .sframe: + Header : + + Version: SFRAME_VERSION_2 + Flags: SFRAME_F_FDE_SORTED, + SFRAME_F_FDE_FUNC_START_PCREL + Num FDEs: 4 + Num FREs: 8 + + Function Index : + + func idx \[0\]: pc = 0x1e8, size = 32 bytes + STARTPC +CFA +FP +RA + + 0+1e8 +sp\+160 +u +u + + + func idx \[1\]: pc = 0x208, size = 32 bytes + STARTPC\[m\] +CFA +FP +RA + + 0+0 +sp\+160 +u +u + + +#... diff --git a/ld/testsuite/ld-s390/sframe-simple-1.d b/ld/testsuite/ld-s390/sframe-simple-1.d new file mode 100644 index 0000000..1c1bf32 --- /dev/null +++ b/ld/testsuite/ld-s390/sframe-simple-1.d @@ -0,0 +1,32 @@ +#as: --gsframe +#source: sframe-foo.s +#source: sframe-bar.s +#objdump: --sframe=.sframe +#ld: -shared --no-rosegment +#name: SFrame simple link + +.*: +file format .* + +Contents of the SFrame section .sframe: + Header : + + Version: SFRAME_VERSION_2 + Flags: SFRAME_F_FDE_SORTED, + SFRAME_F_FDE_FUNC_START_PCREL + Num FDEs: 4 + Num FREs: 8 + + Function Index : + +#... + func idx \[2\]: pc = 0x228, size = 8 bytes + STARTPC +CFA +FP +RA + + 0+228 +sp\+160 +u +u + + + func idx \[3\]: pc = 0x230, size = 42 bytes + STARTPC +CFA +FP +RA + + 0+230 +sp\+160 +u +u + + 0+236 +sp\+160 +u +c-48 + + 0+23c +sp\+320 +u +c-48 + + 0+252 +sp\+160 +u +c-48 + + 0+258 +sp\+160 +u +u + diff --git a/ld/testsuite/ld-scripts/libpr33265-1.a b/ld/testsuite/ld-scripts/libpr33265-1.a new file mode 100644 index 0000000..eab1008 --- /dev/null +++ b/ld/testsuite/ld-scripts/libpr33265-1.a @@ -0,0 +1 @@ +GROUP ( libpr33265-1.a ) diff --git a/ld/testsuite/ld-scripts/libpr33265-2.a b/ld/testsuite/ld-scripts/libpr33265-2.a new file mode 100644 index 0000000..10f4b91 --- /dev/null +++ b/ld/testsuite/ld-scripts/libpr33265-2.a @@ -0,0 +1 @@ +GROUP ( ./././././/libpr33265-2.a ) diff --git a/ld/testsuite/ld-scripts/libpr33265-3a.a b/ld/testsuite/ld-scripts/libpr33265-3a.a new file mode 100644 index 0000000..bdd4f9a --- /dev/null +++ b/ld/testsuite/ld-scripts/libpr33265-3a.a @@ -0,0 +1 @@ +GROUP ( ./././././/libpr33265-3b.a ) diff --git a/ld/testsuite/ld-scripts/libpr33265-3b.a b/ld/testsuite/ld-scripts/libpr33265-3b.a new file mode 100644 index 0000000..7458328 --- /dev/null +++ b/ld/testsuite/ld-scripts/libpr33265-3b.a @@ -0,0 +1 @@ +GROUP ( ./././././/libpr33265-3c.a ) diff --git a/ld/testsuite/ld-scripts/libpr33265-3c.a b/ld/testsuite/ld-scripts/libpr33265-3c.a new file mode 100644 index 0000000..4583c09 --- /dev/null +++ b/ld/testsuite/ld-scripts/libpr33265-3c.a @@ -0,0 +1 @@ +GROUP ( libpr33265-3a.a ) diff --git a/ld/testsuite/ld-scripts/linker-script-not-found.d b/ld/testsuite/ld-scripts/linker-script-not-found.d new file mode 100644 index 0000000..61d4d8a --- /dev/null +++ b/ld/testsuite/ld-scripts/linker-script-not-found.d @@ -0,0 +1,3 @@ +#source: default-script.s +#ld: -T misspelled.ld +#error: cannot open linker script file misspelled\.ld: .*\Z diff --git a/ld/testsuite/ld-scripts/pr24576-1.d b/ld/testsuite/ld-scripts/pr24576-1.d new file mode 100644 index 0000000..6cc7621 --- /dev/null +++ b/ld/testsuite/ld-scripts/pr24576-1.d @@ -0,0 +1,3 @@ +#source: default-script.s +#ld: -defsym _START=0x800 -T default-script.t -T default-script.t +#error: .*default-script.t\)' appears multiple times diff --git a/ld/testsuite/ld-scripts/pr24576-2.d b/ld/testsuite/ld-scripts/pr24576-2.d new file mode 100644 index 0000000..2d26ab3 --- /dev/null +++ b/ld/testsuite/ld-scripts/pr24576-2.d @@ -0,0 +1,3 @@ +#source: default-script.s +#ld: -defsym _START=0x800 -T ././/default-script.t -T default-script.t +#error: .*default-script.t\)' appears multiple times diff --git a/ld/testsuite/ld-scripts/pr33265-1.d b/ld/testsuite/ld-scripts/pr33265-1.d new file mode 100644 index 0000000..b0df33d --- /dev/null +++ b/ld/testsuite/ld-scripts/pr33265-1.d @@ -0,0 +1,3 @@ +#source: start.s +#ld: -r --whole-archive -lpr33265-1 +#error: .*group nested too deeply.* diff --git a/ld/testsuite/ld-scripts/pr33265-2.d b/ld/testsuite/ld-scripts/pr33265-2.d new file mode 100644 index 0000000..6e9da74 --- /dev/null +++ b/ld/testsuite/ld-scripts/pr33265-2.d @@ -0,0 +1,3 @@ +#source: start.s +#ld: -r --whole-archive -lpr33265-2 +#error: .*group nested too deeply.* diff --git a/ld/testsuite/ld-scripts/pr33265-3.d b/ld/testsuite/ld-scripts/pr33265-3.d new file mode 100644 index 0000000..a2f42fa --- /dev/null +++ b/ld/testsuite/ld-scripts/pr33265-3.d @@ -0,0 +1,3 @@ +#source: start.s +#ld: -r --whole-archive -lpr33265-3a +#error: .*group nested too deeply.* diff --git a/ld/testsuite/ld-scripts/provide-8.d b/ld/testsuite/ld-scripts/provide-8.d index 1dd5553..250b044 100644 --- a/ld/testsuite/ld-scripts/provide-8.d +++ b/ld/testsuite/ld-scripts/provide-8.d @@ -1,7 +1,9 @@ #source: provide-5.s #ld: -T provide-8.t #nm: -B -#xfail: mmix-*-* *-*-pe spu-*-* *-*-mingw* *-*-cygwin +#xfail: mmix-*-* spu-*-* +# Placing a symbol outside of the image isn't well-defined in PE. +#notarget: *-*-pe *-*-mingw* *-*-cygwin #... 0+4000 D __FOO diff --git a/ld/testsuite/ld-scripts/rgn-at3.d b/ld/testsuite/ld-scripts/rgn-at3.d index b0ea08a..1d21956 100644 --- a/ld/testsuite/ld-scripts/rgn-at3.d +++ b/ld/testsuite/ld-scripts/rgn-at3.d @@ -2,13 +2,9 @@ # source: rgn-at.s # ld: -T rgn-at3.t # objdump: -w -h -# xfail: rx-*-* *-*-nacl* +# xfail: rx-*-* # FAILS on the RX because the linker has to set LMA == VMA for the # Renesas loader. -# FAILs on NaCl targets because the linker extends the first segment -# to fill out the page, making its p_vaddr+p_memsz cover the sh_addr -# of .bss too, which makes BFD compute its LMA from the p_paddr of the -# text segment. .*: file format .* diff --git a/ld/testsuite/ld-scripts/script.exp b/ld/testsuite/ld-scripts/script.exp index 5206563..7a23f43 100644 --- a/ld/testsuite/ld-scripts/script.exp +++ b/ld/testsuite/ld-scripts/script.exp @@ -233,9 +233,16 @@ run_dump_test "pr20302" run_dump_test "output-section-types" run_dump_test "ld-version" run_dump_test "ld-version-2" +run_dump_test "pr24576-1" +run_dump_test "pr24576-2" +run_dump_test "linker-script-not-found" run_dump_test "segment-start" {{name (default)}} run_dump_test "segment-start" {{name (overridden)} \ {ld -Ttext-segment=0x10000000}} +run_dump_test "pr33265-1" +run_dump_test "pr33265-2" +run_dump_test "pr33265-3" + set LDFLAGS $old_LDFLAGS diff --git a/ld/testsuite/ld-scripts/sort_b_n_a-2.d b/ld/testsuite/ld-scripts/sort_b_n_a-2.d index 4c9d8fe..2fd920d 100644 --- a/ld/testsuite/ld-scripts/sort_b_n_a-2.d +++ b/ld/testsuite/ld-scripts/sort_b_n_a-2.d @@ -1,7 +1,7 @@ #source: sort_n_a-a.s #source: sort_n_a-b.s #ld: -T sort_b_n_a.t --sort-section name -#name: SORT_BY_NAME(SORT_BY_ALIGNMENT()) --sort-section alignment +#name: SORT_BY_NAME(SORT_BY_ALIGNMENT()) --sort-section name #nm: -n #... diff --git a/ld/testsuite/ld-scripts/sort_no-2.d b/ld/testsuite/ld-scripts/sort_no-2.d index e0943d5..c85cc34 100644 --- a/ld/testsuite/ld-scripts/sort_no-2.d +++ b/ld/testsuite/ld-scripts/sort_no-2.d @@ -1,6 +1,6 @@ #source: sort_b_a.s #ld: -T sort_no.t -#name: no SORT_BY_NAME/SORT_BY_ALIGNMENT/SORT +#name: no SORT_BY_NAME/SORT_BY_ALIGNMENT/SORT (2) #nm: -n #... diff --git a/ld/testsuite/ld-shared/shared.exp b/ld/testsuite/ld-shared/shared.exp index a8ddac2..c67084c 100644 --- a/ld/testsuite/ld-shared/shared.exp +++ b/ld/testsuite/ld-shared/shared.exp @@ -37,12 +37,12 @@ if { ![check_shared_lib_support] } { # This test can only be run on a couple of ELF platforms. # Square bracket expressions seem to confuse istarget. -if { ![istarget hppa*64*-*-hpux*] \ +if { ![istarget *-*-solaris2*] \ + && ![istarget hppa*64*-*-hpux*] \ && ![istarget hppa*-*-linux*] \ && ![istarget i?86-*-elf*] \ && ![istarget i?86-*-linux*] \ && ![istarget i?86-*-gnu*] \ - && ![istarget *-*-nacl*] \ && ![istarget ia64-*-elf*] \ && ![istarget ia64-*-linux*] \ && ![istarget m68k-*-linux*] \ @@ -52,7 +52,6 @@ if { ![istarget hppa*64*-*-hpux*] \ && ![istarget powerpc*-*-linux*] \ && ![istarget powerpc*-*-sysv4*] \ && ![istarget sparc*-*-elf] \ - && ![istarget sparc*-*-solaris2*] \ && ![istarget sparc*-*-linux*] \ && ![istarget arm*-*-linux*] \ && ![istarget alpha*-*-linux*] \ @@ -63,13 +62,20 @@ if { ![istarget hppa*64*-*-hpux*] \ return } +set need_direct_extern_access "" +if { [istarget i?86-*-linux*] + || [istarget i?86-*-gnu*] } then { + # These targets need direct extern access in some tests. + set need_direct_extern_access "$DIRECT_EXTERN_ACCESS_CFLAGS" +} + set tmpdir tmpdir set SHCFLAG "" set shared_needs_pic "no" # Disable all sanitizers. -set old_CFLAGS "$CFLAGS_FOR_TARGET" -append CFLAGS_FOR_TARGET " $NOSANITIZE_CFLAGS" +set old_CFLAGS "$CFLAGS_FOR_TARGET_TEST" +append CFLAGS_FOR_TARGET_TEST " $NOSANITIZE_CFLAGS" if { [is_xcoff_format] } { # Not all the useful features are available with AIX shared @@ -105,7 +111,7 @@ if [istarget arm*-*-linux*] { set file [open $tmpdir/movw-detect.c w] puts $file "void foo(void) { __asm (\"movw r0, #0\"); }" close $file - if [run_host_cmd_yesno "$CC_FOR_TARGET" "$CFLAGS_FOR_TARGET -c $tmpdir/movw-detect.c -o $tmpdir/movw-detect.o"] { + if [run_host_cmd_yesno "$CC_FOR_TARGET" "$CFLAGS_FOR_TARGET_TEST -c $tmpdir/movw-detect.c -o $tmpdir/movw-detect.o"] { set shared_needs_pic "yes" } } @@ -218,14 +224,15 @@ if ![ld_compile "$CC_FOR_TARGET $NOPIE_CFLAGS $SHCFLAG" $srcdir/$subdir/main.c $ # will need to do more relocation work. However, note that not # using -fpic will cause some of the tests to return different # results. Make sure that PLT is used since PLT is expected. - if { ![ld_compile "$CC_FOR_TARGET $PLT_CFLAGS $NOPIE_CFLAGS $SHCFLAG" $srcdir/$subdir/sh1.c $tmpdir/sh1np.o] - || ![ld_compile "$CC_FOR_TARGET $PLT_CFLAGS $NOPIE_CFLAGS $SHCFLAG" $srcdir/$subdir/sh2.c $tmpdir/sh2np.o] } { + if { ![ld_compile "$CC_FOR_TARGET $PLT_CFLAGS $NOPIE_CFLAGS $SHCFLAG $need_direct_extern_access" $srcdir/$subdir/sh1.c $tmpdir/sh1np.o] + || ![ld_compile "$CC_FOR_TARGET $PLT_CFLAGS $NOPIE_CFLAGS $SHCFLAG $need_direct_extern_access" $srcdir/$subdir/sh2.c $tmpdir/sh2np.o] } { unsupported "shared (non PIC)" } else { if { [is_xcoff_format] } { shared_test shnp "shared (non PIC)" mainnp.o sh1np.o sh2np.o xcoff "" $NOPIE_LDFLAGS } else { - # Solaris defaults to -z text. - setup_xfail "*-*-solaris2*" + # 64-bit Solaris requires PIC. + setup_xfail "sparcv9*-*-solaris2*" + setup_xfail "x86_64-*-solaris2*" setup_xfail "ia64-*-linux*" setup_xfail "alpha*-*-linux*" setup_xfail "powerpc-*-linux-musl" @@ -271,7 +278,7 @@ if ![ld_compile "$CC_FOR_TARGET $NOPIE_CFLAGS $SHCFLAG" $srcdir/$subdir/main.c $ setup_xfail "arm*-*-linux*" } setup_xfail "aarch64*-*-linux*" - # Solaris defaults to -z text. + # Solaris refuses to map shared objects with non-zero load addresses. setup_xfail "*-*-solaris2*" shared_test shnp "shared (non PIC, load offset)" \ mainnp.o sh1np.o sh2np.o shared \ @@ -306,8 +313,9 @@ if ![ld_compile "$CC_FOR_TARGET $SHCFLAG $picflag" $srcdir/$subdir/main.c $tmpdi if { [is_xcoff_format] } { shared_test shmpnp "shared (PIC main, non PIC so)" mainp.o sh1np.o sh2np.o xcoff "" $NOPIE_LDFLAGS } else { - # Solaris defaults to -z text. - setup_xfail "*-*-solaris2*" + # 64-bit Solaris requires PIC. + setup_xfail "sparcv9*-*-solaris2*" + setup_xfail "x86_64-*-solaris2*" setup_xfail "ia64-*-linux*" setup_xfail "alpha*-*-linux*" setup_xfail "powerpc-*-linux-musl" @@ -344,4 +352,4 @@ if ![ld_compile "$CC_FOR_TARGET $SHCFLAG $picflag" $srcdir/$subdir/main.c $tmpdi } } -set CFLAGS_FOR_TARGET "$old_CFLAGS" +set CFLAGS_FOR_TARGET_TEST "$old_CFLAGS" diff --git a/ld/testsuite/ld-size/size.exp b/ld/testsuite/ld-size/size.exp index 776341b..ae24f3b 100644 --- a/ld/testsuite/ld-size/size.exp +++ b/ld/testsuite/ld-size/size.exp @@ -26,7 +26,6 @@ if {!(([istarget "i?86-*-*"] || [istarget "x86_64-*-*"]) && ([istarget "*-*-elf*"] - || [istarget "*-*-nacl*"] || [istarget "*-*-linux*"] || [istarget "*-*-gnu*"])) } { verbose "Size relocations tests not run - no target support" @@ -39,13 +38,6 @@ if { ![check_shared_lib_support] } { return } -# So as to avoid rewriting every last test case here in a nacl variant, -# we use black magic to massage the generic cases into nacl-variant cases. -if [istarget "*-*-nacl*"] { - # Change all the -melf_i386 to -melf_i386_nacl so linking can succeed. - set options_regsub(ld) {-m(\\S+) -m\\1_nacl} -} - set test_list [lsort [glob -nocomplain $srcdir/$subdir/*.d]] foreach t $test_list { # We need to strip the ".d", but can leave the dirname. diff --git a/ld/testsuite/ld-srec/srec.exp b/ld/testsuite/ld-srec/srec.exp index bec5913..227411a 100644 --- a/ld/testsuite/ld-srec/srec.exp +++ b/ld/testsuite/ld-srec/srec.exp @@ -364,25 +364,26 @@ if { ![check_compiler_available] } { # Pass -fplt to CC and CXX since -fno-plt doesn't work with S-records # tests. Also add $NOPIE_CFLAGS and $NOPIE_LDFLAGS if PIE doesn't work # with S-records. Also add $NOCF_PROTECTION_CFLAGS for S-records. -# Also add $NOSANITIZE_CFLAGS for S-records. -set old_CFLAGS "$CFLAGS_FOR_TARGET" -append CFLAGS_FOR_TARGET " $PLT_CFLAGS $NOPIE_CFLAGS $NOPIE_LDFLAGS $NOCF_PROTECTION_CFLAGS $NOSANITIZE_CFLAGS $NOLTO_CFLAGS" -set old_CXXFLAGS "$CXXFLAGS_FOR_TARGET" -append CXXFLAGS_FOR_TARGET " $PLT_CFLAGS $NOPIE_CFLAGS $NOPIE_LDFLAGS $NOCF_PROTECTION_CFLAGS $NOSANITIZE_CFLAGS $NOLTO_CFLAGS" +# Also add $NOSANITIZE_CFLAGS for S-records. Also add +# $DIRECT_EXTERN_ACCESS_CFLAGS. +set old_CFLAGS "$CFLAGS_FOR_TARGET_TEST" +append CFLAGS_FOR_TARGET_TEST " $PLT_CFLAGS $NOPIE_CFLAGS $NOPIE_LDFLAGS $NOCF_PROTECTION_CFLAGS $NOSANITIZE_CFLAGS $NOLTO_CFLAGS $DIRECT_EXTERN_ACCESS_CFLAGS" +set old_CXXFLAGS "$CXXFLAGS_FOR_TARGET_TEST" +append CXXFLAGS_FOR_TARGET_TEST " $PLT_CFLAGS $NOPIE_CFLAGS $NOPIE_LDFLAGS $NOCF_PROTECTION_CFLAGS $NOSANITIZE_CFLAGS $NOLTO_CFLAGS $DIRECT_EXTERN_ACCESS_CFLAGS" # S-records can't handle .note.gnu.property sections. if { [is_elf_format] \ && ([istarget "i?86-*-*"] || [istarget "x86_64-*-*"]) } { - append CFLAGS_FOR_TARGET " -Wa,-mx86-used-note=no" - append CXXFLAGS_FOR_TARGET " -Wa,-mx86-used-note=no" + append CFLAGS_FOR_TARGET_TEST " -Wa,-mx86-used-note=no" + append CXXFLAGS_FOR_TARGET_TEST " -Wa,-mx86-used-note=no" } if { ![ld_compile $CC_FOR_TARGET $srcdir/$subdir/sr1.c tmpdir/sr1.o] \ || ![ld_compile $CC_FOR_TARGET $srcdir/$subdir/sr2.c tmpdir/sr2.o] } { unsupported $test1 unsupported $test2 - set CFLAGS_FOR_TARGET "$old_CFLAGS" - set CXXFLAGS_FOR_TARGET "$old_CXXFLAGS" + set CFLAGS_FOR_TARGET_TEST "$old_CFLAGS" + set CXXFLAGS_FOR_TARGET_TEST "$old_CXXFLAGS" return } @@ -454,15 +455,15 @@ run_srec_test $test1 "tmpdir/sr1.o tmpdir/sr2.o" if { ![is_remote host] && [which $CXX_FOR_TARGET] == 0 } { untested $test2 - set CFLAGS_FOR_TARGET "$old_CFLAGS" - set CXXFLAGS_FOR_TARGET "$old_CXXFLAGS" + set CFLAGS_FOR_TARGET_TEST "$old_CFLAGS" + set CXXFLAGS_FOR_TARGET_TEST "$old_CXXFLAGS" return } if ![ld_compile "$CXX_FOR_TARGET -fno-exceptions" $srcdir/$subdir/sr3.cc tmpdir/sr3.o] { unsupported $test2 - set CFLAGS_FOR_TARGET "$old_CFLAGS" - set CXXFLAGS_FOR_TARGET "$old_CXXFLAGS" + set CFLAGS_FOR_TARGET_TEST "$old_CFLAGS" + set CXXFLAGS_FOR_TARGET_TEST "$old_CXXFLAGS" return } @@ -488,5 +489,5 @@ setup_xfail "bpf-*-*" run_srec_test $test2 "tmpdir/sr3.o" -set CFLAGS_FOR_TARGET "$old_CFLAGS" -set CXXFLAGS_FOR_TARGET "$old_CXXFLAGS" +set CFLAGS_FOR_TARGET_TEST "$old_CFLAGS" +set CXXFLAGS_FOR_TARGET_TEST "$old_CXXFLAGS" diff --git a/ld/testsuite/ld-tic6x/discard-unwind.ld b/ld/testsuite/ld-tic6x/discard-unwind.ld index 00582c1..172e2a8 100644 --- a/ld/testsuite/ld-tic6x/discard-unwind.ld +++ b/ld/testsuite/ld-tic6x/discard-unwind.ld @@ -11,5 +11,5 @@ SECTIONS *(.c6xabi.extab*) } =0 /DISCARD/ : { *(.c6xabi.exidx*) } - .c6xabi.attribues 0 : { *(.c6xabi.atttributes) } + .c6xabi.attributes 0 : { *(.c6xabi.attributes) } } diff --git a/ld/testsuite/ld-tic6x/unwind.ld b/ld/testsuite/ld-tic6x/unwind.ld index a4f8722..01ba9b6 100644 --- a/ld/testsuite/ld-tic6x/unwind.ld +++ b/ld/testsuite/ld-tic6x/unwind.ld @@ -16,5 +16,5 @@ SECTIONS .got : { *(.got) *(.got.plt)} . = 0x12340000; .far : { *(.far) } - .c6xabi.attribues 0 : { *(.c6xabi.atttributes) } + .c6xabi.attributes 0 : { *(.c6xabi.attributes) } } diff --git a/ld/testsuite/ld-vsb/vsb.exp b/ld/testsuite/ld-vsb/vsb.exp index e44ac39..8eff759 100644 --- a/ld/testsuite/ld-vsb/vsb.exp +++ b/ld/testsuite/ld-vsb/vsb.exp @@ -36,7 +36,6 @@ if { ![istarget hppa*64*-*-hpux*] \ && ![istarget hppa*-*-linux*] \ && ![istarget i?86-*-linux*] \ && ![istarget i?86-*-gnu*] \ - && ![istarget *-*-nacl*] \ && ![istarget ia64-*-linux*] \ && ![istarget m68k-*-linux*] \ && ![istarget mips*-*-linux*] \ @@ -51,6 +50,13 @@ if { ![istarget hppa*64*-*-hpux*] \ return } +set need_direct_extern_access "" +if { [istarget i?86-*-linux*] + || [istarget i?86-*-gnu*] } then { + # These targets need direct extern access in some tests. + set need_direct_extern_access "$DIRECT_EXTERN_ACCESS_CFLAGS" +} + if [is_xcoff_format] { set test_list [lsort [glob -nocomplain $srcdir/$subdir/*-xcoff*.d]] } else { @@ -114,7 +120,6 @@ if [istarget arm*-*-linux*] { set support_protected "no" if { [istarget *-*-linux*] - || [istarget *-*-nacl*] || [istarget *-*-gnu*] } { if [ld_compile "$CC_FOR_TARGET -g -DPROTECTED_CHECK" $srcdir/$subdir/main.c $tmpdir/main.o] { if [ld_link $CC_FOR_TARGET $tmpdir/main "$tmpdir/main.o"] { @@ -240,6 +245,7 @@ proc visibility_run {visibility} { global COMPRESS_LDFLAG global NOSANITIZE_CFLAGS global NOLTO_CFLAGS + global need_direct_extern_access if [ string match $visibility "hidden" ] { set VSBCFLAG "-DHIDDEN_TEST" @@ -286,7 +292,7 @@ proc visibility_run {visibility} { } else { # Compile the main program. Make sure that PLT is used since PLT # is expected. - if ![ld_compile "$CC_FOR_TARGET -g $NOPIE_CFLAGS $PLT_CFLAGS $SHCFLAG $VSBCFLAG $NOSANITIZE_CFLAGS $NOLTO_CFLAGS" $srcdir/$subdir/main.c $tmpdir/mainnp.o] { + if ![ld_compile "$CC_FOR_TARGET -g $NOPIE_CFLAGS $PLT_CFLAGS $SHCFLAG $VSBCFLAG $NOSANITIZE_CFLAGS $NOLTO_CFLAGS $need_direct_extern_access" $srcdir/$subdir/main.c $tmpdir/mainnp.o] { unsupported "visibility ($visibility) (non PIC)" unsupported "visibility ($visibility)" } else { @@ -296,8 +302,8 @@ proc visibility_run {visibility} { # will need to do more relocation work. However, note that not # using -fpic will cause some of the tests to return different # results. Make sure that PLT is used since PLT is expected. - if { ![ld_compile "$CC_FOR_TARGET -g $NOPIE_CFLAGS $PLT_CFLAGS $SHCFLAG $VSBCFLAG $NOSANITIZE_CFLAGS $NOLTO_CFLAGS" $srcdir/$subdir/sh1.c $tmpdir/sh1np.o] - || ![ld_compile "$CC_FOR_TARGET -g $NOPIE_CFLAGS $PLT_CFLAGS $SHCFLAG $VSBCFLAG $NOSANITIZE_CFLAGS $NOLTO_CFLAGS" $srcdir/$subdir/sh2.c $tmpdir/sh2np.o] } { + if { ![ld_compile "$CC_FOR_TARGET -g $NOPIE_CFLAGS $PLT_CFLAGS $SHCFLAG $VSBCFLAG $NOSANITIZE_CFLAGS $NOLTO_CFLAGS $need_direct_extern_access" $srcdir/$subdir/sh1.c $tmpdir/sh1np.o] + || ![ld_compile "$CC_FOR_TARGET -g $NOPIE_CFLAGS $PLT_CFLAGS $SHCFLAG $VSBCFLAG $NOSANITIZE_CFLAGS $NOLTO_CFLAGS $need_direct_extern_access" $srcdir/$subdir/sh2.c $tmpdir/sh2np.o] } { unsupported "visibility ($visibility) (non PIC)" } else { # SunOS non PIC shared libraries don't permit some cases of diff --git a/ld/testsuite/ld-x86-64/binutils.exp b/ld/testsuite/ld-x86-64/binutils.exp new file mode 100644 index 0000000..4a0b211 --- /dev/null +++ b/ld/testsuite/ld-x86-64/binutils.exp @@ -0,0 +1,72 @@ +# Expect script for ELF/x86-64 binutils tests on linker outputs. +# Copyright (C) 2025 Free Software Foundation, Inc. +# +# This file is part of the GNU Binutils. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, +# MA 02110-1301, USA. +# + +if ![is_elf_format] { + return +} + +if { ![istarget "x86_64-*-*"] } { + return +} + +# Tests here need -melf_x86_64 support. +set status [catch "exec $LD -V -melf_x86_64" got] +if { $status == 0 } { + run_ld_link_tests [list \ + [list \ + "Build libgot-1-x64.so" \ + "-shared -melf_x86_64 --no-ld-generated-unwind-info \ + -z noseparate-code -z max-page-size=0x200000 \ + --hash-style=sysv -z nomark-plt $NO_DT_RELR_LDFLAGS \ + --rosegment" \ + "" \ + "--64 -mx86-used-note=no --generate-missing-build-notes=no" \ + {got-1.s} \ + {{readelf -rW libgot-1a.rd} \ + {readelf -aW libgot-1b.rd} \ + {readelf --got-contents libgot-1c.rd} \ + {readelf {--got-contents -W} libgot-1d.rd}} \ + "libgot-1-x64.so" \ + ] \ + ] +} + +# Tests here need -melf32_x86_64 support. +set status [catch "exec $LD -V -melf32_x86_64" got] +if { $status == 0 } { + run_ld_link_tests [list \ + [list \ + "Build libgot-1-x32.so" \ + "-shared -melf32_x86_64 --no-ld-generated-unwind-info \ + -z noseparate-code -z max-page-size=0x200000 \ + --hash-style=sysv -z nomark-plt $NO_DT_RELR_LDFLAGS \ + --rosegment" \ + "" \ + "--x32 -mx86-used-note=no --generate-missing-build-notes=no" \ + {got-1.s} \ + {{readelf -rW libgot-1a-x32.rd} \ + {readelf -aW libgot-1b-x32.rd} \ + {readelf --got-contents libgot-1c-x32.rd} \ + {readelf {--got-contents -W} libgot-1d-x32.rd}} \ + "libgot-1-x32.so" \ + ] \ + ] +} diff --git a/ld/testsuite/ld-x86-64/dt-relr-1c-x32.d b/ld/testsuite/ld-x86-64/dt-relr-1c-x32.d new file mode 100644 index 0000000..7e3ce293 --- /dev/null +++ b/ld/testsuite/ld-x86-64/dt-relr-1c-x32.d @@ -0,0 +1,26 @@ +#source: dt-relr-1.s +#as: --x32 +#ld: -shared -melf32_x86_64 $DT_RELR_LDFLAGS -z nomark-plt --hash-style=sysv +#readelf: -D -r -s --wide +#target: x86_64-*-linux* + +'RELA' relocation section at offset 0x[0-9a-f]+ contains 24 bytes: + +Offset +Info +Type +Sym. Value +Symbol's Name \+ Addend +[0-9a-f]+ +[0-9a-f]+ +R_X86_64_32 +0+ +data1 \+ 0 +[0-9a-f]+ +[0-9a-f]+ +R_X86_64_32 +0+ +data1 \+ 0 + +'RELR' relocation section at offset 0x[a-f0-9]+ contains 8 bytes: +#... +0000: +[0-9a-f]+ [0-9a-f]+ +.* +0001: +[0-9a-f]+ [0-9a-f]+ +.* + +[0-9a-f]+ +.* +#... +'PLT' relocation section at offset 0x[0-9a-f]+ contains 12 bytes: + +Offset +Info +Type +Sym. Value +Symbol's Name \+ Addend +[0-9a-f]+ +[0-9a-f]+ +R_X86_64_JUMP_SLOT +0+ +func1 \+ 0 + +Symbol table for image contains [0-9]+ entries: + +Num: +Value +Size Type +Bind +Vis +Ndx Name +#... + +[0-9]+: 0+ +0 +NOTYPE +GLOBAL +DEFAULT +UND +func1 +#pass diff --git a/ld/testsuite/ld-x86-64/dt-relr-1c.d b/ld/testsuite/ld-x86-64/dt-relr-1c.d new file mode 100644 index 0000000..12fb99e --- /dev/null +++ b/ld/testsuite/ld-x86-64/dt-relr-1c.d @@ -0,0 +1,26 @@ +#source: dt-relr-1.s +#as: --64 +#ld: -shared -melf_x86_64 $DT_RELR_LDFLAGS -z nomark-plt --hash-style=sysv +#readelf: -D -r -s --wide +#target: x86_64-*-linux* + +'RELA' relocation section at offset 0x[0-9a-f]+ contains 48 bytes: + +Offset +Info +Type +Symbol's Value +Symbol's Name \+ Addend +[0-9a-f]+ +[0-9a-f]+ +R_X86_64_64 +0+ +data1 \+ 0 +[0-9a-f]+ +[0-9a-f]+ +R_X86_64_64 +0+ +data1 \+ 0 + +'RELR' relocation section at offset 0x[a-f0-9]+ contains 16 bytes: +#... +0000: +[0-9a-f]+ [0-9a-f]+ +.* +0001: +[0-9a-f]+ [0-9a-f]+ +.* + +[0-9a-f]+ +.* +#... +'PLT' relocation section at offset 0x[0-9a-f]+ contains 24 bytes: + +Offset +Info +Type +Symbol's Value +Symbol's Name \+ Addend +[0-9a-f]+ +[0-9a-f]+ +R_X86_64_JUMP_SLOT +0+ +func1 \+ 0 + +Symbol table for image contains [0-9]+ entries: + +Num: +Value +Size Type +Bind +Vis +Ndx Name +#... + +[0-9]+: 0+ +0 +NOTYPE +GLOBAL +DEFAULT +UND +func1 +#pass diff --git a/ld/testsuite/ld-x86-64/dt-relr-1d-x32.d b/ld/testsuite/ld-x86-64/dt-relr-1d-x32.d new file mode 100644 index 0000000..2327796 --- /dev/null +++ b/ld/testsuite/ld-x86-64/dt-relr-1d-x32.d @@ -0,0 +1,26 @@ +#source: dt-relr-1.s +#as: --x32 +#ld: -shared -melf32_x86_64 $DT_RELR_LDFLAGS -z nocombreloc -z nomark-plt --hash-style=sysv +#readelf: -D -r -s --wide +#target: x86_64-*-linux* + +'RELA' relocation section at offset 0x[0-9a-f]+ contains 24 bytes: + +Offset +Info +Type +Sym. Value +Symbol's Name \+ Addend +[0-9a-f]+ +[0-9a-f]+ +R_X86_64_32 +0+ +data1 \+ 0 +[0-9a-f]+ +[0-9a-f]+ +R_X86_64_32 +0+ +data1 \+ 0 + +'RELR' relocation section at offset 0x[a-f0-9]+ contains 8 bytes: +#... +0000: +[0-9a-f]+ [0-9a-f]+ +.* +0001: +[0-9a-f]+ [0-9a-f]+ +.* + +[0-9a-f]+ +.* +#... +'PLT' relocation section at offset 0x[0-9a-f]+ contains 12 bytes: + +Offset +Info +Type +Sym. Value +Symbol's Name \+ Addend +[0-9a-f]+ +[0-9a-f]+ +R_X86_64_JUMP_SLOT +0+ +func1 \+ 0 + +Symbol table for image contains [0-9]+ entries: + +Num: +Value +Size Type +Bind +Vis +Ndx Name +#... + +[0-9]+: 0+ +0 +NOTYPE +GLOBAL +DEFAULT +UND +func1 +#pass diff --git a/ld/testsuite/ld-x86-64/dt-relr-1d.d b/ld/testsuite/ld-x86-64/dt-relr-1d.d new file mode 100644 index 0000000..15b9f56 --- /dev/null +++ b/ld/testsuite/ld-x86-64/dt-relr-1d.d @@ -0,0 +1,26 @@ +#source: dt-relr-1.s +#as: --64 +#ld: -shared -melf_x86_64 $DT_RELR_LDFLAGS -z nocombreloc -z nomark-plt --hash-style=sysv +#readelf: -D -r -s --wide +#target: x86_64-*-linux* + +'RELA' relocation section at offset 0x[0-9a-f]+ contains 48 bytes: + +Offset +Info +Type +Symbol's Value +Symbol's Name \+ Addend +[0-9a-f]+ +[0-9a-f]+ +R_X86_64_64 +0+ +data1 \+ 0 +[0-9a-f]+ +[0-9a-f]+ +R_X86_64_64 +0+ +data1 \+ 0 + +'RELR' relocation section at offset 0x[a-f0-9]+ contains 16 bytes: +#... +0000: +[0-9a-f]+ [0-9a-f]+ +.* +0001: +[0-9a-f]+ [0-9a-f]+ +.* + +[0-9a-f]+ +.* +#... +'PLT' relocation section at offset 0x[0-9a-f]+ contains 24 bytes: + +Offset +Info +Type +Symbol's Value +Symbol's Name \+ Addend +[0-9a-f]+ +[0-9a-f]+ +R_X86_64_JUMP_SLOT +0+ +func1 \+ 0 + +Symbol table for image contains [0-9]+ entries: + +Num: +Value +Size Type +Bind +Vis +Ndx Name +#... + +[0-9]+: 0+ +0 +NOTYPE +GLOBAL +DEFAULT +UND +func1 +#pass diff --git a/ld/testsuite/ld-x86-64/dt-relr-2-x32.d b/ld/testsuite/ld-x86-64/dt-relr-2-x32.d new file mode 100644 index 0000000..b3e080e --- /dev/null +++ b/ld/testsuite/ld-x86-64/dt-relr-2-x32.d @@ -0,0 +1,21 @@ +#source: dt-relr-2.s +#as: --x32 +#ld: -shared -melf32_x86_64 $DT_RELR_LDFLAGS -z nomark-plt --hash-style=sysv +#readelf: -D -r --wide +#target: x86_64-*-linux* + +'RELA' relocation section at offset 0x[0-9a-f]+ contains 24 bytes: + +Offset +Info +Type +Sym. Value +Symbol's Name \+ Addend +[0-9a-f]+ +[0-9a-f]+ +R_X86_64_32 +0+ +data1 \+ 0 +[0-9a-f]+ +[0-9a-f]+ +R_X86_64_32 +0+ +data1 \+ 0 + +'RELR' relocation section at offset 0x[a-f0-9]+ contains 8 bytes: +#... +0000: +[0-9a-f]+ [0-9a-f]+ +.* +0001: +[0-9a-f]+ [0-9a-f]+ +.* + +[0-9a-f]+ +.* +#... +'PLT' relocation section at offset 0x[0-9a-f]+ contains 24 bytes: + +Offset +Info +Type +Sym. Value +Symbol's Name \+ Addend +[0-9a-f]+ +[0-9a-f]+ +R_X86_64_JUMP_SLOT +[0-9a-f]+ +func1 \+ 0 +[0-9a-f]+ +[0-9a-f]+ +R_X86_64_JUMP_SLOT +[0-9a-f]+ +func2 \+ 0 diff --git a/ld/testsuite/ld-x86-64/dt-relr-2.d b/ld/testsuite/ld-x86-64/dt-relr-2.d new file mode 100644 index 0000000..71e8c73 --- /dev/null +++ b/ld/testsuite/ld-x86-64/dt-relr-2.d @@ -0,0 +1,21 @@ +#source: dt-relr-2.s +#as: --64 +#ld: -shared -melf_x86_64 $DT_RELR_LDFLAGS -z nomark-plt --hash-style=sysv +#readelf: -D -r --wide +#target: x86_64-*-linux* + +'RELA' relocation section at offset 0x[0-9a-f]+ contains 48 bytes: + +Offset +Info +Type +Symbol's Value +Symbol's Name \+ Addend +[0-9a-f]+ +[0-9a-f]+ +R_X86_64_64 +0+ +data1 \+ 0 +[0-9a-f]+ +[0-9a-f]+ +R_X86_64_64 +0+ +data1 \+ 0 + +'RELR' relocation section at offset 0x[a-f0-9]+ contains 16 bytes: +#... +0000: +[0-9a-f]+ [0-9a-f]+ +.* +0001: +[0-9a-f]+ [0-9a-f]+ +.* + +[0-9a-f]+ +.* +#... +'PLT' relocation section at offset 0x[0-9a-f]+ contains 48 bytes: + +Offset +Info +Type +Symbol's Value +Symbol's Name \+ Addend +[0-9a-f]+ +[0-9a-f]+ +R_X86_64_JUMP_SLOT +[0-9a-f]+ +func1 \+ 0 +[0-9a-f]+ +[0-9a-f]+ +R_X86_64_JUMP_SLOT +[0-9a-f]+ +func2 \+ 0 diff --git a/ld/testsuite/ld-x86-64/dt-relr-2.s b/ld/testsuite/ld-x86-64/dt-relr-2.s new file mode 100644 index 0000000..4e885f9 --- /dev/null +++ b/ld/testsuite/ld-x86-64/dt-relr-2.s @@ -0,0 +1,23 @@ + .text + .globl func1 +func1: + ret +foo: + call func1@PLT + call func2@PLT + add __ehdr_start@GOTPCREL(%rip), %rax + .globl func2 +func2: + ret + .globl func3 +func3: + ret + .section .bar,"aw",@progbits + .p2align 3 + .dc.a data1 + .dc.a __ehdr_start + + .section .foo,"aw",@progbits + .p2align 3 + .dc.a data1 + .dc.a __ehdr_start diff --git a/ld/testsuite/ld-x86-64/dwarf4.s b/ld/testsuite/ld-x86-64/dwarf4.s new file mode 100644 index 0000000..7f1a90d --- /dev/null +++ b/ld/testsuite/ld-x86-64/dwarf4.s @@ -0,0 +1,346 @@ +/* Assembly outputs of + +extern void bar(); + +void foo(int p) { + int local = p; + bar(); + local = 123; + bar(); + local = 456; +} + +compiled by GCC 14.2.1 with -O2 -g -dA -gdwarf-4. */ + + .file "dwarf4.c" + .text +.Ltext0: + .file 1 "dwarf4.c" + .p2align 4 + .globl foo + .type foo, @function +foo: +.LVL0: + # DEBUG p => di +.LFB0: + # dwarf4.c:3:17 + .loc 1 3 17 view -0 + .cfi_startproc +# BLOCK 2, count:1073741824 (estimated locally) seq:0 +# PRED: ENTRY [always] count:1073741824 (estimated locally, freq 1.0000) (FALLTHRU) + # dwarf4.c:4:3 + .loc 1 4 3 view .LVU1 + # DEBUG local => di + # dwarf4.c:5:3 + .loc 1 5 3 view .LVU2 + # dwarf4.c:3:17 + .loc 1 3 17 is_stmt 0 view .LVU3 + subq $8, %rsp + .cfi_def_cfa_offset 16 + # dwarf4.c:5:3 + .loc 1 5 3 view .LVU4 + xorl %eax, %eax + call bar +.LVL1: + # DEBUG local => entry_value#0 + # DEBUG p => entry_value#0 + # dwarf4.c:6:3 + .loc 1 6 3 is_stmt 1 view .LVU5 + # DEBUG local => 0x7b + # dwarf4.c:7:3 + .loc 1 7 3 view .LVU6 + xorl %eax, %eax + # dwarf4.c:9:1 + .loc 1 9 1 is_stmt 0 view .LVU7 + addq $8, %rsp + .cfi_def_cfa_offset 8 +# SUCC: EXIT [always] count:1073741824 (estimated locally, freq 1.0000) (ABNORMAL,SIBCALL) + # dwarf4.c:7:3 + .loc 1 7 3 view .LVU8 + jmp bar +.LVL2: + .cfi_endproc +.LFE0: + .size foo, .-foo +.Letext0: + .section .debug_info,"",@progbits +.Ldebug_info0: + .long 0x9e # Length of Compilation Unit Info + .value 0x4 # DWARF version number + .long .Ldebug_abbrev0 # Offset Into Abbrev. Section + .byte 0x8 # Pointer Size (in bytes) + .uleb128 0x1 # (DIE (0xb) DW_TAG_compile_unit) + .long .LASF0 # DW_AT_producer: "GNU C17 14.2.1 20240906 [releases/gcc-14 r14-10649-gaedf6f810ee] -mtune=generic -march=x86-64 -g -gdwarf-4 -O2" + .byte 0xc # DW_AT_language + .long .LASF1 # DW_AT_name: "dwarf4.c" + .long .LASF2 # DW_AT_comp_dir: "." + .quad .Ltext0 # DW_AT_low_pc + .quad .Letext0-.Ltext0 # DW_AT_high_pc + .long .Ldebug_line0 # DW_AT_stmt_list + .uleb128 0x2 # (DIE (0x2d) DW_TAG_subprogram) + # DW_AT_external + .ascii "bar\0" # DW_AT_name + .byte 0x1 # DW_AT_decl_file (dwarf4.c) + .byte 0x1 # DW_AT_decl_line + .byte 0xd # DW_AT_decl_column + # DW_AT_declaration + .long 0x3b # DW_AT_sibling + .uleb128 0x3 # (DIE (0x39) DW_TAG_unspecified_parameters) + .byte 0 # end of children of DIE 0x2d + .uleb128 0x4 # (DIE (0x3b) DW_TAG_subprogram) + # DW_AT_external + .ascii "foo\0" # DW_AT_name + .byte 0x1 # DW_AT_decl_file (dwarf4.c) + .byte 0x3 # DW_AT_decl_line + .byte 0x6 # DW_AT_decl_column + # DW_AT_prototyped + .quad .LFB0 # DW_AT_low_pc + .quad .LFE0-.LFB0 # DW_AT_high_pc + .uleb128 0x1 # DW_AT_frame_base + .byte 0x9c # DW_OP_call_frame_cfa + # DW_AT_GNU_all_call_sites + .long 0x9a # DW_AT_sibling + .uleb128 0x5 # (DIE (0x59) DW_TAG_formal_parameter) + .ascii "p\0" # DW_AT_name + .byte 0x1 # DW_AT_decl_file (dwarf4.c) + .byte 0x3 # DW_AT_decl_line + .byte 0xe # DW_AT_decl_column + .long 0x9a # DW_AT_type + .long .LLST0 # DW_AT_location + .long .LVUS0 # DW_AT_GNU_locviews + .uleb128 0x6 # (DIE (0x6b) DW_TAG_variable) + .long .LASF3 # DW_AT_name: "local" + .byte 0x1 # DW_AT_decl_file (dwarf4.c) + .byte 0x4 # DW_AT_decl_line + .byte 0x7 # DW_AT_decl_column + .long 0x9a # DW_AT_type + .long .LLST1 # DW_AT_location + .long .LVUS1 # DW_AT_GNU_locviews + .uleb128 0x7 # (DIE (0x7f) DW_TAG_GNU_call_site) + .quad .LVL1 # DW_AT_low_pc + .long 0x2d # DW_AT_abstract_origin + .uleb128 0x8 # (DIE (0x8c) DW_TAG_GNU_call_site) + .quad .LVL2 # DW_AT_low_pc + # DW_AT_GNU_tail_call + .long 0x2d # DW_AT_abstract_origin + .byte 0 # end of children of DIE 0x3b + .uleb128 0x9 # (DIE (0x9a) DW_TAG_base_type) + .byte 0x4 # DW_AT_byte_size + .byte 0x5 # DW_AT_encoding + .ascii "int\0" # DW_AT_name + .byte 0 # end of children of DIE 0xb + .section .debug_abbrev,"",@progbits +.Ldebug_abbrev0: + .uleb128 0x1 # (abbrev code) + .uleb128 0x11 # (TAG: DW_TAG_compile_unit) + .byte 0x1 # DW_children_yes + .uleb128 0x25 # (DW_AT_producer) + .uleb128 0xe # (DW_FORM_strp) + .uleb128 0x13 # (DW_AT_language) + .uleb128 0xb # (DW_FORM_data1) + .uleb128 0x3 # (DW_AT_name) + .uleb128 0xe # (DW_FORM_strp) + .uleb128 0x1b # (DW_AT_comp_dir) + .uleb128 0xe # (DW_FORM_strp) + .uleb128 0x11 # (DW_AT_low_pc) + .uleb128 0x1 # (DW_FORM_addr) + .uleb128 0x12 # (DW_AT_high_pc) + .uleb128 0x7 # (DW_FORM_data8) + .uleb128 0x10 # (DW_AT_stmt_list) + .uleb128 0x17 # (DW_FORM_sec_offset) + .byte 0 + .byte 0 + .uleb128 0x2 # (abbrev code) + .uleb128 0x2e # (TAG: DW_TAG_subprogram) + .byte 0x1 # DW_children_yes + .uleb128 0x3f # (DW_AT_external) + .uleb128 0x19 # (DW_FORM_flag_present) + .uleb128 0x3 # (DW_AT_name) + .uleb128 0x8 # (DW_FORM_string) + .uleb128 0x3a # (DW_AT_decl_file) + .uleb128 0xb # (DW_FORM_data1) + .uleb128 0x3b # (DW_AT_decl_line) + .uleb128 0xb # (DW_FORM_data1) + .uleb128 0x39 # (DW_AT_decl_column) + .uleb128 0xb # (DW_FORM_data1) + .uleb128 0x3c # (DW_AT_declaration) + .uleb128 0x19 # (DW_FORM_flag_present) + .uleb128 0x1 # (DW_AT_sibling) + .uleb128 0x13 # (DW_FORM_ref4) + .byte 0 + .byte 0 + .uleb128 0x3 # (abbrev code) + .uleb128 0x18 # (TAG: DW_TAG_unspecified_parameters) + .byte 0 # DW_children_no + .byte 0 + .byte 0 + .uleb128 0x4 # (abbrev code) + .uleb128 0x2e # (TAG: DW_TAG_subprogram) + .byte 0x1 # DW_children_yes + .uleb128 0x3f # (DW_AT_external) + .uleb128 0x19 # (DW_FORM_flag_present) + .uleb128 0x3 # (DW_AT_name) + .uleb128 0x8 # (DW_FORM_string) + .uleb128 0x3a # (DW_AT_decl_file) + .uleb128 0xb # (DW_FORM_data1) + .uleb128 0x3b # (DW_AT_decl_line) + .uleb128 0xb # (DW_FORM_data1) + .uleb128 0x39 # (DW_AT_decl_column) + .uleb128 0xb # (DW_FORM_data1) + .uleb128 0x27 # (DW_AT_prototyped) + .uleb128 0x19 # (DW_FORM_flag_present) + .uleb128 0x11 # (DW_AT_low_pc) + .uleb128 0x1 # (DW_FORM_addr) + .uleb128 0x12 # (DW_AT_high_pc) + .uleb128 0x7 # (DW_FORM_data8) + .uleb128 0x40 # (DW_AT_frame_base) + .uleb128 0x18 # (DW_FORM_exprloc) + .uleb128 0x2117 # (DW_AT_GNU_all_call_sites) + .uleb128 0x19 # (DW_FORM_flag_present) + .uleb128 0x1 # (DW_AT_sibling) + .uleb128 0x13 # (DW_FORM_ref4) + .byte 0 + .byte 0 + .uleb128 0x5 # (abbrev code) + .uleb128 0x5 # (TAG: DW_TAG_formal_parameter) + .byte 0 # DW_children_no + .uleb128 0x3 # (DW_AT_name) + .uleb128 0x8 # (DW_FORM_string) + .uleb128 0x3a # (DW_AT_decl_file) + .uleb128 0xb # (DW_FORM_data1) + .uleb128 0x3b # (DW_AT_decl_line) + .uleb128 0xb # (DW_FORM_data1) + .uleb128 0x39 # (DW_AT_decl_column) + .uleb128 0xb # (DW_FORM_data1) + .uleb128 0x49 # (DW_AT_type) + .uleb128 0x13 # (DW_FORM_ref4) + .uleb128 0x2 # (DW_AT_location) + .uleb128 0x17 # (DW_FORM_sec_offset) + .uleb128 0x2137 # (DW_AT_GNU_locviews) + .uleb128 0x17 # (DW_FORM_sec_offset) + .byte 0 + .byte 0 + .uleb128 0x6 # (abbrev code) + .uleb128 0x34 # (TAG: DW_TAG_variable) + .byte 0 # DW_children_no + .uleb128 0x3 # (DW_AT_name) + .uleb128 0xe # (DW_FORM_strp) + .uleb128 0x3a # (DW_AT_decl_file) + .uleb128 0xb # (DW_FORM_data1) + .uleb128 0x3b # (DW_AT_decl_line) + .uleb128 0xb # (DW_FORM_data1) + .uleb128 0x39 # (DW_AT_decl_column) + .uleb128 0xb # (DW_FORM_data1) + .uleb128 0x49 # (DW_AT_type) + .uleb128 0x13 # (DW_FORM_ref4) + .uleb128 0x2 # (DW_AT_location) + .uleb128 0x17 # (DW_FORM_sec_offset) + .uleb128 0x2137 # (DW_AT_GNU_locviews) + .uleb128 0x17 # (DW_FORM_sec_offset) + .byte 0 + .byte 0 + .uleb128 0x7 # (abbrev code) + .uleb128 0x4109 # (TAG: DW_TAG_GNU_call_site) + .byte 0 # DW_children_no + .uleb128 0x11 # (DW_AT_low_pc) + .uleb128 0x1 # (DW_FORM_addr) + .uleb128 0x31 # (DW_AT_abstract_origin) + .uleb128 0x13 # (DW_FORM_ref4) + .byte 0 + .byte 0 + .uleb128 0x8 # (abbrev code) + .uleb128 0x4109 # (TAG: DW_TAG_GNU_call_site) + .byte 0 # DW_children_no + .uleb128 0x11 # (DW_AT_low_pc) + .uleb128 0x1 # (DW_FORM_addr) + .uleb128 0x2115 # (DW_AT_GNU_tail_call) + .uleb128 0x19 # (DW_FORM_flag_present) + .uleb128 0x31 # (DW_AT_abstract_origin) + .uleb128 0x13 # (DW_FORM_ref4) + .byte 0 + .byte 0 + .uleb128 0x9 # (abbrev code) + .uleb128 0x24 # (TAG: DW_TAG_base_type) + .byte 0 # DW_children_no + .uleb128 0xb # (DW_AT_byte_size) + .uleb128 0xb # (DW_FORM_data1) + .uleb128 0x3e # (DW_AT_encoding) + .uleb128 0xb # (DW_FORM_data1) + .uleb128 0x3 # (DW_AT_name) + .uleb128 0x8 # (DW_FORM_string) + .byte 0 + .byte 0 + .byte 0 + .section .debug_loc,"",@progbits +.Ldebug_loc0: +.LVUS0: + .uleb128 0 # View list begin (*.LVUS0) + .uleb128 .LVU5 # View list end (*.LVUS0) + .uleb128 .LVU5 # View list begin (*.LVUS0) + .uleb128 0 # View list end (*.LVUS0) +.LLST0: + .quad .LVL0-.Ltext0 # Location list begin address (*.LLST0) + .quad .LVL1-1-.Ltext0 # Location list end address (*.LLST0) + .value 0x1 # Location expression size + .byte 0x55 # DW_OP_reg5 + .quad .LVL1-1-.Ltext0 # Location list begin address (*.LLST0) + .quad .LFE0-.Ltext0 # Location list end address (*.LLST0) + .value 0x4 # Location expression size + .byte 0xf3 # DW_OP_GNU_entry_value + .uleb128 0x1 + .byte 0x55 # DW_OP_reg5 + .byte 0x9f # DW_OP_stack_value + .quad 0 # Location list terminator begin (*.LLST0) + .quad 0 # Location list terminator end (*.LLST0) +.LVUS1: + .uleb128 .LVU2 # View list begin (*.LVUS1) + .uleb128 .LVU5 # View list end (*.LVUS1) + .uleb128 .LVU5 # View list begin (*.LVUS1) + .uleb128 .LVU6 # View list end (*.LVUS1) + .uleb128 .LVU6 # View list begin (*.LVUS1) + .uleb128 0 # View list end (*.LVUS1) +.LLST1: + .quad .LVL0-.Ltext0 # Location list begin address (*.LLST1) + .quad .LVL1-1-.Ltext0 # Location list end address (*.LLST1) + .value 0x1 # Location expression size + .byte 0x55 # DW_OP_reg5 + .quad .LVL1-1-.Ltext0 # Location list begin address (*.LLST1) + .quad .LVL1-.Ltext0 # Location list end address (*.LLST1) + .value 0x4 # Location expression size + .byte 0xf3 # DW_OP_GNU_entry_value + .uleb128 0x1 + .byte 0x55 # DW_OP_reg5 + .byte 0x9f # DW_OP_stack_value + .quad .LVL1-.Ltext0 # Location list begin address (*.LLST1) + .quad .LFE0-.Ltext0 # Location list end address (*.LLST1) + .value 0x3 # Location expression size + .byte 0x8 # DW_OP_const1u + .byte 0x7b + .byte 0x9f # DW_OP_stack_value + .quad 0 # Location list terminator begin (*.LLST1) + .quad 0 # Location list terminator end (*.LLST1) + .section .debug_aranges,"",@progbits + .long 0x2c # Length of Address Ranges Info + .value 0x2 # DWARF aranges version + .long .Ldebug_info0 # Offset of Compilation Unit Info + .byte 0x8 # Size of Address + .byte 0 # Size of Segment Descriptor + .value 0 # Pad to 16 byte boundary + .value 0 + .quad .Ltext0 # Address + .quad .Letext0-.Ltext0 # Length + .quad 0 + .quad 0 + .section .debug_line,"",@progbits +.Ldebug_line0: + .section .debug_str,"MS",@progbits,1 +.LASF0: + .string "GNU C17 14.2.1 20240906 [releases/gcc-14 r14-10649-gaedf6f810ee] -mtune=generic -march=x86-64 -g -gdwarf-4 -O2" +.LASF1: + .string "dwarf4.c" +.LASF3: + .string "local" +.LASF2: + .string "." + .ident "GCC: (GNU) 14.2.1 20240906 [releases/gcc-14 r14-10649-gaedf6f810ee]" + .section .note.GNU-stack,"",@progbits diff --git a/ld/testsuite/ld-x86-64/dwarf5a.s b/ld/testsuite/ld-x86-64/dwarf5a.s new file mode 100644 index 0000000..eefaaf4 --- /dev/null +++ b/ld/testsuite/ld-x86-64/dwarf5a.s @@ -0,0 +1,400 @@ +/* Assembly outputs of + +extern void foo(int); + +int global; + +int main() { + int local = global; + foo(1); + local = 123; + foo(2); + local = 456; + return 0; +} + +compiled by GCC 14.2.1 with -O2 -g -dA -gdwarf-5. */ + + .file "dwarf5a.c" + .text +.Ltext0: + .file 0 "." "dwarf5a.c" + .section .text.startup,"ax",@progbits + .p2align 4 + .globl main + .type main, @function +main: +.LFB0: + .file 1 "dwarf5a.c" + # dwarf5a.c:5:12 + .loc 1 5 12 view -0 + .cfi_startproc +# BLOCK 2, count:1073741824 (estimated locally) seq:0 +# PRED: ENTRY [always] count:1073741824 (estimated locally, freq 1.0000) (FALLTHRU) + # dwarf5a.c:6:3 + .loc 1 6 3 view .LVU1 +.LVL0: + # DEBUG local => [`global'] + # dwarf5a.c:7:3 + .loc 1 7 3 view .LVU2 + # dwarf5a.c:5:12 + .loc 1 5 12 is_stmt 0 view .LVU3 + subq $8, %rsp + .cfi_def_cfa_offset 16 + # dwarf5a.c:7:3 + .loc 1 7 3 view .LVU4 + movl $1, %edi + call foo +.LVL1: + # DEBUG local RESET + # dwarf5a.c:8:3 + .loc 1 8 3 is_stmt 1 view .LVU5 + # DEBUG local => 0x7b + # dwarf5a.c:9:3 + .loc 1 9 3 view .LVU6 + movl $2, %edi + call foo +.LVL2: + # dwarf5a.c:10:3 + .loc 1 10 3 view .LVU7 + # DEBUG local => 0x1c8 + # dwarf5a.c:11:3 + .loc 1 11 3 view .LVU8 + # dwarf5a.c:12:1 + .loc 1 12 1 is_stmt 0 view .LVU9 + xorl %eax, %eax + addq $8, %rsp + .cfi_def_cfa_offset 8 +# SUCC: EXIT [always] count:1073741824 (estimated locally, freq 1.0000) + ret + .cfi_endproc +.LFE0: + .size main, .-main + .globl global + .bss + .align 4 + .type global, @object + .size global, 4 +global: + .zero 4 + .text +.Letext0: + .section .debug_info,"",@progbits +.Ldebug_info0: + .long 0xb3 # Length of Compilation Unit Info + .value 0x5 # DWARF version number + .byte 0x1 # DW_UT_compile + .byte 0x8 # Pointer Size (in bytes) + .long .Ldebug_abbrev0 # Offset Into Abbrev. Section + .uleb128 0x2 # (DIE (0xc) DW_TAG_compile_unit) + .long .LASF4 # DW_AT_producer: "GNU C17 14.2.1 20240906 [releases/gcc-14 r14-10649-gaedf6f810ee] -mtune=generic -march=x86-64 -g -gdwarf-5 -O2" + .byte 0x1d # DW_AT_language + .long .LASF0 # DW_AT_name: "dwarf5a.c" + .long .LASF1 # DW_AT_comp_dir: "." + .long .LLRL1 # DW_AT_ranges + .quad 0 # DW_AT_low_pc + .long .Ldebug_line0 # DW_AT_stmt_list + .uleb128 0x3 # (DIE (0x2a) DW_TAG_variable) + .long .LASF2 # DW_AT_name: "global" + .byte 0x1 # DW_AT_decl_file (dwarf5a.c) + .byte 0x3 # DW_AT_decl_line + .byte 0x5 # DW_AT_decl_column + .long 0x40 # DW_AT_type + # DW_AT_external + .uleb128 0x9 # DW_AT_location + .byte 0x3 # DW_OP_addr + .quad global + .uleb128 0x4 # (DIE (0x40) DW_TAG_base_type) + .byte 0x4 # DW_AT_byte_size + .byte 0x5 # DW_AT_encoding + .ascii "int\0" # DW_AT_name + .uleb128 0x5 # (DIE (0x47) DW_TAG_subprogram) + # DW_AT_external + .ascii "foo\0" # DW_AT_name + .byte 0x1 # DW_AT_decl_file (dwarf5a.c) + .byte 0x1 # DW_AT_decl_line + .byte 0xd # DW_AT_decl_column + # DW_AT_prototyped + # DW_AT_declaration + .long 0x59 # DW_AT_sibling + .uleb128 0x6 # (DIE (0x53) DW_TAG_formal_parameter) + .long 0x40 # DW_AT_type + .byte 0 # end of children of DIE 0x47 + .uleb128 0x7 # (DIE (0x59) DW_TAG_subprogram) + # DW_AT_external + .long .LASF5 # DW_AT_name: "main" + .byte 0x1 # DW_AT_decl_file (dwarf5a.c) + .byte 0x5 # DW_AT_decl_line + .byte 0x5 # DW_AT_decl_column + .long 0x40 # DW_AT_type + .quad .LFB0 # DW_AT_low_pc + .quad .LFE0-.LFB0 # DW_AT_high_pc + .uleb128 0x1 # DW_AT_frame_base + .byte 0x9c # DW_OP_call_frame_cfa + # DW_AT_call_all_calls + .uleb128 0x8 # (DIE (0x77) DW_TAG_variable) + .long .LASF3 # DW_AT_name: "local" + .byte 0x1 # DW_AT_decl_file (dwarf5a.c) + .byte 0x6 # DW_AT_decl_line + .byte 0x7 # DW_AT_decl_column + .long 0x40 # DW_AT_type + .long .LLST0 # DW_AT_location + .long .LVUS0 # DW_AT_GNU_locviews + .uleb128 0x9 # (DIE (0x8b) DW_TAG_call_site) + .quad .LVL1 # DW_AT_call_return_pc + .long 0x47 # DW_AT_call_origin + .long 0xa2 # DW_AT_sibling + .uleb128 0x1 # (DIE (0x9c) DW_TAG_call_site_parameter) + .uleb128 0x1 # DW_AT_location + .byte 0x55 # DW_OP_reg5 + .uleb128 0x1 # DW_AT_call_value + .byte 0x31 # DW_OP_lit1 + .byte 0 # end of children of DIE 0x8b + .uleb128 0xa # (DIE (0xa2) DW_TAG_call_site) + .quad .LVL2 # DW_AT_call_return_pc + .long 0x47 # DW_AT_call_origin + .uleb128 0x1 # (DIE (0xaf) DW_TAG_call_site_parameter) + .uleb128 0x1 # DW_AT_location + .byte 0x55 # DW_OP_reg5 + .uleb128 0x1 # DW_AT_call_value + .byte 0x32 # DW_OP_lit2 + .byte 0 # end of children of DIE 0xa2 + .byte 0 # end of children of DIE 0x59 + .byte 0 # end of children of DIE 0xc + .section .debug_abbrev,"",@progbits +.Ldebug_abbrev0: + .uleb128 0x1 # (abbrev code) + .uleb128 0x49 # (TAG: DW_TAG_call_site_parameter) + .byte 0 # DW_children_no + .uleb128 0x2 # (DW_AT_location) + .uleb128 0x18 # (DW_FORM_exprloc) + .uleb128 0x7e # (DW_AT_call_value) + .uleb128 0x18 # (DW_FORM_exprloc) + .byte 0 + .byte 0 + .uleb128 0x2 # (abbrev code) + .uleb128 0x11 # (TAG: DW_TAG_compile_unit) + .byte 0x1 # DW_children_yes + .uleb128 0x25 # (DW_AT_producer) + .uleb128 0xe # (DW_FORM_strp) + .uleb128 0x13 # (DW_AT_language) + .uleb128 0xb # (DW_FORM_data1) + .uleb128 0x3 # (DW_AT_name) + .uleb128 0x1f # (DW_FORM_line_strp) + .uleb128 0x1b # (DW_AT_comp_dir) + .uleb128 0x1f # (DW_FORM_line_strp) + .uleb128 0x55 # (DW_AT_ranges) + .uleb128 0x17 # (DW_FORM_sec_offset) + .uleb128 0x11 # (DW_AT_low_pc) + .uleb128 0x1 # (DW_FORM_addr) + .uleb128 0x10 # (DW_AT_stmt_list) + .uleb128 0x17 # (DW_FORM_sec_offset) + .byte 0 + .byte 0 + .uleb128 0x3 # (abbrev code) + .uleb128 0x34 # (TAG: DW_TAG_variable) + .byte 0 # DW_children_no + .uleb128 0x3 # (DW_AT_name) + .uleb128 0xe # (DW_FORM_strp) + .uleb128 0x3a # (DW_AT_decl_file) + .uleb128 0xb # (DW_FORM_data1) + .uleb128 0x3b # (DW_AT_decl_line) + .uleb128 0xb # (DW_FORM_data1) + .uleb128 0x39 # (DW_AT_decl_column) + .uleb128 0xb # (DW_FORM_data1) + .uleb128 0x49 # (DW_AT_type) + .uleb128 0x13 # (DW_FORM_ref4) + .uleb128 0x3f # (DW_AT_external) + .uleb128 0x19 # (DW_FORM_flag_present) + .uleb128 0x2 # (DW_AT_location) + .uleb128 0x18 # (DW_FORM_exprloc) + .byte 0 + .byte 0 + .uleb128 0x4 # (abbrev code) + .uleb128 0x24 # (TAG: DW_TAG_base_type) + .byte 0 # DW_children_no + .uleb128 0xb # (DW_AT_byte_size) + .uleb128 0xb # (DW_FORM_data1) + .uleb128 0x3e # (DW_AT_encoding) + .uleb128 0xb # (DW_FORM_data1) + .uleb128 0x3 # (DW_AT_name) + .uleb128 0x8 # (DW_FORM_string) + .byte 0 + .byte 0 + .uleb128 0x5 # (abbrev code) + .uleb128 0x2e # (TAG: DW_TAG_subprogram) + .byte 0x1 # DW_children_yes + .uleb128 0x3f # (DW_AT_external) + .uleb128 0x19 # (DW_FORM_flag_present) + .uleb128 0x3 # (DW_AT_name) + .uleb128 0x8 # (DW_FORM_string) + .uleb128 0x3a # (DW_AT_decl_file) + .uleb128 0xb # (DW_FORM_data1) + .uleb128 0x3b # (DW_AT_decl_line) + .uleb128 0xb # (DW_FORM_data1) + .uleb128 0x39 # (DW_AT_decl_column) + .uleb128 0xb # (DW_FORM_data1) + .uleb128 0x27 # (DW_AT_prototyped) + .uleb128 0x19 # (DW_FORM_flag_present) + .uleb128 0x3c # (DW_AT_declaration) + .uleb128 0x19 # (DW_FORM_flag_present) + .uleb128 0x1 # (DW_AT_sibling) + .uleb128 0x13 # (DW_FORM_ref4) + .byte 0 + .byte 0 + .uleb128 0x6 # (abbrev code) + .uleb128 0x5 # (TAG: DW_TAG_formal_parameter) + .byte 0 # DW_children_no + .uleb128 0x49 # (DW_AT_type) + .uleb128 0x13 # (DW_FORM_ref4) + .byte 0 + .byte 0 + .uleb128 0x7 # (abbrev code) + .uleb128 0x2e # (TAG: DW_TAG_subprogram) + .byte 0x1 # DW_children_yes + .uleb128 0x3f # (DW_AT_external) + .uleb128 0x19 # (DW_FORM_flag_present) + .uleb128 0x3 # (DW_AT_name) + .uleb128 0xe # (DW_FORM_strp) + .uleb128 0x3a # (DW_AT_decl_file) + .uleb128 0xb # (DW_FORM_data1) + .uleb128 0x3b # (DW_AT_decl_line) + .uleb128 0xb # (DW_FORM_data1) + .uleb128 0x39 # (DW_AT_decl_column) + .uleb128 0xb # (DW_FORM_data1) + .uleb128 0x49 # (DW_AT_type) + .uleb128 0x13 # (DW_FORM_ref4) + .uleb128 0x11 # (DW_AT_low_pc) + .uleb128 0x1 # (DW_FORM_addr) + .uleb128 0x12 # (DW_AT_high_pc) + .uleb128 0x7 # (DW_FORM_data8) + .uleb128 0x40 # (DW_AT_frame_base) + .uleb128 0x18 # (DW_FORM_exprloc) + .uleb128 0x7a # (DW_AT_call_all_calls) + .uleb128 0x19 # (DW_FORM_flag_present) + .byte 0 + .byte 0 + .uleb128 0x8 # (abbrev code) + .uleb128 0x34 # (TAG: DW_TAG_variable) + .byte 0 # DW_children_no + .uleb128 0x3 # (DW_AT_name) + .uleb128 0xe # (DW_FORM_strp) + .uleb128 0x3a # (DW_AT_decl_file) + .uleb128 0xb # (DW_FORM_data1) + .uleb128 0x3b # (DW_AT_decl_line) + .uleb128 0xb # (DW_FORM_data1) + .uleb128 0x39 # (DW_AT_decl_column) + .uleb128 0xb # (DW_FORM_data1) + .uleb128 0x49 # (DW_AT_type) + .uleb128 0x13 # (DW_FORM_ref4) + .uleb128 0x2 # (DW_AT_location) + .uleb128 0x17 # (DW_FORM_sec_offset) + .uleb128 0x2137 # (DW_AT_GNU_locviews) + .uleb128 0x17 # (DW_FORM_sec_offset) + .byte 0 + .byte 0 + .uleb128 0x9 # (abbrev code) + .uleb128 0x48 # (TAG: DW_TAG_call_site) + .byte 0x1 # DW_children_yes + .uleb128 0x7d # (DW_AT_call_return_pc) + .uleb128 0x1 # (DW_FORM_addr) + .uleb128 0x7f # (DW_AT_call_origin) + .uleb128 0x13 # (DW_FORM_ref4) + .uleb128 0x1 # (DW_AT_sibling) + .uleb128 0x13 # (DW_FORM_ref4) + .byte 0 + .byte 0 + .uleb128 0xa # (abbrev code) + .uleb128 0x48 # (TAG: DW_TAG_call_site) + .byte 0x1 # DW_children_yes + .uleb128 0x7d # (DW_AT_call_return_pc) + .uleb128 0x1 # (DW_FORM_addr) + .uleb128 0x7f # (DW_AT_call_origin) + .uleb128 0x13 # (DW_FORM_ref4) + .byte 0 + .byte 0 + .byte 0 + .section .debug_loclists,"",@progbits + .long .Ldebug_loc3-.Ldebug_loc2 # Length of Location Lists +.Ldebug_loc2: + .value 0x5 # DWARF version number + .byte 0x8 # Address Size + .byte 0 # Segment Size + .long 0 # Offset Entry Count +.Ldebug_loc0: +.LVUS0: + .uleb128 .LVU2 # View list begin (*.LVUS0) + .uleb128 .LVU5 # View list end (*.LVUS0) + .uleb128 .LVU6 # View list begin (*.LVUS0) + .uleb128 .LVU8 # View list end (*.LVUS0) + .uleb128 .LVU8 # View list begin (*.LVUS0) + .uleb128 0 # View list end (*.LVUS0) +.LLST0: + .byte 0x6 # DW_LLE_base_address (*.LLST0) + .quad .LVL0 # Base address (*.LLST0) + .byte 0x4 # DW_LLE_offset_pair (*.LLST0) + .uleb128 .LVL0-.LVL0 # Location list begin address (*.LLST0) + .uleb128 .LVL1-1-.LVL0 # Location list end address (*.LLST0) + .uleb128 0x9 # Location expression size + .byte 0x3 # DW_OP_addr + .quad global + .byte 0x4 # DW_LLE_offset_pair (*.LLST0) + .uleb128 .LVL1-.LVL0 # Location list begin address (*.LLST0) + .uleb128 .LVL2-.LVL0 # Location list end address (*.LLST0) + .uleb128 0x3 # Location expression size + .byte 0x8 # DW_OP_const1u + .byte 0x7b + .byte 0x9f # DW_OP_stack_value + .byte 0x4 # DW_LLE_offset_pair (*.LLST0) + .uleb128 .LVL2-.LVL0 # Location list begin address (*.LLST0) + .uleb128 .LFE0-.LVL0 # Location list end address (*.LLST0) + .uleb128 0x4 # Location expression size + .byte 0xa # DW_OP_const2u + .value 0x1c8 + .byte 0x9f # DW_OP_stack_value + .byte 0 # DW_LLE_end_of_list (*.LLST0) +.Ldebug_loc3: + .section .debug_aranges,"",@progbits + .long 0x2c # Length of Address Ranges Info + .value 0x2 # DWARF aranges version + .long .Ldebug_info0 # Offset of Compilation Unit Info + .byte 0x8 # Size of Address + .byte 0 # Size of Segment Descriptor + .value 0 # Pad to 16 byte boundary + .value 0 + .quad .LFB0 # Address + .quad .LFE0-.LFB0 # Length + .quad 0 + .quad 0 + .section .debug_rnglists,"",@progbits +.Ldebug_ranges0: + .long .Ldebug_ranges3-.Ldebug_ranges2 # Length of Range Lists +.Ldebug_ranges2: + .value 0x5 # DWARF version number + .byte 0x8 # Address Size + .byte 0 # Segment Size + .long 0 # Offset Entry Count +.LLRL1: + .byte 0x7 # DW_RLE_start_length (*.LLRL1) + .quad .LFB0 # Range begin address (*.LLRL1) + .uleb128 .LFE0-.LFB0 # Range length (*.LLRL1) + .byte 0 # DW_RLE_end_of_list (*.LLRL1) +.Ldebug_ranges3: + .section .debug_line,"",@progbits +.Ldebug_line0: + .section .debug_str,"MS",@progbits,1 +.LASF3: + .string "local" +.LASF4: + .string "GNU C17 14.2.1 20240906 [releases/gcc-14 r14-10649-gaedf6f810ee] -mtune=generic -march=x86-64 -g -gdwarf-5 -O2" +.LASF2: + .string "global" +.LASF5: + .string "main" + .section .debug_line_str,"MS",@progbits,1 +.LASF0: + .string "dwarf5a.c" +.LASF1: + .string "." + .ident "GCC: (GNU) 14.2.1 20240906 [releases/gcc-14 r14-10649-gaedf6f810ee]" + .section .note.GNU-stack,"",@progbits diff --git a/ld/testsuite/ld-x86-64/dwarf5b.s b/ld/testsuite/ld-x86-64/dwarf5b.s new file mode 100644 index 0000000..4d34469 --- /dev/null +++ b/ld/testsuite/ld-x86-64/dwarf5b.s @@ -0,0 +1,345 @@ +/* Assembly outputs of + +extern void foo(int); + +extern int global; + +void +bar (void) +{ + int local = global; + foo(local); + local = 123; + foo(local); + local = 456; +} + +compiled by GCC 14.2.1 with -O2 -g -dA -gdwarf-5. */ + + .file "dwarf5b.c" + .text +.Ltext0: + .file 0 "." "dwarf5b.c" + .p2align 4 + .globl bar + .type bar, @function +bar: +.LFB0: + .file 1 "dwarf5b.c" + # dwarf5b.c:7:1 + .loc 1 7 1 view -0 + .cfi_startproc +# BLOCK 2, count:1073741824 (estimated locally) seq:0 +# PRED: ENTRY [always] count:1073741824 (estimated locally, freq 1.0000) (FALLTHRU) + # dwarf5b.c:8:3 + .loc 1 8 3 view .LVU1 +.LVL0: + # DEBUG local => [`global'] + # dwarf5b.c:9:3 + .loc 1 9 3 view .LVU2 + # dwarf5b.c:7:1 + .loc 1 7 1 is_stmt 0 view .LVU3 + subq $8, %rsp + .cfi_def_cfa_offset 16 + # dwarf5b.c:9:3 + .loc 1 9 3 view .LVU4 + movl global(%rip), %edi + call foo +.LVL1: + # DEBUG local RESET + # dwarf5b.c:10:3 + .loc 1 10 3 is_stmt 1 view .LVU5 + # DEBUG local => 0x7b + # dwarf5b.c:11:3 + .loc 1 11 3 view .LVU6 + movl $123, %edi + # dwarf5b.c:13:1 + .loc 1 13 1 is_stmt 0 view .LVU7 + addq $8, %rsp + .cfi_def_cfa_offset 8 +# SUCC: EXIT [always] count:1073741824 (estimated locally, freq 1.0000) (ABNORMAL,SIBCALL) + # dwarf5b.c:11:3 + .loc 1 11 3 view .LVU8 + jmp foo +.LVL2: + .cfi_endproc +.LFE0: + .size bar, .-bar +.Letext0: + .section .debug_info,"",@progbits +.Ldebug_info0: + .long 0xa0 # Length of Compilation Unit Info + .value 0x5 # DWARF version number + .byte 0x1 # DW_UT_compile + .byte 0x8 # Pointer Size (in bytes) + .long .Ldebug_abbrev0 # Offset Into Abbrev. Section + .uleb128 0x1 # (DIE (0xc) DW_TAG_compile_unit) + .long .LASF4 # DW_AT_producer: "GNU C17 14.2.1 20240906 [releases/gcc-14 r14-10649-gaedf6f810ee] -mtune=generic -march=x86-64 -g -gdwarf-5 -O2" + .byte 0x1d # DW_AT_language + .long .LASF0 # DW_AT_name: "dwarf5b.c" + .long .LASF1 # DW_AT_comp_dir: "." + .quad .Ltext0 # DW_AT_low_pc + .quad .Letext0-.Ltext0 # DW_AT_high_pc + .long .Ldebug_line0 # DW_AT_stmt_list + .uleb128 0x2 # (DIE (0x2e) DW_TAG_variable) + .long .LASF2 # DW_AT_name: "global" + .byte 0x1 # DW_AT_decl_file (dwarf5b.c) + .byte 0x3 # DW_AT_decl_line + .byte 0xc # DW_AT_decl_column + .long 0x3a # DW_AT_type + # DW_AT_external + # DW_AT_declaration + .uleb128 0x3 # (DIE (0x3a) DW_TAG_base_type) + .byte 0x4 # DW_AT_byte_size + .byte 0x5 # DW_AT_encoding + .ascii "int\0" # DW_AT_name + .uleb128 0x4 # (DIE (0x41) DW_TAG_subprogram) + # DW_AT_external + .ascii "foo\0" # DW_AT_name + .byte 0x1 # DW_AT_decl_file (dwarf5b.c) + .byte 0x1 # DW_AT_decl_line + .byte 0xd # DW_AT_decl_column + # DW_AT_prototyped + # DW_AT_declaration + .long 0x53 # DW_AT_sibling + .uleb128 0x5 # (DIE (0x4d) DW_TAG_formal_parameter) + .long 0x3a # DW_AT_type + .byte 0 # end of children of DIE 0x41 + .uleb128 0x6 # (DIE (0x53) DW_TAG_subprogram) + # DW_AT_external + .ascii "bar\0" # DW_AT_name + .byte 0x1 # DW_AT_decl_file (dwarf5b.c) + .byte 0x6 # DW_AT_decl_line + .byte 0x1 # DW_AT_decl_column + # DW_AT_prototyped + .quad .LFB0 # DW_AT_low_pc + .quad .LFE0-.LFB0 # DW_AT_high_pc + .uleb128 0x1 # DW_AT_frame_base + .byte 0x9c # DW_OP_call_frame_cfa + # DW_AT_call_all_calls + .uleb128 0x7 # (DIE (0x6d) DW_TAG_variable) + .long .LASF3 # DW_AT_name: "local" + .byte 0x1 # DW_AT_decl_file (dwarf5b.c) + .byte 0x8 # DW_AT_decl_line + .byte 0x7 # DW_AT_decl_column + .long 0x3a # DW_AT_type + .long .LLST0 # DW_AT_location + .long .LVUS0 # DW_AT_GNU_locviews + .uleb128 0x8 # (DIE (0x81) DW_TAG_call_site) + .quad .LVL1 # DW_AT_call_return_pc + .long 0x41 # DW_AT_call_origin + .uleb128 0x9 # (DIE (0x8e) DW_TAG_call_site) + .quad .LVL2 # DW_AT_call_return_pc + # DW_AT_call_tail_call + .long 0x41 # DW_AT_call_origin + .uleb128 0xa # (DIE (0x9b) DW_TAG_call_site_parameter) + .uleb128 0x1 # DW_AT_location + .byte 0x55 # DW_OP_reg5 + .uleb128 0x2 # DW_AT_call_value + .byte 0x8 # DW_OP_const1u + .byte 0x7b + .byte 0 # end of children of DIE 0x8e + .byte 0 # end of children of DIE 0x53 + .byte 0 # end of children of DIE 0xc + .section .debug_abbrev,"",@progbits +.Ldebug_abbrev0: + .uleb128 0x1 # (abbrev code) + .uleb128 0x11 # (TAG: DW_TAG_compile_unit) + .byte 0x1 # DW_children_yes + .uleb128 0x25 # (DW_AT_producer) + .uleb128 0xe # (DW_FORM_strp) + .uleb128 0x13 # (DW_AT_language) + .uleb128 0xb # (DW_FORM_data1) + .uleb128 0x3 # (DW_AT_name) + .uleb128 0x1f # (DW_FORM_line_strp) + .uleb128 0x1b # (DW_AT_comp_dir) + .uleb128 0x1f # (DW_FORM_line_strp) + .uleb128 0x11 # (DW_AT_low_pc) + .uleb128 0x1 # (DW_FORM_addr) + .uleb128 0x12 # (DW_AT_high_pc) + .uleb128 0x7 # (DW_FORM_data8) + .uleb128 0x10 # (DW_AT_stmt_list) + .uleb128 0x17 # (DW_FORM_sec_offset) + .byte 0 + .byte 0 + .uleb128 0x2 # (abbrev code) + .uleb128 0x34 # (TAG: DW_TAG_variable) + .byte 0 # DW_children_no + .uleb128 0x3 # (DW_AT_name) + .uleb128 0xe # (DW_FORM_strp) + .uleb128 0x3a # (DW_AT_decl_file) + .uleb128 0xb # (DW_FORM_data1) + .uleb128 0x3b # (DW_AT_decl_line) + .uleb128 0xb # (DW_FORM_data1) + .uleb128 0x39 # (DW_AT_decl_column) + .uleb128 0xb # (DW_FORM_data1) + .uleb128 0x49 # (DW_AT_type) + .uleb128 0x13 # (DW_FORM_ref4) + .uleb128 0x3f # (DW_AT_external) + .uleb128 0x19 # (DW_FORM_flag_present) + .uleb128 0x3c # (DW_AT_declaration) + .uleb128 0x19 # (DW_FORM_flag_present) + .byte 0 + .byte 0 + .uleb128 0x3 # (abbrev code) + .uleb128 0x24 # (TAG: DW_TAG_base_type) + .byte 0 # DW_children_no + .uleb128 0xb # (DW_AT_byte_size) + .uleb128 0xb # (DW_FORM_data1) + .uleb128 0x3e # (DW_AT_encoding) + .uleb128 0xb # (DW_FORM_data1) + .uleb128 0x3 # (DW_AT_name) + .uleb128 0x8 # (DW_FORM_string) + .byte 0 + .byte 0 + .uleb128 0x4 # (abbrev code) + .uleb128 0x2e # (TAG: DW_TAG_subprogram) + .byte 0x1 # DW_children_yes + .uleb128 0x3f # (DW_AT_external) + .uleb128 0x19 # (DW_FORM_flag_present) + .uleb128 0x3 # (DW_AT_name) + .uleb128 0x8 # (DW_FORM_string) + .uleb128 0x3a # (DW_AT_decl_file) + .uleb128 0xb # (DW_FORM_data1) + .uleb128 0x3b # (DW_AT_decl_line) + .uleb128 0xb # (DW_FORM_data1) + .uleb128 0x39 # (DW_AT_decl_column) + .uleb128 0xb # (DW_FORM_data1) + .uleb128 0x27 # (DW_AT_prototyped) + .uleb128 0x19 # (DW_FORM_flag_present) + .uleb128 0x3c # (DW_AT_declaration) + .uleb128 0x19 # (DW_FORM_flag_present) + .uleb128 0x1 # (DW_AT_sibling) + .uleb128 0x13 # (DW_FORM_ref4) + .byte 0 + .byte 0 + .uleb128 0x5 # (abbrev code) + .uleb128 0x5 # (TAG: DW_TAG_formal_parameter) + .byte 0 # DW_children_no + .uleb128 0x49 # (DW_AT_type) + .uleb128 0x13 # (DW_FORM_ref4) + .byte 0 + .byte 0 + .uleb128 0x6 # (abbrev code) + .uleb128 0x2e # (TAG: DW_TAG_subprogram) + .byte 0x1 # DW_children_yes + .uleb128 0x3f # (DW_AT_external) + .uleb128 0x19 # (DW_FORM_flag_present) + .uleb128 0x3 # (DW_AT_name) + .uleb128 0x8 # (DW_FORM_string) + .uleb128 0x3a # (DW_AT_decl_file) + .uleb128 0xb # (DW_FORM_data1) + .uleb128 0x3b # (DW_AT_decl_line) + .uleb128 0xb # (DW_FORM_data1) + .uleb128 0x39 # (DW_AT_decl_column) + .uleb128 0xb # (DW_FORM_data1) + .uleb128 0x27 # (DW_AT_prototyped) + .uleb128 0x19 # (DW_FORM_flag_present) + .uleb128 0x11 # (DW_AT_low_pc) + .uleb128 0x1 # (DW_FORM_addr) + .uleb128 0x12 # (DW_AT_high_pc) + .uleb128 0x7 # (DW_FORM_data8) + .uleb128 0x40 # (DW_AT_frame_base) + .uleb128 0x18 # (DW_FORM_exprloc) + .uleb128 0x7a # (DW_AT_call_all_calls) + .uleb128 0x19 # (DW_FORM_flag_present) + .byte 0 + .byte 0 + .uleb128 0x7 # (abbrev code) + .uleb128 0x34 # (TAG: DW_TAG_variable) + .byte 0 # DW_children_no + .uleb128 0x3 # (DW_AT_name) + .uleb128 0xe # (DW_FORM_strp) + .uleb128 0x3a # (DW_AT_decl_file) + .uleb128 0xb # (DW_FORM_data1) + .uleb128 0x3b # (DW_AT_decl_line) + .uleb128 0xb # (DW_FORM_data1) + .uleb128 0x39 # (DW_AT_decl_column) + .uleb128 0xb # (DW_FORM_data1) + .uleb128 0x49 # (DW_AT_type) + .uleb128 0x13 # (DW_FORM_ref4) + .uleb128 0x2 # (DW_AT_location) + .uleb128 0x17 # (DW_FORM_sec_offset) + .uleb128 0x2137 # (DW_AT_GNU_locviews) + .uleb128 0x17 # (DW_FORM_sec_offset) + .byte 0 + .byte 0 + .uleb128 0x8 # (abbrev code) + .uleb128 0x48 # (TAG: DW_TAG_call_site) + .byte 0 # DW_children_no + .uleb128 0x7d # (DW_AT_call_return_pc) + .uleb128 0x1 # (DW_FORM_addr) + .uleb128 0x7f # (DW_AT_call_origin) + .uleb128 0x13 # (DW_FORM_ref4) + .byte 0 + .byte 0 + .uleb128 0x9 # (abbrev code) + .uleb128 0x48 # (TAG: DW_TAG_call_site) + .byte 0x1 # DW_children_yes + .uleb128 0x7d # (DW_AT_call_return_pc) + .uleb128 0x1 # (DW_FORM_addr) + .uleb128 0x82 # (DW_AT_call_tail_call) + .uleb128 0x19 # (DW_FORM_flag_present) + .uleb128 0x7f # (DW_AT_call_origin) + .uleb128 0x13 # (DW_FORM_ref4) + .byte 0 + .byte 0 + .uleb128 0xa # (abbrev code) + .uleb128 0x49 # (TAG: DW_TAG_call_site_parameter) + .byte 0 # DW_children_no + .uleb128 0x2 # (DW_AT_location) + .uleb128 0x18 # (DW_FORM_exprloc) + .uleb128 0x7e # (DW_AT_call_value) + .uleb128 0x18 # (DW_FORM_exprloc) + .byte 0 + .byte 0 + .byte 0 + .section .debug_loclists,"",@progbits + .long .Ldebug_loc3-.Ldebug_loc2 # Length of Location Lists +.Ldebug_loc2: + .value 0x5 # DWARF version number + .byte 0x8 # Address Size + .byte 0 # Segment Size + .long 0 # Offset Entry Count +.Ldebug_loc0: +.LVUS0: + .uleb128 .LVU6 # View list begin (*.LVUS0) + .uleb128 0 # View list end (*.LVUS0) +.LLST0: + .byte 0x4 # DW_LLE_offset_pair (*.LLST0) + .uleb128 .LVL1-.Ltext0 # Location list begin address (*.LLST0) + .uleb128 .LFE0-.Ltext0 # Location list end address (*.LLST0) + .uleb128 0x3 # Location expression size + .byte 0x8 # DW_OP_const1u + .byte 0x7b + .byte 0x9f # DW_OP_stack_value + .byte 0 # DW_LLE_end_of_list (*.LLST0) +.Ldebug_loc3: + .section .debug_aranges,"",@progbits + .long 0x2c # Length of Address Ranges Info + .value 0x2 # DWARF aranges version + .long .Ldebug_info0 # Offset of Compilation Unit Info + .byte 0x8 # Size of Address + .byte 0 # Size of Segment Descriptor + .value 0 # Pad to 16 byte boundary + .value 0 + .quad .Ltext0 # Address + .quad .Letext0-.Ltext0 # Length + .quad 0 + .quad 0 + .section .debug_line,"",@progbits +.Ldebug_line0: + .section .debug_str,"MS",@progbits,1 +.LASF3: + .string "local" +.LASF4: + .string "GNU C17 14.2.1 20240906 [releases/gcc-14 r14-10649-gaedf6f810ee] -mtune=generic -march=x86-64 -g -gdwarf-5 -O2" +.LASF2: + .string "global" + .section .debug_line_str,"MS",@progbits,1 +.LASF1: + .string "." +.LASF0: + .string "dwarf5b.c" + .ident "GCC: (GNU) 14.2.1 20240906 [releases/gcc-14 r14-10649-gaedf6f810ee]" + .section .note.GNU-stack,"",@progbits diff --git a/ld/testsuite/ld-x86-64/gnu2-tls-1.s b/ld/testsuite/ld-x86-64/gnu2-tls-1.s new file mode 100644 index 0000000..eca788c --- /dev/null +++ b/ld/testsuite/ld-x86-64/gnu2-tls-1.s @@ -0,0 +1,11 @@ + .section .text.startup,"ax",@progbits + .p2align 4 + .globl main + .type main, @function +main: + leaq foo@TLSDESC(%rip), %rax + call *foo@TLSCALL(%rax) + movl %fs:(%rax), %eax + ret + .size main, .-main + .section .note.GNU-stack,"",@progbits diff --git a/ld/testsuite/ld-x86-64/gnu2-tls-1a.rd b/ld/testsuite/ld-x86-64/gnu2-tls-1a.rd new file mode 100644 index 0000000..3eb926a --- /dev/null +++ b/ld/testsuite/ld-x86-64/gnu2-tls-1a.rd @@ -0,0 +1,7 @@ +#... +Version needs section '.gnu.version_r' contains 1 entry: + Addr: 0x[0-9a-f]+ +Offset: 0x[0-9a-f]+ +Link: +[0-9]+ +\(.dynstr\) + +0+: Version: 1 +File: libc\.so\.6(|\.1) +Cnt: +[0-9]+ +#... + 0x[a-f0-9]+: Name: GLIBC_ABI_GNU2_TLS Flags: none Version: [0-9]+ +#pass diff --git a/ld/testsuite/ld-x86-64/gnu2-tls-1b.rd b/ld/testsuite/ld-x86-64/gnu2-tls-1b.rd new file mode 100644 index 0000000..33ef8ac --- /dev/null +++ b/ld/testsuite/ld-x86-64/gnu2-tls-1b.rd @@ -0,0 +1,4 @@ +#failif +#... + 0x[a-f0-9]+: Name: GLIBC_ABI_GNU2_TLS Flags: none Version: [0-9]+ +#... diff --git a/ld/testsuite/ld-x86-64/got-1.s b/ld/testsuite/ld-x86-64/got-1.s new file mode 100644 index 0000000..7637069 --- /dev/null +++ b/ld/testsuite/ld-x86-64/got-1.s @@ -0,0 +1,7 @@ + .text + .globl func + .type func, @function +func: + call *foo@GOTPCREL(%rip) + jmp bar@PLT + .section .note.GNU-stack,"",@progbits diff --git a/ld/testsuite/ld-x86-64/libgot-1a-x32.rd b/ld/testsuite/ld-x86-64/libgot-1a-x32.rd new file mode 100644 index 0000000..6861d65 --- /dev/null +++ b/ld/testsuite/ld-x86-64/libgot-1a-x32.rd @@ -0,0 +1,9 @@ + +Relocation section '.rela.dyn' at offset 0x128 contains 1 entry: + Offset Info Type Sym. Value Symbol's Name \+ Addend +0+200200 00000206 R_X86_64_GLOB_DAT 00000000 foo \+ 0 + +Relocation section '.rela.plt' at offset 0x134 contains 1 entry: + Offset Info Type Sym. Value Symbol's Name \+ Addend +0+200220 00000307 R_X86_64_JUMP_SLOT 00000000 bar \+ 0 +#pass diff --git a/ld/testsuite/ld-x86-64/libgot-1a.rd b/ld/testsuite/ld-x86-64/libgot-1a.rd new file mode 100644 index 0000000..8ed4470 --- /dev/null +++ b/ld/testsuite/ld-x86-64/libgot-1a.rd @@ -0,0 +1,9 @@ + +Relocation section '.rela.dyn' at offset 0x1b8 contains 1 entry: + Offset Info Type Symbol's Value Symbol's Name \+ Addend +0+200340 0000000200000006 R_X86_64_GLOB_DAT 0000000000000000 foo \+ 0 + +Relocation section '.rela.plt' at offset 0x1d0 contains 1 entry: + Offset Info Type Symbol's Value Symbol's Name \+ Addend +0+200360 0000000300000007 R_X86_64_JUMP_SLOT 0000000000000000 bar \+ 0 +#pass diff --git a/ld/testsuite/ld-x86-64/libgot-1b-x32.rd b/ld/testsuite/ld-x86-64/libgot-1b-x32.rd new file mode 100644 index 0000000..f900303 --- /dev/null +++ b/ld/testsuite/ld-x86-64/libgot-1b-x32.rd @@ -0,0 +1,119 @@ +ELF Header: + Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00 + Class: ELF32 + Data: 2's complement, little endian + Version: 1 \(current\) + OS/ABI: UNIX - System V + ABI Version: 0 + Type: DYN \(Shared object file\) + Machine: Advanced Micro Devices X86-64 + Version: 0x1 + Entry point address: 0x0 + Start of program headers: 52 \(bytes into file\) + Start of section headers: 792 \(bytes into file\) + Flags: 0x0 + Size of this header: 52 \(bytes\) + Size of program headers: 32 \(bytes\) + Number of program headers: 4 + Size of section headers: 40 \(bytes\) + Number of section headers: 14 + Section header string table index: 13 + +Section Headers: + \[Nr\] Name Type Addr Off Size ES Flg Lk Inf Al + \[ 0\] NULL 00000000 000000 000000 00 0 0 0 + \[ 1\] .hash HASH 000000b4 0000b4 000024 04 A 2 0 4 + \[ 2\] .dynsym DYNSYM 000000d8 0000d8 000040 10 A 3 1 4 + \[ 3\] .dynstr STRTAB 00000118 000118 00000e 00 A 0 0 1 + \[ 4\] .rela.dyn RELA 00000128 000128 00000c 0c A 2 0 4 + \[ 5\] .rela.plt RELA 00000134 000134 00000c 0c AI 2 10 4 + \[ 6\] .plt PROGBITS 00000140 000140 000020 10 AX 0 0 16 + \[ 7\] .text PROGBITS 00000160 000160 00000b 00 AX 0 0 1 + \[ 8\] .dynamic DYNAMIC 0020016c 00016c 000090 08 WA 3 0 4 + \[ 9\] .got PROGBITS 00200200 000200 000008 08 WA 0 0 8 + \[10\] .got.plt PROGBITS 00200208 000208 000020 08 WA 0 0 8 + \[11\] .symtab SYMTAB 00000000 000228 000060 10 12 3 4 + \[12\] .strtab STRTAB 00000000 000288 00002d 00 0 0 1 + \[13\] .shstrtab STRTAB 00000000 0002b5 000062 00 0 0 1 +Key to Flags: + W \(write\), A \(alloc\), X \(execute\), M \(merge\), S \(strings\), I \(info\), + L \(link order\), O \(extra OS processing required\), G \(group\), T \(TLS\), + C \(compressed\), x \(unknown\), o \(OS specific\), E \(exclude\), + D \(mbind\), l \(large\), p \(processor specific\) + +There are no section groups in this file. + +Program Headers: + Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align + LOAD 0x000000 0x00000000 0x00000000 0x0016b 0x0016b R E 0x200000 + LOAD 0x00016c 0x0020016c 0x0020016c 0x000bc 0x000bc RW 0x200000 + DYNAMIC 0x00016c 0x0020016c 0x0020016c 0x00090 0x00090 RW 0x4 + GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x00000 RW 0x10 + + Section to Segment mapping: + Segment Sections... + 00 .hash .dynsym .dynstr .rela.dyn .rela.plt .plt .text + 01 .dynamic .got .got.plt + 02 .dynamic + 03 + +Dynamic section at offset 0x16c contains 13 entries: + Tag Type Name/Value + 0x00000004 \(HASH\) 0xb4 + 0x00000005 \(STRTAB\) 0x118 + 0x00000006 \(SYMTAB\) 0xd8 + 0x0000000a \(STRSZ\) 14 \(bytes\) + 0x0000000b \(SYMENT\) 16 \(bytes\) + 0x00000003 \(PLTGOT\) 0x200208 + 0x00000002 \(PLTRELSZ\) 12 \(bytes\) + 0x00000014 \(PLTREL\) RELA + 0x00000017 \(JMPREL\) 0x134 + 0x00000007 \(RELA\) 0x128 + 0x00000008 \(RELASZ\) 12 \(bytes\) + 0x00000009 \(RELAENT\) 12 \(bytes\) + 0x00000000 \(NULL\) 0x0 + +Relocation section '.rela.dyn' at offset 0x128 contains 1 entry: + Offset Info Type Sym. Value Symbol's Name \+ Addend +0+200200 00000206 R_X86_64_GLOB_DAT 00000000 foo \+ 0 + +Relocation section '.rela.plt' at offset 0x134 contains 1 entry: + Offset Info Type Sym. Value Symbol's Name \+ Addend +0+200220 00000307 R_X86_64_JUMP_SLOT 00000000 bar \+ 0 +No processor specific unwind information to decode + +Symbol table '.dynsym' contains 4 entries: + Num: Value Size Type Bind Vis Ndx Name + +[a-f0-9]+: 00000000 0 NOTYPE LOCAL DEFAULT UND + +[a-f0-9]+: 00000160 0 FUNC GLOBAL DEFAULT 7 func + +[a-f0-9]+: 00000000 0 NOTYPE GLOBAL DEFAULT UND foo + +[a-f0-9]+: 00000000 0 NOTYPE GLOBAL DEFAULT UND bar + +Symbol table '.symtab' contains 6 entries: + Num: Value Size Type Bind Vis Ndx Name + +[a-f0-9]+: 00000000 0 NOTYPE LOCAL DEFAULT UND + +[a-f0-9]+: 0020016c 0 OBJECT LOCAL DEFAULT 8 _DYNAMIC + +[a-f0-9]+: 00200208 0 OBJECT LOCAL DEFAULT 10 _GLOBAL_OFFSET_TABLE_ + +[a-f0-9]+: 00000160 0 FUNC GLOBAL DEFAULT 7 func + +[a-f0-9]+: 00000000 0 NOTYPE GLOBAL DEFAULT UND foo + +[a-f0-9]+: 00000000 0 NOTYPE GLOBAL DEFAULT UND bar + +Histogram for bucket list length \(total of 3 buckets\): + Length Number % of total Coverage + 0 1 \( 33.3%\) + 1 1 \( 33.3%\) 33.3% + 2 1 \( 33.3%\) 100.0% + +No version information found in this file. + +Global Offset Table '.got' contains 1 entry: + Index: Address Reloc Sym. Name \+ Addend/Value + +[0-9]+: 00200200 R_X86_64_GLOB_DAT foo \+ 0 + +Global Offset Table '.got.plt' contains 4 entries: + Index: Address Reloc Sym. Name \+ Addend/Value + +[0-9]+: 00200208 20016c + +[0-9]+: 00200210 0 + +[0-9]+: 00200218 0 + +[0-9]+: 00200220 R_X86_64_JUMP_SLOT bar \+ 0 +#pass diff --git a/ld/testsuite/ld-x86-64/libgot-1b.rd b/ld/testsuite/ld-x86-64/libgot-1b.rd new file mode 100644 index 0000000..18e4324 --- /dev/null +++ b/ld/testsuite/ld-x86-64/libgot-1b.rd @@ -0,0 +1,119 @@ +ELF Header: + Magic: 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00 + Class: ELF64 + Data: 2's complement, little endian + Version: 1 \(current\) + OS/ABI: UNIX - System V + ABI Version: 0 + Type: DYN \(Shared object file\) + Machine: Advanced Micro Devices X86-64 + Version: 0x1 + Entry point address: 0x0 + Start of program headers: 64 \(bytes into file\) + Start of section headers: 1160 \(bytes into file\) + Flags: 0x0 + Size of this header: 64 \(bytes\) + Size of program headers: 56 \(bytes\) + Number of program headers: 4 + Size of section headers: 64 \(bytes\) + Number of section headers: 14 + Section header string table index: 13 + +Section Headers: + \[Nr\] Name Type Address Off Size ES Flg Lk Inf Al + \[ 0\] NULL 0000000000000000 000000 000000 00 0 0 0 + \[ 1\] .hash HASH 0000000000000120 000120 000024 04 A 2 0 8 + \[ 2\] .dynsym DYNSYM 0000000000000148 000148 000060 18 A 3 1 8 + \[ 3\] .dynstr STRTAB 00000000000001a8 0001a8 00000e 00 A 0 0 1 + \[ 4\] .rela.dyn RELA 00000000000001b8 0001b8 000018 18 A 2 0 8 + \[ 5\] .rela.plt RELA 00000000000001d0 0001d0 000018 18 AI 2 10 8 + \[ 6\] .plt PROGBITS 00000000000001f0 0001f0 000020 10 AX 0 0 16 + \[ 7\] .text PROGBITS 0000000000000210 000210 00000b 00 AX 0 0 1 + \[ 8\] .dynamic DYNAMIC 0000000000200220 000220 000120 10 WA 3 0 8 + \[ 9\] .got PROGBITS 0000000000200340 000340 000008 08 WA 0 0 8 + \[10\] .got.plt PROGBITS 0000000000200348 000348 000020 08 WA 0 0 8 + \[11\] .symtab SYMTAB 0000000000000000 000368 000090 18 12 3 8 + \[12\] .strtab STRTAB 0000000000000000 0003f8 00002d 00 0 0 1 + \[13\] .shstrtab STRTAB 0000000000000000 000425 000062 00 0 0 1 +Key to Flags: + W \(write\), A \(alloc\), X \(execute\), M \(merge\), S \(strings\), I \(info\), + L \(link order\), O \(extra OS processing required\), G \(group\), T \(TLS\), + C \(compressed\), x \(unknown\), o \(OS specific\), E \(exclude\), + D \(mbind\), l \(large\), p \(processor specific\) + +There are no section groups in this file. + +Program Headers: + Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align + LOAD 0x000000 0x0000000000000000 0x0000000000000000 0x00021b 0x00021b R E 0x200000 + LOAD 0x000220 0x0000000000200220 0x0000000000200220 0x000148 0x000148 RW 0x200000 + DYNAMIC 0x000220 0x0000000000200220 0x0000000000200220 0x000120 0x000120 RW 0x8 + GNU_STACK 0x000000 0x0000000000000000 0x0000000000000000 0x000000 0x000000 RW 0x10 + + Section to Segment mapping: + Segment Sections... + 00 .hash .dynsym .dynstr .rela.dyn .rela.plt .plt .text + 01 .dynamic .got .got.plt + 02 .dynamic + 03 + +Dynamic section at offset 0x220 contains 13 entries: + Tag Type Name/Value + 0x0000000000000004 \(HASH\) 0x120 + 0x0000000000000005 \(STRTAB\) 0x1a8 + 0x0000000000000006 \(SYMTAB\) 0x148 + 0x000000000000000a \(STRSZ\) 14 \(bytes\) + 0x000000000000000b \(SYMENT\) 24 \(bytes\) + 0x0000000000000003 \(PLTGOT\) 0x200348 + 0x0000000000000002 \(PLTRELSZ\) 24 \(bytes\) + 0x0000000000000014 \(PLTREL\) RELA + 0x0000000000000017 \(JMPREL\) 0x1d0 + 0x0000000000000007 \(RELA\) 0x1b8 + 0x0000000000000008 \(RELASZ\) 24 \(bytes\) + 0x0000000000000009 \(RELAENT\) 24 \(bytes\) + 0x0000000000000000 \(NULL\) 0x0 + +Relocation section '.rela.dyn' at offset 0x1b8 contains 1 entry: + Offset Info Type Symbol's Value Symbol's Name \+ Addend +0+200340 0000000200000006 R_X86_64_GLOB_DAT 0000000000000000 foo \+ 0 + +Relocation section '.rela.plt' at offset 0x1d0 contains 1 entry: + Offset Info Type Symbol's Value Symbol's Name \+ Addend +0+200360 0000000300000007 R_X86_64_JUMP_SLOT 0000000000000000 bar \+ 0 +No processor specific unwind information to decode + +Symbol table '.dynsym' contains 4 entries: + Num: Value Size Type Bind Vis Ndx Name + +[a-f0-9]+: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND + +[a-f0-9]+: 0000000000000210 0 FUNC GLOBAL DEFAULT 7 func + +[a-f0-9]+: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND foo + +[a-f0-9]+: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND bar + +Symbol table '.symtab' contains 6 entries: + Num: Value Size Type Bind Vis Ndx Name + +[a-f0-9]+: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND + +[a-f0-9]+: 0000000000200220 0 OBJECT LOCAL DEFAULT 8 _DYNAMIC + +[a-f0-9]+: 0000000000200348 0 OBJECT LOCAL DEFAULT 10 _GLOBAL_OFFSET_TABLE_ + +[a-f0-9]+: 0000000000000210 0 FUNC GLOBAL DEFAULT 7 func + +[a-f0-9]+: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND foo + +[a-f0-9]+: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND bar + +Histogram for bucket list length \(total of 3 buckets\): + Length Number % of total Coverage + 0 1 \( 33.3%\) + 1 1 \( 33.3%\) 33.3% + 2 1 \( 33.3%\) 100.0% + +No version information found in this file. + +Global Offset Table '.got' contains 1 entry: + Index: Address Reloc Sym. Name \+ Addend/Value + +[0-9]+: 0000000000200340 R_X86_64_GLOB_DAT foo \+ 0 + +Global Offset Table '.got.plt' contains 4 entries: + Index: Address Reloc Sym. Name \+ Addend/Value + +[0-9]+: 0000000000200348 200220 + +[0-9]+: 0000000000200350 0 + +[0-9]+: 0000000000200358 0 + +[0-9]+: 0000000000200360 R_X86_64_JUMP_SLOT bar \+ 0 +#pass diff --git a/ld/testsuite/ld-x86-64/libgot-1c-x32.rd b/ld/testsuite/ld-x86-64/libgot-1c-x32.rd new file mode 100644 index 0000000..a3bdacf --- /dev/null +++ b/ld/testsuite/ld-x86-64/libgot-1c-x32.rd @@ -0,0 +1,12 @@ + +Global Offset Table '.got' contains 1 entry: + Index: Address Reloc Sym. Name \+ Addend/Value + +[0-9]+: 00200200 R_X86_64_GLOB_DAT foo \+ 0 + +Global Offset Table '.got.plt' contains 4 entries: + Index: Address Reloc Sym. Name \+ Addend/Value + +[0-9]+: 00200208 20016c + +[0-9]+: 00200210 0 + +[0-9]+: 00200218 0 + +[0-9]+: 00200220 R_X86_64_JUMP_SLO bar \+ 0 +#pass diff --git a/ld/testsuite/ld-x86-64/libgot-1c.rd b/ld/testsuite/ld-x86-64/libgot-1c.rd new file mode 100644 index 0000000..fc1a260 --- /dev/null +++ b/ld/testsuite/ld-x86-64/libgot-1c.rd @@ -0,0 +1,12 @@ + +Global Offset Table '.got' contains 1 entry: + Index: Address Reloc Sym. Name \+ Addend/Value + +[0-9]+: 000000200340 R_X86_64_GLOB_DAT foo \+ 0 + +Global Offset Table '.got.plt' contains 4 entries: + Index: Address Reloc Sym. Name \+ Addend/Value + +[0-9]+: 000000200348 200220 + +[0-9]+: 000000200350 0 + +[0-9]+: 000000200358 0 + +[0-9]+: 000000200360 R_X86_64_JUMP_SLO bar \+ 0 +#pass diff --git a/ld/testsuite/ld-x86-64/libgot-1d-x32.rd b/ld/testsuite/ld-x86-64/libgot-1d-x32.rd new file mode 100644 index 0000000..3e2693e --- /dev/null +++ b/ld/testsuite/ld-x86-64/libgot-1d-x32.rd @@ -0,0 +1,12 @@ + +Global Offset Table '.got' contains 1 entry: + Index: Address Reloc Sym. Name \+ Addend/Value + +[0-9]+: 00200200 R_X86_64_GLOB_DAT foo \+ 0 + +Global Offset Table '.got.plt' contains 4 entries: + Index: Address Reloc Sym. Name \+ Addend/Value + +[0-9]+: 00200208 20016c + +[0-9]+: 00200210 0 + +[0-9]+: 00200218 0 + +[0-9]+: 00200220 R_X86_64_JUMP_SLOT bar \+ 0 +#pass diff --git a/ld/testsuite/ld-x86-64/libgot-1d.rd b/ld/testsuite/ld-x86-64/libgot-1d.rd new file mode 100644 index 0000000..341840e --- /dev/null +++ b/ld/testsuite/ld-x86-64/libgot-1d.rd @@ -0,0 +1,12 @@ + +Global Offset Table '.got' contains 1 entry: + Index: Address Reloc Sym. Name \+ Addend/Value + +[0-9]+: 0000000000200340 R_X86_64_GLOB_DAT foo \+ 0 + +Global Offset Table '.got.plt' contains 4 entries: + Index: Address Reloc Sym. Name \+ Addend/Value + +[0-9]+: 0000000000200348 200220 + +[0-9]+: 0000000000200350 0 + +[0-9]+: 0000000000200358 0 + +[0-9]+: 0000000000200360 R_X86_64_JUMP_SLOT bar \+ 0 +#pass diff --git a/ld/testsuite/ld-x86-64/mark-plt-1a.rd b/ld/testsuite/ld-x86-64/mark-plt-1a.rd index 1234fbe..b0ed702 100644 --- a/ld/testsuite/ld-x86-64/mark-plt-1a.rd +++ b/ld/testsuite/ld-x86-64/mark-plt-1a.rd @@ -3,5 +3,5 @@ Version needs section '.gnu.version_r' contains 1 entry: Addr: 0x[0-9a-f]+ +Offset: 0x[0-9a-f]+ +Link: +[0-9]+ +\(.dynstr\) +0+: Version: 1 +File: libc\.so\.6(|\.1) +Cnt: +[0-9]+ #... - 0x[a-f0-9]+: Name: GLIBC_2.36 Flags: none Version: [0-9]+ + 0x[a-f0-9]+: Name: (GLIBC_2.36|GLIBC_ABI_DT_X86_64_PLT) Flags: none Version: [0-9]+ #pass diff --git a/ld/testsuite/ld-x86-64/mark-plt-2.rd b/ld/testsuite/ld-x86-64/mark-plt-2.rd new file mode 100644 index 0000000..b0ed702 --- /dev/null +++ b/ld/testsuite/ld-x86-64/mark-plt-2.rd @@ -0,0 +1,7 @@ +#... +Version needs section '.gnu.version_r' contains 1 entry: + Addr: 0x[0-9a-f]+ +Offset: 0x[0-9a-f]+ +Link: +[0-9]+ +\(.dynstr\) + +0+: Version: 1 +File: libc\.so\.6(|\.1) +Cnt: +[0-9]+ +#... + 0x[a-f0-9]+: Name: (GLIBC_2.36|GLIBC_ABI_DT_X86_64_PLT) Flags: none Version: [0-9]+ +#pass diff --git a/ld/testsuite/ld-x86-64/mark-plt-2.s b/ld/testsuite/ld-x86-64/mark-plt-2.s new file mode 100644 index 0000000..c816567 --- /dev/null +++ b/ld/testsuite/ld-x86-64/mark-plt-2.s @@ -0,0 +1,13 @@ + .text + .globl foo + .type foo, @function +foo: + subq $8, %rsp + leaq xxx@TLSDESC(%rip), %rax + .nops 10 + call *xxx@TLSCALL(%rax) + movl %fs:(%rax), %eax + addq $8, %rsp + call bar + ret + .section .note.GNU-stack,"",@progbits diff --git a/ld/testsuite/ld-x86-64/no-plt-1a.dd b/ld/testsuite/ld-x86-64/no-plt-1a.dd index b1d5d7e..89bfaa1 100644 --- a/ld/testsuite/ld-x86-64/no-plt-1a.dd +++ b/ld/testsuite/ld-x86-64/no-plt-1a.dd @@ -10,8 +10,9 @@ Disassembly of section .text: +[a-f0-9]+: 48 83 ec 08 sub \$0x8,%rsp +[a-f0-9]+: 67 e8 ([0-9a-f]{2} ){4}[ ]+addr32 call [0-9a-f]+ <get_func> +[a-f0-9]+: 48 81 f8 ([0-9a-f]{2} ){4}[ ]+cmp \$0x[0-9a-f]+,%rax - +[a-f0-9]+: 75 34 jne [0-9a-f]+ <check\+0x[0-9a-f]+> - +[a-f0-9]+: 4(0|8) 39 05 ([0-9a-f]{2} ){4}[ ]+(rex |)cmp +%(e|r)ax,0x[0-9a-f]+\(%rip\) +# [a-f0-9]+ <func_p> + +[a-f0-9]+: 75 37 jne [0-9a-f]+ <check\+0x[0-9a-f]+> + +[a-f0-9]+: 4(0|8) c7 c2 ([0-9a-f]{2} ){4}[ ]+(rex |)mov +\$0x[0-9a-f]+,%(e|r)dx + +[a-f0-9]+: (48|67) 39 02[ ]+cmp +%(e|r)ax,\(%(e|r)dx\) +[a-f0-9]+: 75 2b jne [0-9a-f]+ <check\+0x[0-9a-f]+> +[a-f0-9]+: 67 e8 ([0-9a-f]{2} ){4}[ ]+addr32 call [0-9a-f]+ <func> +[a-f0-9]+: 3d 78 56 34 12 cmp \$0x12345678,%eax diff --git a/ld/testsuite/ld-x86-64/no-plt-1b.dd b/ld/testsuite/ld-x86-64/no-plt-1b.dd index 2ab8da5..1f430b8 100644 --- a/ld/testsuite/ld-x86-64/no-plt-1b.dd +++ b/ld/testsuite/ld-x86-64/no-plt-1b.dd @@ -10,8 +10,9 @@ Disassembly of section .text: +[a-f0-9]+: 48 83 ec 08 sub \$0x8,%rsp +[a-f0-9]+: ff 15 ([0-9a-f]{2} ){4}[ ]+call \*0x[0-9a-f]+\(%rip\) +# [0-9a-f]+ <.*> +[a-f0-9]+: 48 3b 05 ([0-9a-f]{2} ){4}[ ]+cmp 0x[0-9a-f]+\(%rip\),%rax +# [0-9a-f]+ <.*> - +[a-f0-9]+: 75 34 jne [0-9a-f]+ <check\+0x[0-9a-f]+> - +[a-f0-9]+: 4(0|8) 39 05 ([0-9a-f]{2} ){4}[ ]+(rex |)cmp +%(e|r)ax,0x[0-9a-f]+\(%rip\) +# [a-f0-9]+ <.*> + +[a-f0-9]+: 75 37 jne [0-9a-f]+ <check\+0x[0-9a-f]+> + +[a-f0-9]+: 4(0|8) 8b 15 ([0-9a-f]{2} ){4}[ ]+(rex |)mov +0x[0-9a-f]+\(%rip\),%(e|r)dx +# [a-f0-9]+ <.*> + +[a-f0-9]+: (48|67) 39 02[ ]+cmp +%(e|r)ax,\(%(e|r)dx\) +[a-f0-9]+: 75 2b jne [0-9a-f]+ <check\+0x[0-9a-f]+> +[a-f0-9]+: ff 15 ([0-9a-f]{2} ){4}[ ]+call \*0x[0-9a-f]+\(%rip\) +# [0-9a-f]+ <.*> +[a-f0-9]+: 3d 78 56 34 12 cmp \$0x12345678,%eax diff --git a/ld/testsuite/ld-x86-64/no-plt-1c.dd b/ld/testsuite/ld-x86-64/no-plt-1c.dd index 1f6ea27..ef772af 100644 --- a/ld/testsuite/ld-x86-64/no-plt-1c.dd +++ b/ld/testsuite/ld-x86-64/no-plt-1c.dd @@ -10,8 +10,9 @@ Disassembly of section .text: +[a-f0-9]+: 48 83 ec 08 sub \$0x8,%rsp +[a-f0-9]+: ff 15 ([0-9a-f]{2} ){4}[ ]+call \*0x[0-9a-f]+\(%rip\) +# [0-9a-f]+ <.*> +[a-f0-9]+: 48 81 f8 ([0-9a-f]{2} ){4}[ ]+cmp \$0x[0-9a-f]+,%rax - +[a-f0-9]+: 75 34 jne [0-9a-f]+ <check\+0x[0-9a-f]+> - +[a-f0-9]+: 4(0|8) 39 05 ([0-9a-f]{2} ){4}[ ]+(rex |)cmp +%(e|r)ax,0x[0-9a-f]+\(%rip\) +# [a-f0-9]+ <.*> + +[a-f0-9]+: 75 37 jne [0-9a-f]+ <check\+0x[0-9a-f]+> + +[a-f0-9]+: 4(0|8) 8b 15 ([0-9a-f]{2} ){4}[ ]+(rex |)mov +0x[0-9a-f]+\(%rip\),%(e|r)dx +# [a-f0-9]+ <.*> + +[a-f0-9]+: (48|67) 39 02[ ]+cmp +%(e|r)ax,\(%(e|r)dx\) +[a-f0-9]+: 75 2b jne [0-9a-f]+ <check\+0x[0-9a-f]+> +[a-f0-9]+: 67 e8 ([0-9a-f]{2} ){4}[ ]+addr32 call [0-9a-f]+ <func> +[a-f0-9]+: 3d 78 56 34 12 cmp \$0x12345678,%eax diff --git a/ld/testsuite/ld-x86-64/no-plt-1d.dd b/ld/testsuite/ld-x86-64/no-plt-1d.dd index 49f34ad..cd500bd 100644 --- a/ld/testsuite/ld-x86-64/no-plt-1d.dd +++ b/ld/testsuite/ld-x86-64/no-plt-1d.dd @@ -10,8 +10,9 @@ Disassembly of section .text: +[a-f0-9]+: 48 83 ec 08 sub \$0x8,%rsp +[a-f0-9]+: 67 e8 ([0-9a-f]{2} ){4}[ ]+addr32 call [0-9a-f]+ <get_func> +[a-f0-9]+: 48 81 f8 ([0-9a-f]{2} ){4}[ ]+cmp \$0x[0-9a-f]+,%rax - +[a-f0-9]+: 75 34 jne [0-9a-f]+ <check\+0x[0-9a-f]+> - +[a-f0-9]+: 4(0|8) 39 05 ([0-9a-f]{2} ){4}[ ]+(rex |)cmp +%(e|r)ax,0x[0-9a-f]+\(%rip\) +# [a-f0-9]+ <func_p> + +[a-f0-9]+: 75 37 jne [0-9a-f]+ <check\+0x[0-9a-f]+> + +[a-f0-9]+: 4(0|8) c7 c2 ([0-9a-f]{2} ){4}[ ]+(rex |)mov +\$0x[0-9a-f]+,%(e|r)dx + +[a-f0-9]+: (48|67) 39 02[ ]+cmp +%(e|r)ax,\(%(e|r)dx\) +[a-f0-9]+: 75 2b jne [0-9a-f]+ <check\+0x[0-9a-f]+> +[a-f0-9]+: 67 e8 ([0-9a-f]{2} ){4}[ ]+addr32 call [0-9a-f]+ <func> +[a-f0-9]+: 3d 78 56 34 12 cmp \$0x12345678,%eax diff --git a/ld/testsuite/ld-x86-64/no-plt-1e.dd b/ld/testsuite/ld-x86-64/no-plt-1e.dd index 465574f..0180dd3 100644 --- a/ld/testsuite/ld-x86-64/no-plt-1e.dd +++ b/ld/testsuite/ld-x86-64/no-plt-1e.dd @@ -10,8 +10,9 @@ Disassembly of section .text: +[a-f0-9]+: 48 83 ec 08 sub \$0x8,%rsp +[a-f0-9]+: 67 e8 ([0-9a-f]{2} ){4}[ ]+addr32 call [0-9a-f]+ <get_func> +[a-f0-9]+: 48 3b 05 ([0-9a-f]{2} ){4}[ ]+cmp 0x[0-9a-f]+\(%rip\),%rax +# [0-9a-f]+ <.*> - +[a-f0-9]+: 75 34 jne [0-9a-f]+ <check\+0x[0-9a-f]+> - +[a-f0-9]+: 4(0|8) 39 05 ([0-9a-f]{2} ){4}[ ]+(rex |)cmp +%(e|r)ax,0x[0-9a-f]+\(%rip\) +# [a-f0-9]+ <func_p> + +[a-f0-9]+: 75 37 jne [0-9a-f]+ <check\+0x[0-9a-f]+> + +[a-f0-9]+: 4(0|8) 8d 15 ([0-9a-f]{2} ){4}[ ]+(rex |)lea +0x[0-9a-f]+\(%rip\),%(e|r)dx +# [a-f0-9]+ <func_p> + +[a-f0-9]+: (48|67) 39 02[ ]+cmp +%(e|r)ax,\(%(e|r)dx\) +[a-f0-9]+: 75 2b jne [0-9a-f]+ <check\+0x[0-9a-f]+> +[a-f0-9]+: 67 e8 ([0-9a-f]{2} ){4}[ ]+addr32 call [0-9a-f]+ <func> +[a-f0-9]+: 3d 78 56 34 12 cmp \$0x12345678,%eax diff --git a/ld/testsuite/ld-x86-64/no-plt-1f.dd b/ld/testsuite/ld-x86-64/no-plt-1f.dd index 2ab8da5..1f430b8 100644 --- a/ld/testsuite/ld-x86-64/no-plt-1f.dd +++ b/ld/testsuite/ld-x86-64/no-plt-1f.dd @@ -10,8 +10,9 @@ Disassembly of section .text: +[a-f0-9]+: 48 83 ec 08 sub \$0x8,%rsp +[a-f0-9]+: ff 15 ([0-9a-f]{2} ){4}[ ]+call \*0x[0-9a-f]+\(%rip\) +# [0-9a-f]+ <.*> +[a-f0-9]+: 48 3b 05 ([0-9a-f]{2} ){4}[ ]+cmp 0x[0-9a-f]+\(%rip\),%rax +# [0-9a-f]+ <.*> - +[a-f0-9]+: 75 34 jne [0-9a-f]+ <check\+0x[0-9a-f]+> - +[a-f0-9]+: 4(0|8) 39 05 ([0-9a-f]{2} ){4}[ ]+(rex |)cmp +%(e|r)ax,0x[0-9a-f]+\(%rip\) +# [a-f0-9]+ <.*> + +[a-f0-9]+: 75 37 jne [0-9a-f]+ <check\+0x[0-9a-f]+> + +[a-f0-9]+: 4(0|8) 8b 15 ([0-9a-f]{2} ){4}[ ]+(rex |)mov +0x[0-9a-f]+\(%rip\),%(e|r)dx +# [a-f0-9]+ <.*> + +[a-f0-9]+: (48|67) 39 02[ ]+cmp +%(e|r)ax,\(%(e|r)dx\) +[a-f0-9]+: 75 2b jne [0-9a-f]+ <check\+0x[0-9a-f]+> +[a-f0-9]+: ff 15 ([0-9a-f]{2} ){4}[ ]+call \*0x[0-9a-f]+\(%rip\) +# [0-9a-f]+ <.*> +[a-f0-9]+: 3d 78 56 34 12 cmp \$0x12345678,%eax diff --git a/ld/testsuite/ld-x86-64/no-plt-1g.dd b/ld/testsuite/ld-x86-64/no-plt-1g.dd index 0526fb0..b6adc0d 100644 --- a/ld/testsuite/ld-x86-64/no-plt-1g.dd +++ b/ld/testsuite/ld-x86-64/no-plt-1g.dd @@ -10,8 +10,9 @@ Disassembly of section .text: +[a-f0-9]+: 48 83 ec 08 sub \$0x8,%rsp +[a-f0-9]+: ff 15 ([0-9a-f]{2} ){4}[ ]+call \*0x[0-9a-f]+\(%rip\) +# [0-9a-f]+ <.*> +[a-f0-9]+: 48 3b 05 ([0-9a-f]{2} ){4}[ ]+cmp 0x[0-9a-f]+\(%rip\),%rax +# [0-9a-f]+ <.*> - +[a-f0-9]+: 75 34 jne [0-9a-f]+ <check\+0x[0-9a-f]+> - +[a-f0-9]+: 4(0|8) 39 05 ([0-9a-f]{2} ){4}[ ]+(rex |)cmp +%(e|r)ax,0x[0-9a-f]+\(%rip\) +# [a-f0-9]+ <.*> + +[a-f0-9]+: 75 37 jne [0-9a-f]+ <check\+0x[0-9a-f]+> + +[a-f0-9]+: 4(0|8) 8b 15 ([0-9a-f]{2} ){4}[ ]+(rex |)mov +0x[0-9a-f]+\(%rip\),%(e|r)dx +# [a-f0-9]+ <.*> + +[a-f0-9]+: (48|67) 39 02[ ]+cmp +%(e|r)ax,\(%(e|r)dx\) +[a-f0-9]+: 75 2b jne [0-9a-f]+ <check\+0x[0-9a-f]+> +[a-f0-9]+: 67 e8 ([0-9a-f]{2} ){4}[ ]+addr32 call [0-9a-f]+ <func> +[a-f0-9]+: 3d 78 56 34 12 cmp \$0x12345678,%eax diff --git a/ld/testsuite/ld-x86-64/no-plt-check1.S b/ld/testsuite/ld-x86-64/no-plt-check1.S index 61d32b1..4526e5e 100644 --- a/ld/testsuite/ld-x86-64/no-plt-check1.S +++ b/ld/testsuite/ld-x86-64/no-plt-check1.S @@ -11,10 +11,12 @@ check: cmpq func@GOTPCREL(%rip), %rax jne .L3 #ifdef __LP64__ - cmpq %rax, func_p(%rip) + movq func_p@GOTPCREL(%rip), %rdx + cmpq %rax, (%rdx) #else rex - cmpl %eax, func_p(%rip) + movl func_p@GOTPCREL(%rip), %edx + cmpl %eax, (%edx) #endif jne .L3 call *func@GOTPCREL(%rip) diff --git a/ld/testsuite/ld-x86-64/no-plt.exp b/ld/testsuite/ld-x86-64/no-plt.exp index e78d09a..eb63670 100644 --- a/ld/testsuite/ld-x86-64/no-plt.exp +++ b/ld/testsuite/ld-x86-64/no-plt.exp @@ -70,7 +70,7 @@ run_cc_link_tests [list \ "libno-plt-1b.so" \ ] \ [list \ - "No PLT (dynamic 1a)" \ + "Build no PLT (dynamic 1a)" \ "$NOPIE_LDFLAGS tmpdir/no-plt-check1.o tmpdir/no-plt-main1.o \ tmpdir/no-plt-func1.o tmpdir/no-plt-extern1.o" \ "-Wa,-mx86-used-note=yes" \ @@ -79,7 +79,7 @@ run_cc_link_tests [list \ "no-plt-1a" \ ] \ [list \ - "No PLT (dynamic 1b)" \ + "Build no PLT (dynamic 1b)" \ "tmpdir/no-plt-check1.o tmpdir/no-plt-main1.o \ tmpdir/libno-plt-1a.so tmpdir/libno-plt-1b.so" \ "-Wa,-mx86-used-note=yes" \ @@ -88,7 +88,7 @@ run_cc_link_tests [list \ "no-plt-1b" \ ] \ [list \ - "No PLT (dynamic 1c)" \ + "Build no PLT (dynamic 1c)" \ "$NOPIE_LDFLAGS tmpdir/no-plt-check1.o tmpdir/no-plt-main1.o \ tmpdir/no-plt-func1.o tmpdir/libno-plt-1b.so" \ "-Wa,-mx86-used-note=yes" \ @@ -97,7 +97,7 @@ run_cc_link_tests [list \ "no-plt-1c" \ ] \ [list \ - "No PLT (static 1d)" \ + "Build no PLT (static 1d)" \ "-static tmpdir/no-plt-check1.o tmpdir/no-plt-main1.o \ tmpdir/no-plt-func1.o tmpdir/no-plt-extern1.o" \ "-Wa,-mx86-used-note=yes" \ @@ -106,7 +106,7 @@ run_cc_link_tests [list \ "no-plt-1d" \ ] \ [list \ - "No PLT (PIE 1e)" \ + "Build no PLT (PIE 1e)" \ "-pie tmpdir/no-plt-check1.o tmpdir/no-plt-main1.o \ tmpdir/no-plt-func1.o tmpdir/no-plt-extern1.o" \ "-Wa,-mx86-used-note=yes" \ @@ -115,7 +115,7 @@ run_cc_link_tests [list \ "no-plt-1e" \ ] \ [list \ - "No PLT (PIE 1f)" \ + "Build no PLT (PIE 1f)" \ "-pie tmpdir/no-plt-check1.o tmpdir/no-plt-main1.o \ tmpdir/libno-plt-1a.so tmpdir/libno-plt-1b.so" \ "-Wa,-mx86-used-note=yes" \ @@ -124,7 +124,7 @@ run_cc_link_tests [list \ "no-plt-1f" \ ] \ [list \ - "No PLT (PIE 1g)" \ + "Build no PLT (PIE 1g)" \ "-pie tmpdir/no-plt-check1.o tmpdir/no-plt-main1.o \ tmpdir/no-plt-func1.o tmpdir/libno-plt-1b.so" \ "-Wa,-mx86-used-note=yes" \ @@ -136,7 +136,7 @@ run_cc_link_tests [list \ run_ld_link_exec_tests [list \ [list \ - "No PLT (dynamic 1a)" \ + "Run no PLT (dynamic 1a)" \ "tmpdir/no-plt-check1.o tmpdir/no-plt-main1.o \ tmpdir/no-plt-func1.o tmpdir/no-plt-extern1.o" \ "-Wa,-mx86-used-note=yes" \ @@ -145,7 +145,7 @@ run_ld_link_exec_tests [list \ "pass.out" \ ] \ [list \ - "No PLT (dynamic 1b)" \ + "Run no PLT (dynamic 1b)" \ "tmpdir/no-plt-check1.o tmpdir/no-plt-main1.o \ tmpdir/libno-plt-1a.so tmpdir/libno-plt-1b.so" \ "-Wa,-mx86-used-note=yes" \ @@ -154,7 +154,7 @@ run_ld_link_exec_tests [list \ "pass.out" \ ] \ [list \ - "No PLT (dynamic 1c)" \ + "Run no PLT (dynamic 1c)" \ "tmpdir/no-plt-check1.o tmpdir/no-plt-main1.o \ tmpdir/no-plt-func1.o tmpdir/libno-plt-1b.so" \ "-Wa,-mx86-used-note=yes" \ @@ -163,7 +163,7 @@ run_ld_link_exec_tests [list \ "pass.out" \ ] \ [list \ - "No PLT (static 1d)" \ + "Run no PLT (static 1d)" \ "-static tmpdir/no-plt-check1.o tmpdir/no-plt-main1.o \ tmpdir/no-plt-func1.o tmpdir/no-plt-extern1.o" \ "-Wa,-mx86-used-note=yes" \ @@ -172,7 +172,7 @@ run_ld_link_exec_tests [list \ "pass.out" \ ] \ [list \ - "No PLT (PIE 1e)" \ + "Run no PLT (PIE 1e)" \ "-pie tmpdir/no-plt-check1.o tmpdir/no-plt-main1.o \ tmpdir/no-plt-func1.o tmpdir/no-plt-extern1.o" \ "-Wa,-mx86-used-note=yes" \ @@ -181,7 +181,7 @@ run_ld_link_exec_tests [list \ "pass.out" \ ] \ [list \ - "No PLT (PIE 1f)" \ + "Run no PLT (PIE 1f)" \ "-pie tmpdir/no-plt-check1.o tmpdir/no-plt-main1.o \ tmpdir/libno-plt-1a.so tmpdir/libno-plt-1b.so" \ "-Wa,-mx86-used-note=yes" \ @@ -190,7 +190,7 @@ run_ld_link_exec_tests [list \ "pass.out" \ ] \ [list \ - "No PLT (PIE 1g)" \ + "Run no PLT (PIE 1g)" \ "-pie tmpdir/no-plt-check1.o tmpdir/no-plt-main1.o \ tmpdir/no-plt-func1.o tmpdir/libno-plt-1b.so" \ "-Wa,-mx86-used-note=yes" \ diff --git a/ld/testsuite/ld-x86-64/pr28387-x32.d b/ld/testsuite/ld-x86-64/pr28387-x32.d new file mode 100644 index 0000000..0302126 --- /dev/null +++ b/ld/testsuite/ld-x86-64/pr28387-x32.d @@ -0,0 +1,36 @@ +#source: pr28387.s +#as: --x32 +#ld: -shared -melf32_x86_64 -z nocombreloc -z nomark-plt -z noseparate-code -z max-page-size=0x200000 --no-ld-generated-unwind-info --hash-style=sysv +#readelf: -d -r -S --wide + +There are [0-9]+ section headers, starting at offset 0x[0-9a-f]+: + +Section Headers: + +\[Nr\] Name +Type +Addr +Off +Size +ES Flg Lk Inf Al +#... + +\[[ 0-9]+\] .rela.data +RELA +0+128 0+128 0+c 0c +AI +2 +12 +4 + +\[[ 0-9]+\] .rela.tls +RELA +0+134 0+134 0+c 0c +AI +2 +11 +4 + +\[[ 0-9]+\] .rela.plt +RELA +0+140 0+140 0+c 0c +AI +2 +11 +4 +#... +Dynamic section at offset 0x[0-9a-f]+ contains [0-9]+ entries: + +Tag +Type +Name/Value +#... + 0x[0-9a-f]+ +\(PLTRELSZ\) +12 \(bytes\) + 0x[0-9a-f]+ +\(PLTREL\) +RELA + 0x[0-9a-f]+ +\(JMPREL\) +0x140 +#... + 0x[0-9a-f]+ +\(RELA\) +0x128 + 0x[0-9a-f]+ +\(RELASZ\) +24 \(bytes\) + 0x[0-9a-f]+ +\(RELAENT\) +12 \(bytes\) +#... +Relocation section '.rela.data' at offset 0x[0-9a-f]+ contains 1 entry: + +Offset +Info +Type +Sym.* Value +Symbol's Name \+ Addend +[0-9a-f]+ +[0-9a-f]+ +R_X86_64_32 +0+ +foo \+ 0 + +Relocation section '.rela.tls' at offset 0x[0-9a-f]+ contains 1 entry: + +Offset +Info +Type +Sym.* Value +Symbol's Name \+ Addend +[0-9a-f]+ +[0-9a-f]+ +R_X86_64_TLSDESC +0+ +foo \+ 0 + +Relocation section '.rela.plt' at offset 0x[0-9a-f]+ contains 1 entry: + +Offset +Info +Type +Sym.* Value +Symbol's Name \+ Addend +[0-9a-f]+ +[0-9a-f]+ +R_X86_64_JUMP_SLOT +0+ +bar \+ 0 diff --git a/ld/testsuite/ld-x86-64/pr28387.d b/ld/testsuite/ld-x86-64/pr28387.d new file mode 100644 index 0000000..07df0fb --- /dev/null +++ b/ld/testsuite/ld-x86-64/pr28387.d @@ -0,0 +1,35 @@ +#as: --64 +#ld: -shared -melf_x86_64 -z nocombreloc -z nomark-plt -z noseparate-code -z max-page-size=0x200000 --no-ld-generated-unwind-info --hash-style=sysv +#readelf: -d -r -S --wide + +There are [0-9]+ section headers, starting at offset 0x[0-9a-f]+: + +Section Headers: + +\[Nr\] Name +Type +Address +Off +Size +ES Flg Lk Inf Al +#... + +\[[ 0-9]+\] .rela.data +RELA +0+1b8 0+1b8 0+18 18 +AI +2 +12 +8 + +\[[ 0-9]+\] .rela.tls +RELA +0+1d0 0+1d0 0+18 18 +AI +2 +11 +8 + +\[[ 0-9]+\] .rela.plt +RELA +0+1e8 0+1e8 0+18 18 +AI +2 +11 +8 +#... +Dynamic section at offset 0x[0-9a-f]+ contains [0-9]+ entries: + +Tag +Type +Name/Value +#... + 0x[0-9a-f]+ +\(PLTRELSZ\) +24 \(bytes\) + 0x[0-9a-f]+ +\(PLTREL\) +RELA + 0x[0-9a-f]+ +\(JMPREL\) +0x1e8 +#... + 0x[0-9a-f]+ +\(RELA\) +0x1b8 + 0x[0-9a-f]+ +\(RELASZ\) +48 \(bytes\) + 0x[0-9a-f]+ +\(RELAENT\) +24 \(bytes\) +#... +Relocation section '.rela.data' at offset 0x[0-9a-f]+ contains 1 entry: + +Offset +Info +Type +Sym.* Value +Symbol's Name \+ Addend +[0-9a-f]+ +[0-9a-f]+ +R_X86_64_64 +0+ +foo \+ 0 + +Relocation section '.rela.tls' at offset 0x[0-9a-f]+ contains 1 entry: + +Offset +Info +Type +Sym.* Value +Symbol's Name \+ Addend +[0-9a-f]+ +[0-9a-f]+ +R_X86_64_TLSDESC +0+ +foo \+ 0 + +Relocation section '.rela.plt' at offset 0x[0-9a-f]+ contains 1 entry: + +Offset +Info +Type +Sym.* Value +Symbol's Name \+ Addend +[0-9a-f]+ +[0-9a-f]+ +R_X86_64_JUMP_SLOT +0+ +bar \+ 0 diff --git a/ld/testsuite/ld-x86-64/pr28387.s b/ld/testsuite/ld-x86-64/pr28387.s new file mode 100644 index 0000000..bbfa7b5 --- /dev/null +++ b/ld/testsuite/ld-x86-64/pr28387.s @@ -0,0 +1,11 @@ + .text + .globl main + .type main, @function +main: + leaq foo@TLSDESC(%rip), %rax + call *foo@TLSCALL(%rax) + call bar@PLT + ret + .data + .dc.a foo + .section .note.GNU-stack,"",@progbits diff --git a/ld/testsuite/ld-x86-64/pr32809.d b/ld/testsuite/ld-x86-64/pr32809.d new file mode 100644 index 0000000..3affc23 --- /dev/null +++ b/ld/testsuite/ld-x86-64/pr32809.d @@ -0,0 +1,71 @@ +#source: dwarf5a.s +#source: dwarf4.s +#source: dwarf5b.s +#as: --64 +#ld: -r -m elf_x86_64 +#readelf: --wide --debug-dump=loc + +Contents of the .*ebug_loc section: + + Offset Begin End Expression + + 00000000 v000000000000000 v000000000000000 location view pair + 00000002 v000000000000000 v000000000000000 location view pair + + 00000004 v000000000000000 v000000000000000 views at 00000000 for: + 0000000000000000 000000000000000a \(DW_OP_reg5 \(rdi\)\) + 00000017 v000000000000000 v000000000000000 views at 00000002 for: + 000000000000000a 0000000000000016 \(DW_OP_GNU_entry_value: \(DW_OP_reg5 \(rdi\)\); DW_OP_stack_value\) + 0000002d <End of list> + + 0000003d v000000000000002 v000000000000000 location view pair + 0000003f v000000000000000 v000000000000001 location view pair + 00000041 v000000000000001 v000000000000000 location view pair + + 00000043 v000000000000002 v000000000000000 views at 0000003d for: + 0000000000000000 000000000000000a \(DW_OP_reg5 \(rdi\)\) + 00000056 v000000000000000 v000000000000001 views at 0000003f for: + 000000000000000a 000000000000000b \(DW_OP_GNU_entry_value: \(DW_OP_reg5 \(rdi\)\); DW_OP_stack_value\) + 0000006c v000000000000001 v000000000000000 views at 00000041 for: + 000000000000000b 0000000000000016 \(DW_OP_const1u: 123; DW_OP_stack_value\) + 00000081 <End of list> + +Contents of the .*ebug_loclists section: + +Table at Offset 0 + Length: 0x34 + DWARF version: 5 + Address size: 8 + Segment size: 0 + Offset entries: 0 + + Offset Begin End Expression + + 0000000c v000000000000002 v000000000000000 location view pair + 0000000e v000000000000001 v000000000000001 location view pair + 00000010 v000000000000001 v000000000000000 location view pair + + 00000012 0000000000000000 \(base address\) + 0000001b v000000000000002 v000000000000000 views at 0000000c for: + 0000000000000000 000000000000000d \(DW_OP_addr: 0\) + 00000028 v000000000000001 v000000000000001 views at 0000000e for: + 000000000000000e 0000000000000018 \(DW_OP_const1u: 123; DW_OP_stack_value\) + 0000002f v000000000000001 v000000000000000 views at 00000010 for: + 0000000000000018 000000000000001f \(DW_OP_const2u: 456; DW_OP_stack_value\) + 00000037 <End of list> +Table at Offset 0x38 + Length: 0x12 + DWARF version: 5 + Address size: 8 + Segment size: 0 + Offset entries: 0 + + Offset Begin End Expression + + 00000044 v000000000000001 v000000000000000 location view pair + + 00000046 v000000000000001 v000000000000000 views at 00000044 for: + 000000000000002f 000000000000003d \(DW_OP_const1u: 123; DW_OP_stack_value\) + 0000004d <End of list> + +#pass diff --git a/ld/testsuite/ld-x86-64/pr33260-2-x32.d b/ld/testsuite/ld-x86-64/pr33260-2-x32.d new file mode 100644 index 0000000..383129a --- /dev/null +++ b/ld/testsuite/ld-x86-64/pr33260-2-x32.d @@ -0,0 +1,6 @@ +#source: pr33260-2.s +#as: -mrelax-relocations=yes --x32 +#ld: -melf32_x86_64 -shared +#readelf: -r --wide + +There are no relocations in this file. diff --git a/ld/testsuite/ld-x86-64/pr33260-2.d b/ld/testsuite/ld-x86-64/pr33260-2.d new file mode 100644 index 0000000..7f237c8 --- /dev/null +++ b/ld/testsuite/ld-x86-64/pr33260-2.d @@ -0,0 +1,6 @@ +#source: pr33260-2.s +#as: -mrelax-relocations=yes --64 +#ld: -melf_x86_64 -shared +#readelf: -r --wide + +There are no relocations in this file. diff --git a/ld/testsuite/ld-x86-64/pr33260-2.s b/ld/testsuite/ld-x86-64/pr33260-2.s new file mode 100644 index 0000000..061137d --- /dev/null +++ b/ld/testsuite/ld-x86-64/pr33260-2.s @@ -0,0 +1,19 @@ + .text + .p2align 4 + .globl my_func + .type my_func, @function +my_func: + .cfi_startproc + movq my_data@GOTPCREL(%rip), %rax + ret + .cfi_endproc + .size my_func, .-my_func + .protected my_data + .globl my_data + .bss + .align 4 + .type my_data, @object + .size my_data, 4 +my_data: + .zero 4 + .section .note.GNU-stack,"",@progbits diff --git a/ld/testsuite/ld-x86-64/pr33260-x32.d b/ld/testsuite/ld-x86-64/pr33260-x32.d new file mode 100644 index 0000000..42088fb --- /dev/null +++ b/ld/testsuite/ld-x86-64/pr33260-x32.d @@ -0,0 +1,9 @@ +#source: pr33260.s +#as: -mrelax-relocations=yes --x32 +#ld: -melf32_x86_64 -shared +#readelf: -r --wide + +Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 2 entries: + +Offset +Info +Type +Sym.* Value +Symbol's Name \+ Addend +[0-9a-f]+ +[0-9a-f]+ +R_X86_64_RELATIVE +[0-9a-f]+ +[0-9a-f]+ +[0-9a-f]+ +R_X86_64_RELATIVE +[0-9a-f]+ diff --git a/ld/testsuite/ld-x86-64/pr33260.d b/ld/testsuite/ld-x86-64/pr33260.d new file mode 100644 index 0000000..18b5472 --- /dev/null +++ b/ld/testsuite/ld-x86-64/pr33260.d @@ -0,0 +1,9 @@ +#source: pr33260.s +#as: -mrelax-relocations=yes --64 -defsym __x86_64__=1 +#ld: -melf_x86_64 -shared +#readelf: -r --wide + +Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 2 entries: + +Offset +Info +Type +Sym.* Value +Symbol's Name \+ Addend +[0-9a-f]+ +[0-9a-f]+ +R_X86_64_RELATIVE +[0-9a-f]+ +[0-9a-f]+ +[0-9a-f]+ +R_X86_64_RELATIVE +[0-9a-f]+ diff --git a/ld/testsuite/ld-x86-64/pr33260.s b/ld/testsuite/ld-x86-64/pr33260.s new file mode 100644 index 0000000..e48c3ce --- /dev/null +++ b/ld/testsuite/ld-x86-64/pr33260.s @@ -0,0 +1,40 @@ + .text + .p2align 4 + .globl my_func + .protected my_func + .type my_func, @function +my_func: + .cfi_startproc + ret + .cfi_endproc + .size my_func, .-my_func + .p2align 4 + .globl f + .type f, @function +f: + .cfi_startproc + leaq vtable(%rip), %rax + ret + .cfi_endproc + .size f, .-f + .section .data.rel,"aw" + .type vtable, @object +.ifdef __x86_64__ + .align 16 + .size vtable, 16 +.else + .align 8 + .size vtable, 8 +.endif +vtable: + .dc.a my_func + .dc.a my_data + .protected my_data + .globl my_data + .bss + .align 4 + .type my_data, @object + .size my_data, 4 +my_data: + .zero 4 + .section .note.GNU-stack,"",@progbits diff --git a/ld/testsuite/ld-x86-64/pr33292-x32.d b/ld/testsuite/ld-x86-64/pr33292-x32.d new file mode 100644 index 0000000..0d6cf81 --- /dev/null +++ b/ld/testsuite/ld-x86-64/pr33292-x32.d @@ -0,0 +1,10 @@ +#source: pr33292.s +#as: --x32 -mx86-used-note=yes +#ld: -shared -m elf32_x86_64 -z noindirect-extern-access +#readelf: -n + +Displaying notes found in: .note.gnu.property +[ ]+Owner[ ]+Data size[ ]+Description + GNU 0x[0-9a-f]+ NT_GNU_PROPERTY_TYPE_0 + Properties: x86 feature used: x86 + x86 ISA used: x86-64-baseline diff --git a/ld/testsuite/ld-x86-64/pr33292.d b/ld/testsuite/ld-x86-64/pr33292.d new file mode 100644 index 0000000..456b849 --- /dev/null +++ b/ld/testsuite/ld-x86-64/pr33292.d @@ -0,0 +1,9 @@ +#as: --64 -defsym __64_bit__=1 -mx86-used-note=yes +#ld: -shared -m elf_x86_64 -z noindirect-extern-access +#readelf: -n + +Displaying notes found in: .note.gnu.property +[ ]+Owner[ ]+Data size[ ]+Description + GNU 0x[0-9a-f]+ NT_GNU_PROPERTY_TYPE_0 + Properties: x86 feature used: x86 + x86 ISA used: x86-64-baseline diff --git a/ld/testsuite/ld-x86-64/pr33292.s b/ld/testsuite/ld-x86-64/pr33292.s new file mode 100644 index 0000000..8d14e88 --- /dev/null +++ b/ld/testsuite/ld-x86-64/pr33292.s @@ -0,0 +1,34 @@ + .section ".note.gnu.property", "a" +.ifdef __64_bit__ + .p2align 3 +.else + .p2align 2 +.endif + .long 1f - 0f /* name length */ + .long 5f - 2f /* data length */ + .long 5 /* note type */ +0: .asciz "GNU" /* vendor name */ +1: +.ifdef __64_bit__ + .p2align 3 +.else + .p2align 2 +.endif +2: .long 0xb0008000 /* pr_type. */ + .long 4f - 3f /* pr_datasz. */ +3: + .long 0x1 +4: +.ifdef __64_bit__ + .p2align 3 +.else + .p2align 2 +.endif +5: + + .text + .globl foo + .type foo, @function +foo: + ret + .section .note.GNU-stack diff --git a/ld/testsuite/ld-x86-64/sframe-ibt-plt-1.d b/ld/testsuite/ld-x86-64/sframe-ibt-plt-1.d index f868242..45bf99a 100644 --- a/ld/testsuite/ld-x86-64/sframe-ibt-plt-1.d +++ b/ld/testsuite/ld-x86-64/sframe-ibt-plt-1.d @@ -10,7 +10,8 @@ Contents of the SFrame section .sframe: Header : Version: SFRAME_VERSION_2 - Flags: SFRAME_F_FDE_SORTED + Flags: SFRAME_F_FDE_SORTED, + SFRAME_F_FDE_FUNC_START_PCREL CFA fixed RA offset: \-8 #... diff --git a/ld/testsuite/ld-x86-64/sframe-plt-1.d b/ld/testsuite/ld-x86-64/sframe-plt-1.d index 2918ccb..d23540e 100644 --- a/ld/testsuite/ld-x86-64/sframe-plt-1.d +++ b/ld/testsuite/ld-x86-64/sframe-plt-1.d @@ -11,7 +11,8 @@ Contents of the SFrame section .sframe: Header : Version: SFRAME_VERSION_2 - Flags: SFRAME_F_FDE_SORTED + Flags: SFRAME_F_FDE_SORTED, + SFRAME_F_FDE_FUNC_START_PCREL CFA fixed RA offset: \-8 #... diff --git a/ld/testsuite/ld-x86-64/sframe-pltgot-1.d b/ld/testsuite/ld-x86-64/sframe-pltgot-1.d index 6c47770..e2255b0 100644 --- a/ld/testsuite/ld-x86-64/sframe-pltgot-1.d +++ b/ld/testsuite/ld-x86-64/sframe-pltgot-1.d @@ -10,7 +10,8 @@ Contents of the SFrame section .sframe: Header : Version: SFRAME_VERSION_2 - Flags: SFRAME_F_FDE_SORTED + Flags: SFRAME_F_FDE_SORTED, + SFRAME_F_FDE_FUNC_START_PCREL CFA fixed RA offset: \-8 #... diff --git a/ld/testsuite/ld-x86-64/sframe-pltgot-2.d b/ld/testsuite/ld-x86-64/sframe-pltgot-2.d index 141be29..52e712b 100644 --- a/ld/testsuite/ld-x86-64/sframe-pltgot-2.d +++ b/ld/testsuite/ld-x86-64/sframe-pltgot-2.d @@ -10,7 +10,8 @@ Contents of the SFrame section .sframe: Header : Version: SFRAME_VERSION_2 - Flags: SFRAME_F_FDE_SORTED + Flags: SFRAME_F_FDE_SORTED, + SFRAME_F_FDE_FUNC_START_PCREL CFA fixed RA offset: \-8 #... diff --git a/ld/testsuite/ld-x86-64/sframe-reloc-1.d b/ld/testsuite/ld-x86-64/sframe-reloc-1.d new file mode 100644 index 0000000..19725e8 --- /dev/null +++ b/ld/testsuite/ld-x86-64/sframe-reloc-1.d @@ -0,0 +1,35 @@ +#as: --gsframe +#source: sframe-foo.s +#source: sframe-bar.s +#objdump: --sframe=.sframe +#ld: -r --no-rosegment +#name: SFrame simple link - relocatable + +.*: +file format .* + +Contents of the SFrame section .sframe: + Header : + + Version: SFRAME_VERSION_2 + Flags: SFRAME_F_FDE_SORTED, + SFRAME_F_FDE_FUNC_START_PCREL + CFA fixed RA offset: \-8 + Num FDEs: 2 + Num FREs: 8 + + Function Index : + + + func idx \[0\]: pc = 0x0, size = 53 bytes + STARTPC +CFA +FP +RA + + 0+0000 +sp\+8 +u +f + + 0+0001 +sp\+16 +c-16 +f + + 0+0004 +fp\+16 +c-16 +f + + 0+0034 +sp\+8 +c-16 +f + + + func idx \[1\]: pc = 0x35, size = 37 bytes + STARTPC +CFA +FP +RA + + 0+0035 +sp\+8 +u +f + + 0+0036 +sp\+16 +c-16 +f + + 0+0039 +fp\+16 +c-16 +f + + 0+0059 +sp\+8 +c-16 +f + diff --git a/ld/testsuite/ld-x86-64/sframe-reloc-2a.s b/ld/testsuite/ld-x86-64/sframe-reloc-2a.s new file mode 100644 index 0000000..8cd8694 --- /dev/null +++ b/ld/testsuite/ld-x86-64/sframe-reloc-2a.s @@ -0,0 +1,7 @@ + .section sect, "axG", @progbits, sectgroup, comdat + .global _start +_start: + .cfi_startproc + call foo + .cfi_endproc + .section .note.GNU-stack,"",@progbits diff --git a/ld/testsuite/ld-x86-64/sframe-reloc-2b.s b/ld/testsuite/ld-x86-64/sframe-reloc-2b.s new file mode 100644 index 0000000..9484636 --- /dev/null +++ b/ld/testsuite/ld-x86-64/sframe-reloc-2b.s @@ -0,0 +1,31 @@ + .section sect, "axG", @progbits, sectgroup, comdat + .cfi_startproc +# Test intention is that LSDA must be provided by the discarded FDE. +# DW_EH_PE_udata8 = 4 +# DW_EH_PE_udata4 = 3 + .ifdef ELF64 + .cfi_lsda 4, lsda + .else + .cfi_lsda 3, lsda + .endif + .skip 16 + .cfi_endproc + + .text + .globl foo + .type foo, @function +foo: + .cfi_startproc + pushq %rbp + .cfi_def_cfa_offset 16 + .cfi_offset 6, -16 + movq %rsp, %rbp + .cfi_def_cfa_register 6 + popq %rbp + .cfi_def_cfa 7, 8 + ret + .cfi_endproc + + .section .gcc_except_table, "a", @progbits +lsda: + .section .note.GNU-stack,"",@progbits diff --git a/ld/testsuite/ld-x86-64/sframe-simple-1.d b/ld/testsuite/ld-x86-64/sframe-simple-1.d index 3effdbf..bb4142f 100644 --- a/ld/testsuite/ld-x86-64/sframe-simple-1.d +++ b/ld/testsuite/ld-x86-64/sframe-simple-1.d @@ -11,7 +11,8 @@ Contents of the SFrame section .sframe: Header : Version: SFRAME_VERSION_2 - Flags: SFRAME_F_FDE_SORTED + Flags: SFRAME_F_FDE_SORTED, + SFRAME_F_FDE_FUNC_START_PCREL CFA fixed RA offset: \-8 #... diff --git a/ld/testsuite/ld-x86-64/tls-le-pic-1-x32.d b/ld/testsuite/ld-x86-64/tls-le-pic-1-x32.d new file mode 100644 index 0000000..29df9ec --- /dev/null +++ b/ld/testsuite/ld-x86-64/tls-le-pic-1-x32.d @@ -0,0 +1,4 @@ +#source: tls-le-pic-1.s +#as: --x32 +#ld: -shared -melf32_x86_64 +#error: .*: relocation R_X86_64_TPOFF32 against symbol `foo' can not be used when making a shared object; local-exec is incompatible with -shared diff --git a/ld/testsuite/ld-x86-64/tls-le-pic-1.d b/ld/testsuite/ld-x86-64/tls-le-pic-1.d new file mode 100644 index 0000000..9726c5c --- /dev/null +++ b/ld/testsuite/ld-x86-64/tls-le-pic-1.d @@ -0,0 +1,3 @@ +#as: --64 +#ld: -shared -melf_x86_64 +#error: .*: relocation R_X86_64_TPOFF32 against symbol `foo' can not be used when making a shared object; local-exec is incompatible with -shared diff --git a/ld/testsuite/ld-x86-64/tls-le-pic-1.s b/ld/testsuite/ld-x86-64/tls-le-pic-1.s new file mode 100644 index 0000000..ffc8e63 --- /dev/null +++ b/ld/testsuite/ld-x86-64/tls-le-pic-1.s @@ -0,0 +1,17 @@ + .text + .p2align 4 + .globl func + .type func, @function +func: + movq %fs:0, %rax + addq $foo@tpoff, %rax + ret + .size func, .-func + .section .tbss,"awT",@nobits + .align 4 + .globl foo + .type foo, @object + .size foo, 4 +foo: + .zero 4 + .section .note.GNU-stack,"",@progbits diff --git a/ld/testsuite/ld-x86-64/tls-le-pic-2-x32.d b/ld/testsuite/ld-x86-64/tls-le-pic-2-x32.d new file mode 100644 index 0000000..b4ebf5a --- /dev/null +++ b/ld/testsuite/ld-x86-64/tls-le-pic-2-x32.d @@ -0,0 +1,4 @@ +#source: tls-le-pic-2.s +#as: --x32 +#ld: -shared -melf32_x86_64 +#error: .*: relocation R_X86_64_TPOFF32 against undefined symbol `foo' can not be used when making a shared object; local-exec is incompatible with -shared diff --git a/ld/testsuite/ld-x86-64/tls-le-pic-2.d b/ld/testsuite/ld-x86-64/tls-le-pic-2.d new file mode 100644 index 0000000..90ca634 --- /dev/null +++ b/ld/testsuite/ld-x86-64/tls-le-pic-2.d @@ -0,0 +1,3 @@ +#as: --64 +#ld: -shared -melf_x86_64 +#error: .*: relocation R_X86_64_TPOFF32 against undefined symbol `foo' can not be used when making a shared object; local-exec is incompatible with -shared diff --git a/ld/testsuite/ld-x86-64/tls-le-pic-2.s b/ld/testsuite/ld-x86-64/tls-le-pic-2.s new file mode 100644 index 0000000..ad930db --- /dev/null +++ b/ld/testsuite/ld-x86-64/tls-le-pic-2.s @@ -0,0 +1,10 @@ + .text + .p2align 4 + .globl func + .type func, @function +func: + movq %fs:0, %rax + addq $foo@tpoff, %rax + ret + .size func, .-func + .section .note.GNU-stack,"",@progbits diff --git a/ld/testsuite/ld-x86-64/tls-le-pic-3-x32.d b/ld/testsuite/ld-x86-64/tls-le-pic-3-x32.d new file mode 100644 index 0000000..ed832e4 --- /dev/null +++ b/ld/testsuite/ld-x86-64/tls-le-pic-3-x32.d @@ -0,0 +1,4 @@ +#source: tls-le-pic-3.s +#as: --x32 +#ld: -shared -melf32_x86_64 +#error: .*: relocation R_X86_64_TPOFF32 against `foo' can not be used when making a shared object; local-exec is incompatible with -shared diff --git a/ld/testsuite/ld-x86-64/tls-le-pic-3.d b/ld/testsuite/ld-x86-64/tls-le-pic-3.d new file mode 100644 index 0000000..8497067 --- /dev/null +++ b/ld/testsuite/ld-x86-64/tls-le-pic-3.d @@ -0,0 +1,3 @@ +#as: --64 +#ld: -shared -melf_x86_64 +#error: .*: relocation R_X86_64_TPOFF32 against `foo' can not be used when making a shared object; local-exec is incompatible with -shared diff --git a/ld/testsuite/ld-x86-64/tls-le-pic-3.s b/ld/testsuite/ld-x86-64/tls-le-pic-3.s new file mode 100644 index 0000000..6e213fd --- /dev/null +++ b/ld/testsuite/ld-x86-64/tls-le-pic-3.s @@ -0,0 +1,16 @@ + .text + .p2align 4 + .globl func + .type func, @function +func: + movq %fs:0, %rax + addq $foo@tpoff, %rax + ret + .size func, .-func + .section .tbss,"awT",@nobits + .align 4 + .type foo, @object + .size foo, 4 +foo: + .zero 4 + .section .note.GNU-stack,"",@progbits diff --git a/ld/testsuite/ld-x86-64/tlsdesc.pd b/ld/testsuite/ld-x86-64/tlsdesc.pd index 490fc90..7e124ea 100644 --- a/ld/testsuite/ld-x86-64/tlsdesc.pd +++ b/ld/testsuite/ld-x86-64/tlsdesc.pd @@ -10,10 +10,10 @@ Disassembly of section .plt: [0-9a-f]+ <.plt>: - [0-9a-f]+: ff 35 .. .. 20 00 push .*\(%rip\) # 201358 <_GLOBAL_OFFSET_TABLE_\+0x8> - [0-9a-f]+: ff 25 .. .. 20 00 jmp \*.*\(%rip\) # 201360 <_GLOBAL_OFFSET_TABLE_\+0x10> + [0-9a-f]+: ff 35 .. .. 20 00 push .*\(%rip\) # 201328 <_GLOBAL_OFFSET_TABLE_\+0x8> + [0-9a-f]+: ff 25 .. .. 20 00 jmp \*.*\(%rip\) # 201330 <_GLOBAL_OFFSET_TABLE_\+0x10> [0-9a-f]+: 0f 1f 40 00 nopl 0x0\(%rax\) [0-9a-f]+: f3 0f 1e fa endbr64 - [0-9a-f]+: ff 35 .. .. 20 00 push .*\(%rip\) # 201358 <_GLOBAL_OFFSET_TABLE_\+0x8> - [0-9a-f]+: ff 25 .. .. 20 00 jmp \*.*\(%rip\) # 201348 <.*> + [0-9a-f]+: ff 35 .. .. 20 00 push .*\(%rip\) # 201328 <_GLOBAL_OFFSET_TABLE_\+0x8> + [0-9a-f]+: ff 25 .. .. 20 00 jmp \*.*\(%rip\) # 201318 <.*> diff --git a/ld/testsuite/ld-x86-64/tlsdesc.rd b/ld/testsuite/ld-x86-64/tlsdesc.rd index 98bda5b..14e945a 100644 --- a/ld/testsuite/ld-x86-64/tlsdesc.rd +++ b/ld/testsuite/ld-x86-64/tlsdesc.rd @@ -14,14 +14,13 @@ Section Headers: +\[[ 0-9]+\] .dynsym +.* +\[[ 0-9]+\] .dynstr +.* +\[[ 0-9]+\] .rela.dyn +.* - +\[[ 0-9]+\] .rela.plt +.* +\[[ 0-9]+\] .plt +PROGBITS +0+3b0 0+3b0 0+20 10 +AX +0 +0 +(4|16) +\[[ 0-9]+\] .text +PROGBITS +0+1000 0+1000 0+153 00 +AX +0 +0 4096 +\[[ 0-9]+\] .tdata +PROGBITS +0+201153 0+1153 0+60 00 WAT +0 +0 +1 +\[[ 0-9]+\] .tbss +NOBITS +0+2011b3 0+11b3 0+20 00 WAT +0 +0 +1 - +\[[ 0-9]+\] .dynamic +DYNAMIC +0+2011b8 0+11b8 0+150 10 +WA +3 +0 +8 - +\[[ 0-9]+\] .got +PROGBITS +0+201308 0+1308 0+48 08 +WA +0 +0 +8 - +\[[ 0-9]+\] .got.plt +PROGBITS +0+201350 0+1350 0+68 08 +WA +0 +0 +8 + +\[[ 0-9]+\] .dynamic +DYNAMIC +0+2011b8 0+11b8 0+120 10 +WA +3 +0 +8 + +\[[ 0-9]+\] .got +PROGBITS +0+2012d8 0+12d8 0+48 08 +WA +0 +0 +8 + +\[[ 0-9]+\] .got.plt +PROGBITS +0+201320 0+1320 0+68 08 +WA +0 +0 +8 +\[[ 0-9]+\] .symtab +.* +\[[ 0-9]+\] .strtab +.* +\[[ 0-9]+\] .shstrtab +.* @@ -35,18 +34,18 @@ There are [0-9]+ program headers, starting at offset [0-9]+ Program Headers: +Type +Offset +VirtAddr +PhysAddr +FileSiz +MemSiz +Flg Align +LOAD +0x0+ 0x0+ 0x0+ 0x[0-9a-f]+ 0x[0-9a-f]+ R E 0x200000 - +LOAD +0x0+1153 0x0+201153 0x0+201153 0x0+265 0x0+265 RW +0x200000 - +DYNAMIC +0x0+11b8 0x0+2011b8 0x0+2011b8 0x0+150 0x0+150 RW +0x8 + +LOAD +0x0+1153 0x0+201153 0x0+201153 0x0+235 0x0+235 RW +0x200000 + +DYNAMIC +0x0+11b8 0x0+2011b8 0x0+2011b8 0x0+120 0x0+120 RW +0x8 +TLS +0x0+1153 0x0+201153 0x0+201153 0x0+60 0x0+80 R +0x1 Section to Segment mapping: +Segment Sections... - +00 +.hash .dynsym .dynstr .rela.dyn .rela.plt .plt .text * + +00 +.hash .dynsym .dynstr .rela.dyn .plt .text * +01 +.tdata .dynamic .got .got.plt * +02 +.dynamic * +03 +.tdata .tbss * -Dynamic section at offset 0x[0-9a-f]+ contains 16 entries: +Dynamic section at offset 0x[0-9a-f]+ contains 13 entries: +Tag +Type +Name/Value 0x[0-9a-f]+ +\(HASH\).* 0x[0-9a-f]+ +\(STRTAB\).* @@ -54,87 +53,81 @@ Dynamic section at offset 0x[0-9a-f]+ contains 16 entries: 0x[0-9a-f]+ +\(STRSZ\).* 0x[0-9a-f]+ +\(SYMENT\).* 0x[0-9a-f]+ +\(PLTGOT\).* - 0x[0-9a-f]+ +\(PLTRELSZ\).* - 0x[0-9a-f]+ +\(PLTREL\).* - 0x[0-9a-f]+ +\(JMPREL\).* 0x[0-9a-f]+ +\(TLSDESC_PLT\) +0x3c0 - 0x[0-9a-f]+ +\(TLSDESC_GOT\) +0x201348 + 0x[0-9a-f]+ +\(TLSDESC_GOT\) +0x201318 0x[0-9a-f]+ +\(RELA\).* 0x[0-9a-f]+ +\(RELASZ\).* 0x[0-9a-f]+ +\(RELAENT\).* 0x[0-9a-f]+ +\(FLAGS\).* 0x[0-9a-f]+ +\(NULL\).* -Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 8 entries: +Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 13 entries: +Offset +Info +Type +Symbol's Value +Symbol's Name \+ Addend -0+201308 +[0-9a-f]+ R_X86_64_TPOFF64 +24 -0+201310 +[0-9a-f]+ R_X86_64_TPOFF64 +30 -0+201318 +[0-9a-f]+ R_X86_64_TPOFF64 +64 -0+201328 +[0-9a-f]+ R_X86_64_TPOFF64 +50 -0+201330 +[0-9a-f]+ R_X86_64_TPOFF64 +70 -0+201340 +[0-9a-f]+ R_X86_64_TPOFF64 +44 -0+201320 +[0-9a-f]+ R_X86_64_TPOFF64 +0+10 sg5 \+ 0 -0+201338 +[0-9a-f]+ R_X86_64_TPOFF64 +0+4 sg2 \+ 0 - -Relocation section '.rela.plt' at offset 0x[0-9a-f]+ contains 5 entries: - +Offset +Info +Type +Symbol's Value +Symbol's Name \+ Addend -0+201398 +[0-9a-f]+ R_X86_64_TLSDESC +0+ sg1 \+ 0 -0+201368 +[0-9a-f]+ R_X86_64_TLSDESC +20 -0+2013a8 +[0-9a-f]+ R_X86_64_TLSDESC +40 -0+201378 +[0-9a-f]+ R_X86_64_TLSDESC +60 -0+201388 +[0-9a-f]+ R_X86_64_TLSDESC +0 +0+2012d8 +[0-9a-f]+ R_X86_64_TPOFF64 +24 +0+2012e0 +[0-9a-f]+ R_X86_64_TPOFF64 +30 +0+2012e8 +[0-9a-f]+ R_X86_64_TPOFF64 +64 +0+2012f8 +[0-9a-f]+ R_X86_64_TPOFF64 +50 +0+201300 +[0-9a-f]+ R_X86_64_TPOFF64 +70 +0+201310 +[0-9a-f]+ R_X86_64_TPOFF64 +44 +0+201338 +[0-9a-f]+ R_X86_64_TLSDESC +20 +0+201348 +[0-9a-f]+ R_X86_64_TLSDESC +60 +0+201358 +[0-9a-f]+ R_X86_64_TLSDESC +0 +0+201378 +[0-9a-f]+ R_X86_64_TLSDESC +40 +0+2012f0 +[0-9a-f]+ R_X86_64_TPOFF64 +0+10 sg5 \+ 0 +0+201308 +[0-9a-f]+ R_X86_64_TPOFF64 +0+4 sg2 \+ 0 +0+201368 +[0-9a-f]+ R_X86_64_TLSDESC +0+ sg1 \+ 0 Symbol table '\.dynsym' contains [0-9]+ entries: +Num: +Value +Size +Type +Bind +Vis +Ndx +Name +[0-9]+: 0+ +0 +NOTYPE +LOCAL +DEFAULT +UND * - +[0-9]+: 0+1c +0 +TLS +GLOBAL +DEFAULT +8 sg8 - +[0-9]+: 0+8 +0 +TLS +GLOBAL +DEFAULT +8 sg3 - +[0-9]+: 0+c +0 +TLS +GLOBAL +DEFAULT +8 sg4 - +[0-9]+: 0+10 +0 +TLS +GLOBAL +DEFAULT +8 sg5 - +[0-9]+: 0+ +0 +TLS +GLOBAL +DEFAULT +8 sg1 - +[0-9]+: 0+1000 +0 +FUNC +GLOBAL +DEFAULT +7 fn1 - +[0-9]+: 0+4 +0 +TLS +GLOBAL +DEFAULT +8 sg2 - +[0-9]+: 0+14 +0 +TLS +GLOBAL +DEFAULT +8 sg6 - +[0-9]+: 0+18 +0 +TLS +GLOBAL +DEFAULT +8 sg7 + +[0-9]+: 0+1c +0 +TLS +GLOBAL +DEFAULT +7 sg8 + +[0-9]+: 0+8 +0 +TLS +GLOBAL +DEFAULT +7 sg3 + +[0-9]+: 0+c +0 +TLS +GLOBAL +DEFAULT +7 sg4 + +[0-9]+: 0+10 +0 +TLS +GLOBAL +DEFAULT +7 sg5 + +[0-9]+: 0+ +0 +TLS +GLOBAL +DEFAULT +7 sg1 + +[0-9]+: 0+1000 +0 +FUNC +GLOBAL +DEFAULT +6 fn1 + +[0-9]+: 0+4 +0 +TLS +GLOBAL +DEFAULT +7 sg2 + +[0-9]+: 0+14 +0 +TLS +GLOBAL +DEFAULT +7 sg6 + +[0-9]+: 0+18 +0 +TLS +GLOBAL +DEFAULT +7 sg7 Symbol table '\.symtab' contains [0-9]+ entries: +Num: +Value +Size +Type +Bind +Vis +Ndx +Name +[0-9]+: 0+ +0 +NOTYPE +LOCAL +DEFAULT +UND * .* FILE +LOCAL +DEFAULT +ABS .*tlsdesc.o - +[0-9]+: 0+20 +0 +TLS +LOCAL +DEFAULT +8 sl1 - +[0-9]+: 0+24 +0 +TLS +LOCAL +DEFAULT +8 sl2 - +[0-9]+: 0+28 +0 +TLS +LOCAL +DEFAULT +8 sl3 - +[0-9]+: 0+2c +0 +TLS +LOCAL +DEFAULT +8 sl4 - +[0-9]+: 0+30 +0 +TLS +LOCAL +DEFAULT +8 sl5 - +[0-9]+: 0+34 +0 +TLS +LOCAL +DEFAULT +8 sl6 - +[0-9]+: 0+38 +0 +TLS +LOCAL +DEFAULT +8 sl7 - +[0-9]+: 0+3c +0 +TLS +LOCAL +DEFAULT +8 sl8 + +[0-9]+: 0+20 +0 +TLS +LOCAL +DEFAULT +7 sl1 + +[0-9]+: 0+24 +0 +TLS +LOCAL +DEFAULT +7 sl2 + +[0-9]+: 0+28 +0 +TLS +LOCAL +DEFAULT +7 sl3 + +[0-9]+: 0+2c +0 +TLS +LOCAL +DEFAULT +7 sl4 + +[0-9]+: 0+30 +0 +TLS +LOCAL +DEFAULT +7 sl5 + +[0-9]+: 0+34 +0 +TLS +LOCAL +DEFAULT +7 sl6 + +[0-9]+: 0+38 +0 +TLS +LOCAL +DEFAULT +7 sl7 + +[0-9]+: 0+3c +0 +TLS +LOCAL +DEFAULT +7 sl8 .* FILE +LOCAL +DEFAULT +ABS - +[0-9]+: 0+60 +0 +TLS +LOCAL +DEFAULT +9 sH1 - +[0-9]+: 0+ +0 +TLS +LOCAL +DEFAULT +8 _TLS_MODULE_BASE_ - +[0-9]+: 0+2011b8 +0 +OBJECT +LOCAL +DEFAULT +10 _DYNAMIC - +[0-9]+: 0+48 +0 +TLS +LOCAL +DEFAULT +8 sh3 - +[0-9]+: 0+64 +0 +TLS +LOCAL +DEFAULT +9 sH2 - +[0-9]+: 0+78 +0 +TLS +LOCAL +DEFAULT +9 sH7 - +[0-9]+: 0+58 +0 +TLS +LOCAL +DEFAULT +8 sh7 - +[0-9]+: 0+5c +0 +TLS +LOCAL +DEFAULT +8 sh8 - +[0-9]+: 0+6c +0 +TLS +LOCAL +DEFAULT +9 sH4 - +[0-9]+: 0+4c +0 +TLS +LOCAL +DEFAULT +8 sh4 - +[0-9]+: 0+68 +0 +TLS +LOCAL +DEFAULT +9 sH3 - +[0-9]+: 0+50 +0 +TLS +LOCAL +DEFAULT +8 sh5 - +[0-9]+: 0+70 +0 +TLS +LOCAL +DEFAULT +9 sH5 - +[0-9]+: 0+74 +0 +TLS +LOCAL +DEFAULT +9 sH6 - +[0-9]+: 0+7c +0 +TLS +LOCAL +DEFAULT +9 sH8 - +[0-9]+: 0+40 +0 +TLS +LOCAL +DEFAULT +8 sh1 - +[0-9]+: 0+201350 +0 +OBJECT +LOCAL +DEFAULT +12 _GLOBAL_OFFSET_TABLE_ - +[0-9]+: 0+44 +0 +TLS +LOCAL +DEFAULT +8 sh2 - +[0-9]+: 0+54 +0 +TLS +LOCAL +DEFAULT +8 sh6 - +[0-9]+: 0+1c +0 +TLS +GLOBAL +DEFAULT +8 sg8 - +[0-9]+: 0+8 +0 +TLS +GLOBAL +DEFAULT +8 sg3 - +[0-9]+: 0+c +0 +TLS +GLOBAL +DEFAULT +8 sg4 - +[0-9]+: 0+10 +0 +TLS +GLOBAL +DEFAULT +8 sg5 - +[0-9]+: 0+ +0 +TLS +GLOBAL +DEFAULT +8 sg1 - +[0-9]+: 0+1000 +0 +FUNC +GLOBAL +DEFAULT +7 fn1 - +[0-9]+: 0+4 +0 +TLS +GLOBAL +DEFAULT +8 sg2 - +[0-9]+: 0+14 +0 +TLS +GLOBAL +DEFAULT +8 sg6 - +[0-9]+: 0+18 +0 +TLS +GLOBAL +DEFAULT +8 sg7 + +[0-9]+: 0+60 +0 +TLS +LOCAL +DEFAULT +8 sH1 + +[0-9]+: 0+ +0 +TLS +LOCAL +DEFAULT +7 _TLS_MODULE_BASE_ + +[0-9]+: 0+2011b8 +0 +OBJECT +LOCAL +DEFAULT +9 _DYNAMIC + +[0-9]+: 0+48 +0 +TLS +LOCAL +DEFAULT +7 sh3 + +[0-9]+: 0+64 +0 +TLS +LOCAL +DEFAULT +8 sH2 + +[0-9]+: 0+78 +0 +TLS +LOCAL +DEFAULT +8 sH7 + +[0-9]+: 0+58 +0 +TLS +LOCAL +DEFAULT +7 sh7 + +[0-9]+: 0+5c +0 +TLS +LOCAL +DEFAULT +7 sh8 + +[0-9]+: 0+6c +0 +TLS +LOCAL +DEFAULT +8 sH4 + +[0-9]+: 0+4c +0 +TLS +LOCAL +DEFAULT +7 sh4 + +[0-9]+: 0+68 +0 +TLS +LOCAL +DEFAULT +8 sH3 + +[0-9]+: 0+50 +0 +TLS +LOCAL +DEFAULT +7 sh5 + +[0-9]+: 0+70 +0 +TLS +LOCAL +DEFAULT +8 sH5 + +[0-9]+: 0+74 +0 +TLS +LOCAL +DEFAULT +8 sH6 + +[0-9]+: 0+7c +0 +TLS +LOCAL +DEFAULT +8 sH8 + +[0-9]+: 0+40 +0 +TLS +LOCAL +DEFAULT +7 sh1 + +[0-9]+: 0+201320 +0 +OBJECT +LOCAL +DEFAULT +11 _GLOBAL_OFFSET_TABLE_ + +[0-9]+: 0+44 +0 +TLS +LOCAL +DEFAULT +7 sh2 + +[0-9]+: 0+54 +0 +TLS +LOCAL +DEFAULT +7 sh6 + +[0-9]+: 0+1c +0 +TLS +GLOBAL +DEFAULT +7 sg8 + +[0-9]+: 0+8 +0 +TLS +GLOBAL +DEFAULT +7 sg3 + +[0-9]+: 0+c +0 +TLS +GLOBAL +DEFAULT +7 sg4 + +[0-9]+: 0+10 +0 +TLS +GLOBAL +DEFAULT +7 sg5 + +[0-9]+: 0+ +0 +TLS +GLOBAL +DEFAULT +7 sg1 + +[0-9]+: 0+1000 +0 +FUNC +GLOBAL +DEFAULT +6 fn1 + +[0-9]+: 0+4 +0 +TLS +GLOBAL +DEFAULT +7 sg2 + +[0-9]+: 0+14 +0 +TLS +GLOBAL +DEFAULT +7 sg6 + +[0-9]+: 0+18 +0 +TLS +GLOBAL +DEFAULT +7 sg7 diff --git a/ld/testsuite/ld-x86-64/tlsdesc2.d b/ld/testsuite/ld-x86-64/tlsdesc2.d index 8679757..d0f5ebf 100644 --- a/ld/testsuite/ld-x86-64/tlsdesc2.d +++ b/ld/testsuite/ld-x86-64/tlsdesc2.d @@ -3,8 +3,8 @@ #ld: -melf_x86_64 -shared -z now #readelf: -d --wide -#... +#failif .*\(PLTRELSZ\).* .*\(PLTREL\).* .*\(JMPREL\).* -#pass +#... diff --git a/ld/testsuite/ld-x86-64/tlsgdesc.rd b/ld/testsuite/ld-x86-64/tlsgdesc.rd index ca8f19b..ef15ce9 100644 --- a/ld/testsuite/ld-x86-64/tlsgdesc.rd +++ b/ld/testsuite/ld-x86-64/tlsgdesc.rd @@ -41,22 +41,22 @@ Program Headers: +01 +.dynamic .got .got.plt * +02 +.dynamic * -Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 8 entries: +Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 10 entries: +Offset +Info +Type +Symbol's Value +Symbol's Name \+ Addend [0-9a-f]+ +0+100000012 R_X86_64_TPOFF64 +0+ sG3 \+ 0 [0-9a-f]+ +0+200000012 R_X86_64_TPOFF64 +0+ sG5 \+ 0 [0-9a-f]+ +0+300000010 R_X86_64_DTPMOD64 +0+ sG2 \+ 0 [0-9a-f]+ +0+300000011 R_X86_64_DTPOFF64 +0+ sG2 \+ 0 +[0-9a-f]+ +0+300000024 R_X86_64_TLSDESC +0+ sG2 \+ 0 [0-9a-f]+ +0+400000012 R_X86_64_TPOFF64 +0+ sG4 \+ 0 [0-9a-f]+ +0+600000012 R_X86_64_TPOFF64 +0+ sG6 \+ 0 [0-9a-f]+ +0+800000010 R_X86_64_DTPMOD64 +0+ sG1 \+ 0 [0-9a-f]+ +0+800000011 R_X86_64_DTPOFF64 +0+ sG1 \+ 0 +[0-9a-f]+ +0+800000024 R_X86_64_TLSDESC +0+ sG1 \+ 0 -Relocation section '.rela.plt' at offset 0x[0-9a-f]+ contains 3 entries: +Relocation section '.rela.plt' at offset 0x[0-9a-f]+ contains 1 entry: +Offset +Info +Type +Symbol's Value +Symbol's Name \+ Addend [0-9a-f]+ +0+500000007 R_X86_64_JUMP_SLOT +0+ __tls_get_addr \+ 0 -[0-9a-f]+ +0+800000024 R_X86_64_TLSDESC +0+ sG1 \+ 0 -[0-9a-f]+ +0+300000024 R_X86_64_TLSDESC +0+ sG2 \+ 0 Symbol table '\.dynsym' contains [0-9]+ entries: +Num: +Value +Size +Type +Bind +Vis +Ndx +Name diff --git a/ld/testsuite/ld-x86-64/x86-64-64-export-class.rd b/ld/testsuite/ld-x86-64/x86-64-64-export-class.rd index 308e307..4a0bfa1 100644 --- a/ld/testsuite/ld-x86-64/x86-64-64-export-class.rd +++ b/ld/testsuite/ld-x86-64/x86-64-64-export-class.rd @@ -1,11 +1,11 @@ Relocation section '\.rela\.dyn' at offset 0x[0-9a-f]+ contains [0-9]+ entries: * Offset * Info * Type * Sym\. *Value * Sym\. * Name * \+ * Addend +000012340000 000000000008 R_X86_64_RELATIVE 123400a0 000012340010 000000000008 R_X86_64_RELATIVE 123400a0 000012340020 000000000008 R_X86_64_RELATIVE 123400a0 +000012340040 000000000008 R_X86_64_RELATIVE 123400a0 +000012340050 000000000008 R_X86_64_RELATIVE 123400a0 000012340060 000000000008 R_X86_64_RELATIVE 123400a0 000012340070 000000000008 R_X86_64_RELATIVE 123400a0 000012340080 000000000008 R_X86_64_RELATIVE 123400a0 000012340090 000000000008 R_X86_64_RELATIVE 123400a0 -000012340000 [0-9a-f]+00000001 R_X86_64_64 00000000123400a0 protected_baz \+ 0 -000012340040 [0-9a-f]+00000001 R_X86_64_64 00000000123400a0 protected_foo \+ 0 -000012340050 [0-9a-f]+00000001 R_X86_64_64 00000000123400a0 protected_bar \+ 0 diff --git a/ld/testsuite/ld-x86-64/x86-64-x32-export-class.rd b/ld/testsuite/ld-x86-64/x86-64-x32-export-class.rd index 4ea93ba..5018229 100644 --- a/ld/testsuite/ld-x86-64/x86-64-x32-export-class.rd +++ b/ld/testsuite/ld-x86-64/x86-64-x32-export-class.rd @@ -1,11 +1,11 @@ Relocation section '\.rela\.dyn' at offset 0x[0-9a-f]+ contains [0-9]+ entries: * Offset * Info * Type * Sym\. *Value * Sym\. * Name * \+ * Addend +12340000 00000008 R_X86_64_RELATIVE 123400a0 12340010 00000008 R_X86_64_RELATIVE 123400a0 12340020 00000008 R_X86_64_RELATIVE 123400a0 +12340040 00000008 R_X86_64_RELATIVE 123400a0 +12340050 00000008 R_X86_64_RELATIVE 123400a0 12340060 00000008 R_X86_64_RELATIVE 123400a0 12340070 00000008 R_X86_64_RELATIVE 123400a0 12340080 00000008 R_X86_64_RELATIVE 123400a0 12340090 00000008 R_X86_64_RELATIVE 123400a0 -12340000 [0-9a-f]+0a R_X86_64_32 123400a0 protected_baz \+ 0 -12340040 [0-9a-f]+0a R_X86_64_32 123400a0 protected_foo \+ 0 -12340050 [0-9a-f]+0a R_X86_64_32 123400a0 protected_bar \+ 0 diff --git a/ld/testsuite/ld-x86-64/x86-64.exp b/ld/testsuite/ld-x86-64/x86-64.exp index 52c4d5e..f04ae92 100644 --- a/ld/testsuite/ld-x86-64/x86-64.exp +++ b/ld/testsuite/ld-x86-64/x86-64.exp @@ -534,6 +534,12 @@ run_dump_test "dt-relr-1a" run_dump_test "dt-relr-1a-x32" run_dump_test "dt-relr-1b" run_dump_test "dt-relr-1b-x32" +run_dump_test "dt-relr-1c" +run_dump_test "dt-relr-1c-x32" +run_dump_test "dt-relr-1d" +run_dump_test "dt-relr-1d-x32" +run_dump_test "dt-relr-2" +run_dump_test "dt-relr-2-x32" run_dump_test "pr30787" run_dump_test "pr31047" run_dump_test "pr31047-x32" @@ -563,13 +569,50 @@ run_dump_test "pr32591-3" run_dump_test "pr32591-3-x32" run_dump_test "pr32591-4" run_dump_test "pr32591-4-x32" +run_dump_test "pr32809" +run_dump_test "pr33260" +run_dump_test "pr33260-x32" +run_dump_test "pr33260-2" +run_dump_test "pr33260-2-x32" +run_dump_test "pr33292" +run_dump_test "pr33292-x32" +run_dump_test "pr28387" +run_dump_test "pr28387-x32" +run_dump_test "tls-le-pic-1" +run_dump_test "tls-le-pic-1-x32" +run_dump_test "tls-le-pic-2" +run_dump_test "tls-le-pic-2-x32" +run_dump_test "tls-le-pic-3" +run_dump_test "tls-le-pic-3-x32" if { ![skip_sframe_tests] } { run_dump_test "sframe-simple-1" + run_dump_test "sframe-reloc-1" run_dump_test "sframe-plt-1" run_dump_test "sframe-ibt-plt-1" run_dump_test "sframe-pltgot-1" run_dump_test "sframe-pltgot-2" + + run_ld_link_tests [list \ + [list \ + "Build sframe-reloc-2.o" \ + "-m elf_x86_64 -r" \ + "" \ + "--64 --gsframe" \ + {sframe-reloc-2a.s sframe-reloc-2b.s} \ + "" \ + "sframe-reloc-2.o" \ + ] \ + [list \ + "Build sframe-reloc-2" \ + "-m elf_x86_64 tmpdir/sframe-reloc-2.o" \ + "" \ + "--64 --gsframe" \ + {dummy.s} \ + "" \ + "sframe-reloc-2" \ + ] \ + ] } if ![istarget "x86_64-*-linux*"] { @@ -978,7 +1021,7 @@ if { [isnative] && [check_compiler_available] } { [list \ "Build pr17689.so" \ "-shared" \ - "-fPIC -Wa,-mx86-used-note=yes" \ + "$DIRECT_EXTERN_ACCESS_CFLAGS -fPIC -Wa,-mx86-used-note=yes" \ { pr17689a.c } \ {} \ "pr17689.so" \ @@ -986,7 +1029,7 @@ if { [isnative] && [check_compiler_available] } { [list \ "Build pr17689now.so with -z now" \ "-shared -Wl,-z,now" \ - "-fPIC -Wa,-mx86-used-note=yes" \ + "$DIRECT_EXTERN_ACCESS_CFLAGS -fPIC -Wa,-mx86-used-note=yes" \ { pr17689a.c } \ {{readelf {-Wr} pr17689now.rd}} \ "pr17689now.so" \ @@ -994,30 +1037,30 @@ if { [isnative] && [check_compiler_available] } { [list \ "Build pr17689b.o" \ "" \ - "-Wa,-mx86-used-note=yes" \ + "$DIRECT_EXTERN_ACCESS_CFLAGS -Wa,-mx86-used-note=yes" \ { pr17689b.S } \ {} \ ] \ [list \ "Build pr17689 with PIE without -fPIE" \ - "tmpdir/pr17689b.o tmpdir/pr17689.so -pie" \ - "-Wa,-mx86-used-note=yes" \ + "tmpdir/pr17689b.o tmpdir/pr17689.so -pie -Wl,-z,noindirect-extern-access" \ + "$DIRECT_EXTERN_ACCESS_CFLAGS -Wa,-mx86-used-note=yes" \ { dummy.s } \ {{readelf {-Wr} pr17689.rd}} \ "pr17689" \ ] \ [list \ "Build pr17689 with PIE -z now without -fPIE" \ - "tmpdir/pr17689b.o tmpdir/pr17689.so -pie -Wl,-z,now" \ - "-Wa,-mx86-used-note=yes" \ + "tmpdir/pr17689b.o tmpdir/pr17689.so -pie -Wl,-z,now -Wl,-z,noindirect-extern-access" \ + "$DIRECT_EXTERN_ACCESS_CFLAGS -Wa,-mx86-used-note=yes" \ { dummy.s } \ {{readelf {-Wr} pr17689now.rd}} \ "pr17689now" \ ] \ [list \ "Build pr17827 with PIE without -fPIE" \ - "-Wl,--as-needed tmpdir/pr17689b.o tmpdir/pr17689.so -pie" \ - "-Wa,-mx86-used-note=yes" \ + "-Wl,--as-needed tmpdir/pr17689b.o tmpdir/pr17689.so -pie -Wl,-z,noindirect-extern-access" \ + "$DIRECT_EXTERN_ACCESS_CFLAGS -Wa,-mx86-used-note=yes" \ { dummy.s } \ {{readelf {-Wr} pr17827.rd}} \ "pr17827" \ @@ -1122,7 +1165,7 @@ if { [isnative] && [check_compiler_available] } { [list \ "Build property 1 (.o)" \ "-r -nostdlib" \ - "-Wa,-mx86-used-note=yes" \ + "$DIRECT_EXTERN_ACCESS_CFLAGS -Wa,-mx86-used-note=yes" \ {pass.c property-no-copy.S} \ {{readelf {-n} property-1a.r}} \ "property-1.o" \ @@ -1146,7 +1189,7 @@ if { [isnative] && [check_compiler_available] } { [list \ "Build property 2 (.o)" \ "-r -nostdlib" \ - "-Wa,-mx86-used-note=yes" \ + "$DIRECT_EXTERN_ACCESS_CFLAGS -Wa,-mx86-used-note=yes" \ {pass.c property-stack.S} \ {{readelf {-n} property-2a.r}} \ "property-2.o" \ @@ -1170,7 +1213,7 @@ if { [isnative] && [check_compiler_available] } { [list \ "Build property-6.o" \ "-r -nostdlib" \ - "-Wa,-mx86-used-note=yes" \ + "$DIRECT_EXTERN_ACCESS_CFLAGS -Wa,-mx86-used-note=yes" \ {property-6b.c property-stack.S} \ {{readelf {-n} property-2a.r}} \ "property-6.o" \ @@ -1201,16 +1244,16 @@ if { [isnative] && [check_compiler_available] } { ] \ [list \ "Build pr22001-1.so" \ - "-shared" \ - "-fPIC -Wa,-mx86-used-note=yes" \ + "-shared -Wl,-z,noindirect-extern-access" \ + "$DIRECT_EXTERN_ACCESS_CFLAGS -fPIC -Wa,-mx86-used-note=yes" \ { pr22001-1a.c } \ {} \ "pr22001-1.so" \ ] \ [list \ "Build pr22001-1a" \ - "$NOPIE_LDFLAGS -Wl,-z,nocopyreloc,--no-as-needed,-z,notext tmpdir/pr22001-1.so" \ - "$NOPIE_CFLAGS -Wa,-mx86-used-note=yes" \ + "$NOPIE_LDFLAGS -Wl,-z,nocopyreloc,--no-as-needed,-z,notext,-z,noindirect-extern-access tmpdir/pr22001-1.so" \ + "$DIRECT_EXTERN_ACCESS_CFLAGS $NOPIE_CFLAGS -Wa,-mx86-used-note=yes" \ { pr22001-1b.c } \ {{error_output "pr22001-1a.err"}} \ "pr22001-1a" \ @@ -1218,7 +1261,7 @@ if { [isnative] && [check_compiler_available] } { [list \ "Build pr21997-1.so" \ "-shared" \ - "-Wa,-mx86-used-note=yes" \ + "$DIRECT_EXTERN_ACCESS_CFLAGS -Wa,-mx86-used-note=yes" \ { property-stack.S property-no-copy.S pr21997-1a.S } \ {} \ "pr21997-1.so" \ @@ -1226,7 +1269,7 @@ if { [isnative] && [check_compiler_available] } { [list \ "Build pr21997-1a" \ "$NOPIE_LDFLAGS -Wl,--no-as-needed,-z,notext tmpdir/pr21997-1.so" \ - "$NOPIE_CFLAGS -Wa,-mx86-used-note=yes" \ + "$DIRECT_EXTERN_ACCESS_CFLAGS $NOPIE_CFLAGS -Wa,-mx86-used-note=yes" \ { pr21997-1b.c } \ {{error_output "pr21997-1a.err"}} \ "pr21997-1a" \ @@ -1372,7 +1415,7 @@ if { [isnative] && [check_compiler_available] } { [list \ "Build protected-func-2 without PIE" \ "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/libprotected-func-2b.so" \ - "$NOPIE_CFLAGS -Wa,-mx86-used-note=yes" \ + "$DIRECT_EXTERN_ACCESS_CFLAGS $NOPIE_CFLAGS -Wa,-mx86-used-note=yes" \ { protected-func-1b.c } \ {{error_output "pr28875-func.err"}} \ "protected-func-2" \ @@ -1388,7 +1431,7 @@ if { [isnative] && [check_compiler_available] } { [list \ "Build protected-func-2a without PIE" \ "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/libprotected-func-2c.so" \ - "$NOPIE_CFLAGS -Wa,-mx86-used-note=yes" \ + "$DIRECT_EXTERN_ACCESS_CFLAGS $NOPIE_CFLAGS -Wa,-mx86-used-note=yes" \ { protected-func-1b.c } \ {{error_output "pr28875-func.err"}} \ "protected-func-2a" \ @@ -1412,7 +1455,7 @@ if { [isnative] && [check_compiler_available] } { [list \ "Build protected-data-1 without PIE" \ "$NOPIE_LDFLAGS -Wl,--no-as-needed tmpdir/libprotected-data-1b.so" \ - "$NOPIE_CFLAGS -Wa,-mx86-used-note=yes" \ + "$DIRECT_EXTERN_ACCESS_CFLAGS $NOPIE_CFLAGS -Wa,-mx86-used-note=yes" \ { protected-data-1b.c } \ {{error_output "pr28875-data.err"}} \ "protected-data-1" \ @@ -1506,7 +1549,7 @@ if { [isnative] && [check_compiler_available] } { { pr22001-1c.c } \ "pr22001-1b" \ "pass.out" \ - "$NOPIE_CFLAGS" \ + "$DIRECT_EXTERN_ACCESS_CFLAGS $NOPIE_CFLAGS" \ ] \ [list \ "Run pr25416-5a (GDesc -> IE -maddress-mode=short)" \ @@ -1574,8 +1617,8 @@ if { [isnative] && [check_compiler_available] } { run_cc_link_tests [list \ [list \ "Build pr22001-1b" \ - "$NOPIE_LDFLAGS -Wl,-z,nocopyreloc,--no-as-needed,-z,notext tmpdir/pr22001-1.so" \ - "$NOPIE_CFLAGS -Wa,-mx86-used-note=yes" \ + "$NOPIE_LDFLAGS -Wl,-z,nocopyreloc,--no-as-needed,-z,notext,-z,noindirect-extern-access tmpdir/pr22001-1.so" \ + "$DIRECT_EXTERN_ACCESS_CFLAGS $NOPIE_CFLAGS -Wa,-mx86-used-note=yes" \ { pr22001-1c.c } \ {{error_output "pr22001-1b.err"}} \ "pr22001-1b" \ @@ -1583,14 +1626,14 @@ if { [isnative] && [check_compiler_available] } { [list \ "Build pr21997-1b" \ "$NOPIE_LDFLAGS -Wl,--no-as-needed,-z,notext tmpdir/pr21997-1.so" \ - "$NOPIE_CFLAGS -Wa,-mx86-used-note=yes" \ + "$DIRECT_EXTERN_ACCESS_CFLAGS $NOPIE_CFLAGS -Wa,-mx86-used-note=yes" \ { pr21997-1c.c } \ {{error_output "pr21997-1b.err"}} \ "pr21997-1b" \ ] \ [list \ "Build lam-u48.so" \ - "-shared -Wl,-z,lam-u48" \ + "-shared -Wl,-z,lam-u48,-z,noindirect-extern-access" \ "" \ {dummy.s} \ {{readelf -n lam-u48.rd}} \ @@ -1598,7 +1641,7 @@ if { [isnative] && [check_compiler_available] } { ] \ [list \ "Build lam-u57.so" \ - "-shared -Wl,-z,lam-u57" \ + "-shared -Wl,-z,lam-u57,-z,noindirect-extern-access" \ "" \ {dummy.s} \ {{readelf -n lam-u57.rd}} \ @@ -1630,23 +1673,23 @@ if { [isnative] && [check_compiler_available] } { [list \ "Run copyreloc-main with PIE without -fPIE" \ "-Wl,--as-needed -pie tmpdir/copyreloc-main.o tmpdir/copyreloc-lib.so" \ - "-Wa,-mx86-used-note=yes" \ + "$DIRECT_EXTERN_ACCESS_CFLAGS -Wa,-mx86-used-note=yes" \ { dummy.s } \ "copyreloc-main" \ "copyreloc-main.out" \ ] \ [list \ "Run pr17689 with PIE without -fPIE" \ - "-Wl,--no-as-needed -pie tmpdir/pr17689b.o tmpdir/pr17689.so" \ - "-Wa,-mx86-used-note=yes" \ + "-Wl,--no-as-needed,-z,noindirect-extern-access -pie tmpdir/pr17689b.o tmpdir/pr17689.so" \ + "$DIRECT_EXTERN_ACCESS_CFLAGS -Wa,-mx86-used-note=yes" \ { dummy.s } \ "pr17689" \ "pr17689.out" \ ] \ [list \ "Run pr17689 with PIE -z now without -fPIE" \ - "-Wl,--as-needed,-z,now -pie tmpdir/pr17689b.o tmpdir/pr17689.so" \ - "-Wa,-mx86-used-note=yes" \ + "-Wl,--as-needed,-z,now,-z,noindirect-extern-access -pie tmpdir/pr17689b.o tmpdir/pr17689.so" \ + "$DIRECT_EXTERN_ACCESS_CFLAGS -Wa,-mx86-used-note=yes" \ { dummy.s } \ "pr17689now" \ "pr17689.out" \ @@ -1721,25 +1764,25 @@ if { [isnative] && [check_compiler_available] } { [list \ "Run pr22001-1a (PIC 1)" \ "$NOPIE_LDFLAGS -Wl,-z,nocopyreloc,--no-as-needed tmpdir/pr22001-1.so" \ - "-Wa,-mx86-used-note=yes" \ + "$DIRECT_EXTERN_ACCESS_CFLAGS -Wa,-mx86-used-note=yes" \ { pr22001-1b.c } \ "pr22001-1a-pic-1" \ "pass.out" \ - "-fPIC" \ + "$DIRECT_EXTERN_ACCESS_CFLAGS -fPIC" \ ] \ [list \ "Run pr22001-1a (PIC 2)" \ "-pie -Wl,-z,nocopyreloc,--no-as-needed tmpdir/pr22001-1.so" \ - "-Wa,-mx86-used-note=yes" \ + "$DIRECT_EXTERN_ACCESS_CFLAGS -Wa,-mx86-used-note=yes" \ { pr22001-1b.c } \ "pr22001-1a-pic-2" \ "pass.out" \ - "-fPIC" \ + "$DIRECT_EXTERN_ACCESS_CFLAGS -fPIC" \ ] \ [list \ "Run pr22001-1b (PIC 1)" \ "$NOPIE_LDFLAGS -Wl,-z,nocopyreloc,--no-as-needed tmpdir/pr22001-1.so" \ - "-Wa,-mx86-used-note=yes" \ + "$DIRECT_EXTERN_ACCESS_CFLAGS -Wa,-mx86-used-note=yes" \ { pr22001-1c.c } \ "pr22001-1b-pic-1" \ "pass.out" \ @@ -1748,7 +1791,7 @@ if { [isnative] && [check_compiler_available] } { [list \ "Run pr22001-1b (PIC 2)" \ "-pie -Wl,-z,nocopyreloc,--no-as-needed tmpdir/pr22001-1.so" \ - "-Wa,-mx86-used-note=yes" \ + "$DIRECT_EXTERN_ACCESS_CFLAGS -Wa,-mx86-used-note=yes" \ { pr22001-1c.c } \ "pr22001-1b-pic-2" \ "pass.out" \ @@ -2167,7 +2210,7 @@ if { [isnative] && [check_compiler_available] } { } } - undefined_weak "$NOPIE_CFLAGS" "$NOPIE_LDFLAGS" + undefined_weak "$DIRECT_EXTERN_ACCESS_CFLAGS $NOPIE_CFLAGS" "$NOPIE_LDFLAGS" undefined_weak "-fPIE" "$NOPIE_LDFLAGS" undefined_weak "-fPIE" "-pie" undefined_weak "-fPIE" "$NOPIE_LDFLAGS -Wl,-z,nodynamic-undefined-weak" @@ -2331,7 +2374,7 @@ run_dump_test "ibt-plt-3b-x32" run_dump_test "ibt-plt-3c-x32" run_dump_test "ibt-plt-3d-x32" -# Skip -z mark-plt tests on MUSL. +# Skip -z mark-plt and --gnu2-tls-tag tests on MUSL. if { [istarget "x86_64-*-musl*"]} { set ASFLAGS "$saved_ASFLAGS" return @@ -2357,6 +2400,30 @@ if { [check_compiler_available] } { {readelf {-W --version-info} mark-plt-1b.rd}} \ "mark-plt-1.so" \ ] \ + [list \ + "Build mark-plt-2.so" \ + "-shared -Wl,--no-as-needed,-z,mark-plt,-z,nopack-relative-relocs" \ + "-fPIC" \ + { mark-plt-2.s } \ + {{readelf {-W --version-info} mark-plt-2.rd}} \ + "mark-plt-2.so" \ + ] \ + [list \ + "Build gnu2-tls-1a.so" \ + "-shared -Wl,--no-as-needed,--gnu2-tls-tag" \ + "-fPIC" \ + { gnu2-tls-1.s } \ + {{readelf {-W --version-info} gnu2-tls-1a.rd}} \ + "gnu2-tls-1a.so" \ + ] \ + [list \ + "Build gnu2-tls-1b.so" \ + "-shared -Wl,--no-as-needed,--no-gnu2-tls-tag" \ + "-fPIC" \ + { gnu2-tls-1.s } \ + {{readelf {-W --version-info} gnu2-tls-1b.rd}} \ + "gnu2-tls-1b.so" \ + ] \ ] } diff --git a/ld/testsuite/lib/ld-lib.exp b/ld/testsuite/lib/ld-lib.exp index 9615271..d1343eb 100644 --- a/ld/testsuite/lib/ld-lib.exp +++ b/ld/testsuite/lib/ld-lib.exp @@ -253,6 +253,8 @@ proc default_ld_link { ld target objects } { proc default_ld_compile { cc source object } { global CFLAGS_FOR_TARGET global CXXFLAGS_FOR_TARGET + global CFLAGS_FOR_TARGET_TEST + global CXXFLAGS_FOR_TARGET_TEST global srcdir global subdir global host_triplet @@ -286,10 +288,14 @@ proc default_ld_compile { cc source object } { } set ccexe [string replace $ccexe 0 [string last "/" $ccexe] ""] + set cflag_test "" + set cxxflag_test "" if {[string match "*++*" $ccexe]} { append flags " $CXXFLAGS_FOR_TARGET" + set cflag_test "$CXXFLAGS_FOR_TARGET_TEST" } else { append flags " $CFLAGS_FOR_TARGET" + set cflag_test "$CFLAGS_FOR_TARGET_TEST" } if [board_info [target_info name] exists cflags] { @@ -300,7 +306,7 @@ proc default_ld_compile { cc source object } { append flags " [board_info [target_info name] multilib_flags]" } - set cmd "$cc $flags $ccflags -c $source -o $object" + set cmd "$cc $flags $ccflags $cflag_test -c $source -o $object" verbose -log "$cmd" set status [remote_exec host [concat sh -c [list "$cmd 2>&1"]] "" "/dev/null" "ld.tmp"] @@ -727,6 +733,8 @@ proc run_ld_link_exec_tests { ldtests args } { global env global CC_FOR_TARGET global CXX_FOR_TARGET + global CFLAGS_FOR_TARGET_TEST + global CXXFLAGS_FOR_TARGET_TEST global errcnt global exec_output global STATIC_LDFLAGS @@ -780,9 +788,9 @@ proc run_ld_link_exec_tests { ldtests args } { lappend objfiles $objfile if { [ string match "c++" $lang ] } { - set cmd "$CXX_FOR_TARGET -c $cflags" + set cmd "$CXX_FOR_TARGET -c $cflags $CXXFLAGS_FOR_TARGET_TEST" } else { - set cmd "$CC_FOR_TARGET -c $cflags" + set cmd "$CC_FOR_TARGET -c $cflags $CFLAGS_FOR_TARGET_TEST" } if ![ld_compile $cmd $srcdir/$subdir/$src_file $objfile] { set failed 1 @@ -799,10 +807,10 @@ proc run_ld_link_exec_tests { ldtests args } { set link_cmd $ld } elseif { [ string match "c++" $lang ] } { set link_proc ld_link - set link_cmd $CXX_FOR_TARGET + set link_cmd "$CXX_FOR_TARGET $CXXFLAGS_FOR_TARGET_TEST" } else { set link_proc ld_link - set link_cmd $CC_FOR_TARGET + set link_cmd "$CC_FOR_TARGET $CFLAGS_FOR_TARGET_TEST" } if { $binfile eq "tmpdir/" } { @@ -860,14 +868,15 @@ proc run_ld_link_exec_tests { ldtests args } { } # List contains test-items with 3 items followed by 2 lists, one item and -# one optional item: +# 2 optional items: # 0:name -# 1:ld or ar options +# 1:leading ld or ar options # 2:compile options # 3:filenames of source files # 4:action and options. # 5:name of output file # 6:language (optional) +# 7:trailing ld options (optional), placed after object files # # Actions: # objdump: Apply objdump options on result. Compare with regex (last arg). @@ -887,6 +896,8 @@ proc run_cc_link_tests { ldtests } { global env global CC_FOR_TARGET global CXX_FOR_TARGET + global CFLAGS_FOR_TARGET_TEST + global CXXFLAGS_FOR_TARGET_TEST global ar global exec_output global STATIC_LDFLAGS @@ -899,6 +910,7 @@ proc run_cc_link_tests { ldtests } { set actions [lindex $testitem 4] set binfile tmpdir/[lindex $testitem 5] set lang [lindex $testitem 6] + set trailing_ldflags [lindex $testitem 7] set objfiles {} set is_unresolved 0 set failed 0 @@ -927,6 +939,7 @@ proc run_cc_link_tests { ldtests } { #verbose -log "actions is $actions" #verbose -log "binfile is $binfile" #verbose -log "lang is $lang" + #verbose -log "trailing_ldflags is $trailing_ldflags" foreach actionlist $actions { set action [lindex $actionlist 0] @@ -966,9 +979,9 @@ proc run_cc_link_tests { ldtests } { lappend objfiles $objfile if { [ string match "c++" $lang ] } { - set cmd "$CXX_FOR_TARGET -c $cflags" + set cmd "$CXX_FOR_TARGET $CXXFLAGS_FOR_TARGET_TEST -c $cflags" } else { - set cmd "$CC_FOR_TARGET -c $cflags" + set cmd "$CC_FOR_TARGET $CFLAGS_FOR_TARGET_TEST -c $cflags" } if ![ld_compile $cmd $srcdir/$subdir/$src_file $objfile] { set failed 1 @@ -984,9 +997,9 @@ proc run_cc_link_tests { ldtests } { reset_vars if { [ string match "c++" $lang ] } { - set cc_cmd $CXX_FOR_TARGET + set cc_cmd "$CXX_FOR_TARGET $CXXFLAGS_FOR_TARGET_TEST" } else { - set cc_cmd $CC_FOR_TARGET + set cc_cmd "$CC_FOR_TARGET $CFLAGS_FOR_TARGET_TEST" } if { $binfile eq "tmpdir/" } { @@ -1006,7 +1019,7 @@ proc run_cc_link_tests { ldtests } { untested $testname continue } - ld_link $cc_cmd $binfile "-L$srcdir/$subdir $ldflags $objfiles" + ld_link $cc_cmd $binfile "-L$srcdir/$subdir $ldflags $objfiles $trailing_ldflags" set ld_output "$exec_output" if { $check_ld(source) == "regexp" } then { @@ -1665,36 +1678,6 @@ proc skip_ctf_tests { } { return 1 } -# Check if the assembler supports SFrame. - -proc check_as_sframe { } { - global check_as_sframe_result - global as - if [info exists check_as_sframe_result] { - return $check_as_sframe_result - } - - # SFrame generation needs CFI support - if { ![check_as_cfi] } { - set check_as_sframe_result 0; - return 0 - } - - set as_file "tmpdir/check_as_sframe.s" - set as_fh [open $as_file w 0666] - puts $as_fh "# Generated file. DO NOT EDIT" - puts $as_fh "\t.cfi_sections \".sframe\"" - puts $as_fh "\t.cfi_startproc" - puts $as_fh "\t.cfi_endproc" - close $as_fh - remote_download host $as_file - verbose -log "Checking SFrame:" - set success [ld_assemble $as $as_file "/dev/null"] - #remote_file host delete $as_file - set check_as_sframe_result $success - return $success -} - proc skip_sframe_tests { } { # FIXME TODO # global enable_libsframe @@ -1703,7 +1686,7 @@ proc skip_sframe_tests { } { # return 1 # } - if [check_as_sframe] { + if [gas_sframe_check] { return 0 } |