diff options
Diffstat (limited to 'lld/test')
92 files changed, 353 insertions, 398 deletions
diff --git a/lld/test/CMakeLists.txt b/lld/test/CMakeLists.txt index 516f333f3c4..2ce4969165e 100644 --- a/lld/test/CMakeLists.txt +++ b/lld/test/CMakeLists.txt @@ -18,7 +18,7 @@ configure_lit_site_cfg( if ( NOT LLD_BUILT_STANDALONE ) set(LLD_TEST_DEPS - lld-core lld-test.deps + lld-test.deps FileCheck not llvm-nm lld llvm-objdump llvm-readobj linker-script-test @@ -68,7 +68,7 @@ else() ${LIT_ARGS} ${CMAKE_CURRENT_BINARY_DIR} COMMENT "Running lld regression tests" - DEPENDS lld-core lld-test.deps + DEPENDS lld-test.deps ) set_target_properties(check-lld PROPERTIES FOLDER "lld tests") endif() diff --git a/lld/test/Driver/lib-search.test b/lld/test/Driver/lib-search.test index 94a369331c3..cd266986603 100644 --- a/lld/test/Driver/lib-search.test +++ b/lld/test/Driver/lib-search.test @@ -1,6 +1,6 @@ -RUN: lld -flavor ld -### -L%p/../elf/Inputs b.o -lfnarchive 2>&1 \ -RUN: | FileCheck %s +RUN: not lld -flavor gnu -t -L%p/../elf/Inputs -lfnarchive 2> %t.err \ +RUN: | FileCheck %s + +# run linker with -t mode to dump full paths to input files -CHECK: -input-search-path={{[^ ]+}}elf/Inputs -CHECK: b.o CHECK: {{[^ ]+}}elf/Inputs{{[\\/]}}libfnarchive.a diff --git a/lld/test/Driver/trivial-driver.test b/lld/test/Driver/trivial-driver.test index 06d0cac73f0..304d171d414 100644 --- a/lld/test/Driver/trivial-driver.test +++ b/lld/test/Driver/trivial-driver.test @@ -1,4 +1,5 @@ -RUN: lld -flavor ld -### -target i686-linux -e adena -o out.a 2>&1 \ -RUN: | FileCheck %s +RUN: lld -flavor gnu --help | FileCheck %s -CHECK: -target i686-linux -entry=adena -output=out.a +CHECK: -L +CHECK: -emit-yaml +CHECK: --noinhibit-exec diff --git a/lld/test/absolute-basic.objtxt b/lld/test/absolute-basic.objtxt index 19772881340..b13e2ac1d0a 100644 --- a/lld/test/absolute-basic.objtxt +++ b/lld/test/absolute-basic.objtxt @@ -1,4 +1,4 @@ -# RUN: lld-core %s | FileCheck %s +# RUN: lld -core %s | FileCheck %s # # Test that absolute symbols are parsed and preserved diff --git a/lld/test/absolute-local.objtxt b/lld/test/absolute-local.objtxt index e9324255cec..1ba4c7f0432 100644 --- a/lld/test/absolute-local.objtxt +++ b/lld/test/absolute-local.objtxt @@ -1,4 +1,4 @@ -# RUN: lld-core %s | FileCheck %s +# RUN: lld -core %s | FileCheck %s # # Test that absolute symbols with local scope do not cause name conflict diff --git a/lld/test/archive-basic.objtxt b/lld/test/archive-basic.objtxt index 80d945457f8..c93310762bd 100644 --- a/lld/test/archive-basic.objtxt +++ b/lld/test/archive-basic.objtxt @@ -1,4 +1,4 @@ -# RUN: lld-core %s | FileCheck %s +# RUN: lld -core %s | FileCheck %s # # Tests archives in YAML. Tests that an undefined in a regular file will load diff --git a/lld/test/archive-chain.objtxt b/lld/test/archive-chain.objtxt index 286b60da22a..191b8520654 100644 --- a/lld/test/archive-chain.objtxt +++ b/lld/test/archive-chain.objtxt @@ -1,4 +1,4 @@ -# RUN: lld-core %s | FileCheck %s +# RUN: lld -core %s | FileCheck %s # # Tests that an undefine in one archive can force a load from another archive. diff --git a/lld/test/archive-tentdef-search.objtxt b/lld/test/archive-tentdef-search.objtxt index 730bf59e0d4..f1802a19372 100644 --- a/lld/test/archive-tentdef-search.objtxt +++ b/lld/test/archive-tentdef-search.objtxt @@ -1,8 +1,8 @@ -# RUN: lld-core -commons-search-archives=false %s | FileCheck -check-prefix=CHK1 %s -# RUN: lld-core -commons-search-archives=true %s | FileCheck -check-prefix=CHK2 %s +# RUN: lld -core %s | FileCheck -check-prefix=CHK1 %s +# RUN: lld -core --commons-search-archives %s | FileCheck -check-prefix=CHK2 %s # -# Tests that -commons_search_archives cause core linker to look for overrides +# Tests that -commons-search-archives cause core linker to look for overrides # of tentative definition in archives, and that not using that option # does not search. # diff --git a/lld/test/auto-hide-coalesce.objtxt b/lld/test/auto-hide-coalesce.objtxt index 8d621b75400..24b2e1c4e65 100644 --- a/lld/test/auto-hide-coalesce.objtxt +++ b/lld/test/auto-hide-coalesce.objtxt @@ -1,4 +1,4 @@ -# RUN: lld-core %s | FileCheck %s +# RUN: lld -core %s | FileCheck %s # # Tests auto-hide bit during coalescing diff --git a/lld/test/constants-coalesce.objtxt b/lld/test/constants-coalesce.objtxt index da388e50fe3..e64783720a7 100644 --- a/lld/test/constants-coalesce.objtxt +++ b/lld/test/constants-coalesce.objtxt @@ -1,4 +1,4 @@ -# RUN: lld-core %s | FileCheck %s +# RUN: lld -core %s | FileCheck %s # # Test that duplicate merge-by-content anonymous constants are coalesced diff --git a/lld/test/cstring-coalesce.objtxt b/lld/test/cstring-coalesce.objtxt index 5723299c110..914740933ff 100644 --- a/lld/test/cstring-coalesce.objtxt +++ b/lld/test/cstring-coalesce.objtxt @@ -1,4 +1,4 @@ -# RUN: lld-core %s | FileCheck %s +# RUN: lld -core %s | FileCheck %s # # Test that duplicate c-strings are coalesced diff --git a/lld/test/custom-section.objtxt b/lld/test/custom-section.objtxt index f92b3fdc91f..faf4f4310d1 100644 --- a/lld/test/custom-section.objtxt +++ b/lld/test/custom-section.objtxt @@ -1,4 +1,4 @@ -# RUN: lld-core %s | FileCheck %s +# RUN: lld -core %s | FileCheck %s # # Test that custom sections are preserved diff --git a/lld/test/darwin/hello-world.objtxt b/lld/test/darwin/hello-world.objtxt index 0d96c0746b0..24a496e73e2 100644 --- a/lld/test/darwin/hello-world.objtxt +++ b/lld/test/darwin/hello-world.objtxt @@ -1,5 +1,5 @@ -# RUN: lld-core -writer=mach-o -stubs-pass %s -o %t && llvm-nm %t | FileCheck %s - +# RUN: lld -flavor darwin -arch x86_64 -macosx_version_min 10.8 %s -o %t && \ +# RUN: llvm-nm %t | FileCheck %s # # Test that hello-world can be linked into a mach-o executable # @@ -14,10 +14,10 @@ defined-atoms: 31, C0, 5D, C3 ] references: - offset: 7 - kind: pcrel32 + kind: ripRel32 target: LC1 - offset: 12 - kind: call32 + kind: branch32 target: _printf - ref-name: LC1 diff --git a/lld/test/dead-strip-attributes.objtxt b/lld/test/dead-strip-attributes.objtxt index a5d21b67245..dcb35a21e26 100644 --- a/lld/test/dead-strip-attributes.objtxt +++ b/lld/test/dead-strip-attributes.objtxt @@ -1,4 +1,4 @@ -# RUN: lld-core %s | FileCheck %s +# RUN: lld -core %s | FileCheck %s # # Test that dead strip attributes are preserved diff --git a/lld/test/dead-strip-basic.objtxt b/lld/test/dead-strip-basic.objtxt index 206e3d8d673..94af8e2b1df 100644 --- a/lld/test/dead-strip-basic.objtxt +++ b/lld/test/dead-strip-basic.objtxt @@ -1,5 +1,5 @@ -# RUN: lld-core -dead-strip=true %s | FileCheck -check-prefix=CHK1 %s -# RUN: lld-core -dead-strip=false %s | FileCheck -check-prefix=CHK2 %s +# RUN: lld -core --dead-strip %s | FileCheck -check-prefix=CHK1 %s +# RUN: lld -core %s | FileCheck -check-prefix=CHK2 %s # # Test that -dead-strip removes unreachable code and data diff --git a/lld/test/dead-strip-globals.objtxt b/lld/test/dead-strip-globals.objtxt index 234600b3a13..568eb71511d 100644 --- a/lld/test/dead-strip-globals.objtxt +++ b/lld/test/dead-strip-globals.objtxt @@ -1,5 +1,5 @@ -# RUN: lld-core -dead-strip -keep-globals=true %s | FileCheck -check-prefix=CHK1 %s -# RUN: lld-core -dead-strip -keep-globals=false %s | FileCheck -check-prefix=CHK2 %s +# RUN: lld -core --dead-strip --keep-globals %s | FileCheck -check-prefix=CHK1 %s +# RUN: lld -core --dead-strip %s | FileCheck -check-prefix=CHK2 %s # # Test that -keep-globals prevents -dead-strip from removing globals. diff --git a/lld/test/elf/Hexagon/dynlib-data.test b/lld/test/elf/Hexagon/dynlib-data.test index 4626531f28c..76eb19a8d60 100644 --- a/lld/test/elf/Hexagon/dynlib-data.test +++ b/lld/test/elf/Hexagon/dynlib-data.test @@ -1,5 +1,5 @@ -RUN: lld -core -target hexagon %p/Inputs/dynobj-data.o \ -RUN: -output=%t -output=%t -noinhibit-exec -output-type=shared +RUN: lld -flavor gnu -target hexagon %p/Inputs/dynobj-data.o \ +RUN: -o %t --noinhibit-exec -shared RUN: llvm-objdump -s %t > %t1 RUN: FileCheck -check-prefix=CHECKRELOCS %s < %t1 diff --git a/lld/test/elf/Hexagon/dynlib-gotoff.test b/lld/test/elf/Hexagon/dynlib-gotoff.test index 7273ed4e2a6..1bff8fe4422 100644 --- a/lld/test/elf/Hexagon/dynlib-gotoff.test +++ b/lld/test/elf/Hexagon/dynlib-gotoff.test @@ -1,5 +1,5 @@ -RUN: lld -core -target hexagon %p/Inputs/dynobj.o \ -RUN: -output=%t -emit-yaml -noinhibit-exec -output-type=shared +RUN: lld -flavor gnu -target hexagon %p/Inputs/dynobj.o \ +RUN: -o %t -emit-yaml -shared --noinhibit-exec RUN: FileCheck -check-prefix=CHECKGOTPLT %s < %t - name: __got0 @@ -71,7 +71,7 @@ CHECKGOTPLT: - name: .text CHECKGOTPLT: alignment: 2^2 CHECKGOTPLT: section-name: .text CHECKGOTPLT: references: -CHECKGOTPLT: - kind: <unknown> +CHECKGOTPLT: - kind: layout-after CHECKGOTPLT: offset: 0 CHECKGOTPLT: target: fn2 CHECKGOTPLT: - name: fn2 diff --git a/lld/test/elf/Hexagon/dynlib-hash.test b/lld/test/elf/Hexagon/dynlib-hash.test index dd7979e4ed5..289d55e8a99 100644 --- a/lld/test/elf/Hexagon/dynlib-hash.test +++ b/lld/test/elf/Hexagon/dynlib-hash.test @@ -1,5 +1,5 @@ -RUN: lld -core -target hexagon %p/Inputs/dynobj.o \ -RUN: -output=%t -output=%t -noinhibit-exec -output-type=shared +RUN: lld -flavor gnu -target hexagon %p/Inputs/dynobj.o \ +RUN: -o %t --noinhibit-exec -shared RUN: llvm-objdump -s %t > %t1 RUN: FileCheck -check-prefix=CHECKHASH %s < %t1 diff --git a/lld/test/elf/Hexagon/dynlib-syms.test b/lld/test/elf/Hexagon/dynlib-syms.test index 621ce4165a0..1297937e875 100644 --- a/lld/test/elf/Hexagon/dynlib-syms.test +++ b/lld/test/elf/Hexagon/dynlib-syms.test @@ -1,5 +1,5 @@ -RUN: lld -core -target hexagon %p/Inputs/dynobj.o \ -RUN: -output=%t -output=%t -noinhibit-exec -output-type=shared +RUN: lld -flavor gnu -target hexagon %p/Inputs/dynobj.o \ +RUN: -o %t --noinhibit-exec -shared RUN: llvm-nm -n -s %t > %t1 RUN: FileCheck -check-prefix=CHECKSYMS %s < %t1 diff --git a/lld/test/elf/Hexagon/dynlib.test b/lld/test/elf/Hexagon/dynlib.test index 6d062260dd9..53d72d51d46 100644 --- a/lld/test/elf/Hexagon/dynlib.test +++ b/lld/test/elf/Hexagon/dynlib.test @@ -1,5 +1,4 @@ -RUN: lld -core -target hexagon %p/Inputs/use-shared.hexagon \ -RUN: -output=%t1 -output-type=shared +RUN: lld -flavor gnu -target hexagon %p/Inputs/use-shared.hexagon -shared -o %t1 RUN: llvm-readobj -dyn-symbols %t1 > %t2 RUN: FileCheck -check-prefix=DYNSYMS %s < %t2 diff --git a/lld/test/elf/Hexagon/hexagon-got-plt-order.test b/lld/test/elf/Hexagon/hexagon-got-plt-order.test index 366d67abe88..7600ebe59fc 100644 --- a/lld/test/elf/Hexagon/hexagon-got-plt-order.test +++ b/lld/test/elf/Hexagon/hexagon-got-plt-order.test @@ -1,5 +1,4 @@ -RUN: lld -core -target hexagon %p/Inputs/got-plt-order.o \ -RUN: -output=%t -noinhibit-exec -output-type=shared +RUN: lld -flavor gnu -target hexagon %p/Inputs/got-plt-order.o -o %t -shared RUN: llvm-objdump -section-headers %t | FileCheck %s CHECK: .got diff --git a/lld/test/elf/Hexagon/hexagon-plt-setup.test b/lld/test/elf/Hexagon/hexagon-plt-setup.test index 0e36169bd60..91989c618cb 100644 --- a/lld/test/elf/Hexagon/hexagon-plt-setup.test +++ b/lld/test/elf/Hexagon/hexagon-plt-setup.test @@ -1,15 +1,15 @@ -RUN: lld -core -target hexagon %p/Inputs/use-shared.hexagon \ -RUN: -emit-yaml -output=%t2 -noinhibit-exec -output-type=dynamic +RUN: lld -flavor gnu -target hexagon %p/Inputs/use-shared.hexagon \ +RUN: -emit-yaml -o %t2 RUN: FileCheck %s < %t2 CHECK: - name: fn3 CHECK: references: CHECK: - kind: R_HEX_B22_PCREL CHECK: offset: 4 - target: __plt_fn1 + target: CHECK: - kind: R_HEX_B22_PCREL CHECK: offset: 8 - target: __plt_fn2 -CHECK: - kind: <unknown> + target: +CHECK: - kind: layout-before CHECK: offset: 0 CHECK: target: fn1 diff --git a/lld/test/elf/Hexagon/rela-order.test b/lld/test/elf/Hexagon/rela-order.test index b3f4ce066f8..2f3814add0c 100644 --- a/lld/test/elf/Hexagon/rela-order.test +++ b/lld/test/elf/Hexagon/rela-order.test @@ -1,5 +1,5 @@ -RUN: lld -core -target hexagon %p/Inputs/dynobj.o \ -RUN: -output=%t -noinhibit-exec -output-type=shared +RUN: lld -flavor gnu -target hexagon %p/Inputs/dynobj.o -shared \ +RUN: --noinhibit-exec -o %t RUN: llvm-objdump -section-headers %t | FileCheck %s CHECK: .dynsym diff --git a/lld/test/elf/Hexagon/sda-base.test b/lld/test/elf/Hexagon/sda-base.test index 5db1dc381f2..0bab92abf68 100644 --- a/lld/test/elf/Hexagon/sda-base.test +++ b/lld/test/elf/Hexagon/sda-base.test @@ -1,4 +1,4 @@ -RUN: lld-core -arch hexagon -reader ELF %p/Inputs/sda-base.o -writer ELF -o %t1 +RUN: lld -flavor gnu -target hexagon %p/Inputs/sda-base.o -o %t1 --noinhibit-exec RUN: llvm-nm -n %t1 | FileCheck %s -check-prefix=sdabase -sdabase: 00001000 A _SDA_BASE_ +sdabase: 00002000 A _SDA_BASE_ diff --git a/lld/test/elf/X86_64/dynlib-nointerp-section.test b/lld/test/elf/X86_64/dynlib-nointerp-section.test index e41a781f0f4..dca3d925b38 100644 --- a/lld/test/elf/X86_64/dynlib-nointerp-section.test +++ b/lld/test/elf/X86_64/dynlib-nointerp-section.test @@ -1,5 +1,4 @@ -RUN: lld -core -target x86_64 %p/Inputs/no-interp-section.o -output=%t \ -RUN: -noinhibit-exec -output-type=shared +RUN: lld -flavor gnu -target x86_64 %p/Inputs/no-interp-section.o -o %t -shared RUN: llvm-objdump -section-headers %t | FileCheck %s CHECK-NOT: .interp diff --git a/lld/test/elf/X86_64/multi-weak-override.test b/lld/test/elf/X86_64/multi-weak-override.test index 8332a75ffc6..176bedaac32 100644 --- a/lld/test/elf/X86_64/multi-weak-override.test +++ b/lld/test/elf/X86_64/multi-weak-override.test @@ -1,15 +1,16 @@ # Test for weak symbol getting overridden -RUN: lld-core -reader ELF -writer ELF -arch x86_64 %p/Inputs/multi-weak.o \ -RUN: %p/Inputs/multi-ovrd.o -o %t +RUN: lld -flavor gnu -target x86_64 %p/Inputs/multi-weak.o \ +RUN: %p/Inputs/multi-ovrd.o -o %t -e main --noinhibit-exec RUN: llvm-nm -n %t | FileCheck -check-prefix=WEAKORDER %s -RUN: lld-core -reader ELF -arch x86_64 %p/Inputs/multi-weak.o \ -RUN: %p/Inputs/multi-ovrd.o -layout-pass=true -o %t2 +RUN: lld -flavor gnu -target x86_64 %p/Inputs/multi-weak.o \ +RUN: %p/Inputs/multi-ovrd.o -emit-yaml -o %t2 --noinhibit-exec RUN: FileCheck -check-prefix=WEAKATOMSORDER %s < %t2 -WEAKORDER: 0040011c T f -WEAKORDER: 0040012c T g +WEAKORDER: 0040020c T f +WEAKORDER: 0040021c T g WEAKATOMSORDER: - ref-name: L002 WEAKATOMSORDER: - ref-name: L003 WEAKATOMSORDER: - name: f WEAKATOMSORDER: - name: g + diff --git a/lld/test/elf/X86_64/multi-weak-syms-order.test b/lld/test/elf/X86_64/multi-weak-syms-order.test index f5376d8c230..ce6983fd037 100644 --- a/lld/test/elf/X86_64/multi-weak-syms-order.test +++ b/lld/test/elf/X86_64/multi-weak-syms-order.test @@ -1,19 +1,19 @@ # Test for weak symbol getting overridden -RUN: lld-core -reader ELF -writer ELF -arch x86_64 %p/Inputs/multi-weak.o \ -RUN: -o %t +RUN: lld -flavor gnu -target x86_64 %p/Inputs/multi-weak.o -o %t --noinhibit-exec RUN: llvm-nm -n %t | FileCheck -check-prefix=WEAKORDER %s -RUN: lld-core -reader ELF -arch x86_64 %p/Inputs/multi-weak.o \ -RUN: -layout-pass=true -o %t2 +RUN: lld -flavor gnu -target x86_64 %p/Inputs/multi-weak.o -o %t2 -emit-yaml --noinhibit-exec RUN: FileCheck -check-prefix=WEAKATOMSORDER %s < %t2 -WEAKORDER: 004000c0 T fn -WEAKORDER: 004000cb T .text -WEAKORDER: 004000cb T f -WEAKORDER: 004000db T .text -WEAKORDER: 004000db T g -WEAKORDER: 004000eb T main +WEAKORDER: 004001b0 T fn +WEAKORDER: 004001bb T .text +WEAKORDER: 004001bb T f +WEAKORDER: 004001cb T .text +WEAKORDER: 004001cb T g +WEAKORDER: 004001db T main WEAKATOMSORDER: - name: f WEAKATOMSORDER: - ref-name: L004 WEAKATOMSORDER: - name: g WEAKATOMSORDER: - ref-name: L005 + + diff --git a/lld/test/elf/X86_64/weak-override.test b/lld/test/elf/X86_64/weak-override.test index ba04fb6c102..4da3b4ef37c 100644 --- a/lld/test/elf/X86_64/weak-override.test +++ b/lld/test/elf/X86_64/weak-override.test @@ -1,12 +1,12 @@ # Test for weak symbol getting overridden -RUN: lld-core -reader ELF -writer ELF -arch x86_64 %p/Inputs/weak.o \ -RUN: %p/Inputs/ovrd.o -o %t +RUN: lld -flavor gnu -target x86_64 %p/Inputs/weak.o %p/Inputs/ovrd.o \ +RUN: -o %t --noinhibit-exec RUN: llvm-nm %t | FileCheck -check-prefix=WEAKORDER %s -RUN: lld-core -reader ELF -arch x86_64 %p/Inputs/weak.o \ -RUN: %p/Inputs/ovrd.o -layout-pass=true -o %t2 +RUN: lld -flavor gnu -target x86_64 %p/Inputs/weak.o \ +RUN: %p/Inputs/ovrd.o -o %t2 -emit-yaml --noinhibit-exec RUN: FileCheck -check-prefix=WEAKATOMSORDER %s < %t2 -WEAKORDER: 004000fc T f +WEAKORDER: 004001ec T f WEAKATOMSORDER: - name: .text WEAKATOMSORDER: references: @@ -34,7 +34,7 @@ WEAKATOMSORDER: scope: global WEAKATOMSORDER: content: [ 55, 48, 89, E5, B8, 00, 00, 00, 00, E8, 00, 00, WEAKATOMSORDER: 00, 00, B8, 00, 00, 00, 00, 5D, C3 ] WEAKATOMSORDER: references: -WEAKATOMSORDER: - kind: call32 +WEAKATOMSORDER: - kind: R_X86_64_PC32 WEAKATOMSORDER: offset: 10 WEAKATOMSORDER: target: f WEAKATOMSORDER: addend: -4 diff --git a/lld/test/elf/X86_64/weak-zero-sized.test b/lld/test/elf/X86_64/weak-zero-sized.test index 4ba2c0fc614..2e9eaf868dd 100644 --- a/lld/test/elf/X86_64/weak-zero-sized.test +++ b/lld/test/elf/X86_64/weak-zero-sized.test @@ -1,12 +1,12 @@ # Test for zero sized weak atoms, there is only a single weak atom -RUN: lld-core -reader ELF -writer ELF -arch x86_64 %p/Inputs/weak-zero-sized.o \ -RUN: -o %t +RUN: lld -flavor gnu -target x86_64 %p/Inputs/weak-zero-sized.o -o %t \ +RUN: --noinhibit-exec RUN: llvm-nm %t | FileCheck -check-prefix=WEAKORDER %s -RUN: lld-core -reader ELF -arch x86_64 %p/Inputs/weak-zero-sized.o \ -RUN: -layout-pass=true -o %t2 +RUN: lld -flavor gnu -target x86_64 %p/Inputs/weak-zero-sized.o \ +RUN: -emit-yaml -o %t2 --noinhibit-exec RUN: FileCheck -check-prefix=WEAKATOMSORDER %s < %t2 -WEAKORDER: 004000b0 T _start +WEAKORDER: 004001a4 T _start WEAKATOMSORDER: - name: .text WEAKATOMSORDER: alignment: 2^2 diff --git a/lld/test/elf/abs.objtxt b/lld/test/elf/abs.objtxt index 1466831d35f..fb208e1e98c 100644 --- a/lld/test/elf/abs.objtxt +++ b/lld/test/elf/abs.objtxt @@ -9,7 +9,7 @@ # built using: "gcc -m32" # -RUN: lld-core -reader ELF %p/Inputs/abs-test.i386 | FileCheck -check-prefix=YAML %s +RUN: lld -flavor gnu -emit-yaml -r %p/Inputs/abs-test.i386 | FileCheck -check-prefix=YAML %s YAML: absolute-atoms: YAML: - name: absLocalSymbol diff --git a/lld/test/elf/archive-elf-forceload.objtxt b/lld/test/elf/archive-elf-forceload.objtxt index 331cb995663..1c2bc385a89 100644 --- a/lld/test/elf/archive-elf-forceload.objtxt +++ b/lld/test/elf/archive-elf-forceload.objtxt @@ -23,7 +23,9 @@ # } # gcc -c main.c fn.c fn1.c -RUN: lld-core -reader ELF %p/Inputs/mainobj.x86_64 %p/Inputs/libfnarchive.a -force-load | FileCheck -check-prefix FORCELOAD %s +RUN: lld -flavor gnu -target x86_64-linux -e main %p/Inputs/mainobj.x86_64 \ +RUN: %p/Inputs/libfnarchive.a --force-load -emit-yaml \ +RUN: | FileCheck -check-prefix FORCELOAD %s FORCELOAD: defined-atoms: FORCELOAD: - name: fn1 diff --git a/lld/test/elf/archive-elf.objtxt b/lld/test/elf/archive-elf.objtxt index 57d8f90be84..fb377faf5d0 100644 --- a/lld/test/elf/archive-elf.objtxt +++ b/lld/test/elf/archive-elf.objtxt @@ -23,7 +23,7 @@ # } # gcc -c main.c fn.c fn1.c -RUN: lld-core -reader ELF %p/Inputs/mainobj.x86_64 %p/Inputs/libfnarchive.a | FileCheck -check-prefix NOFORCELOAD %s +RUN: lld -flavor gnu -emit-yaml -r %p/Inputs/mainobj.x86_64 %p/Inputs/libfnarchive.a | FileCheck -check-prefix NOFORCELOAD %s NOFORCELOAD: defined-atoms: NOFORCELOAD: - name: fn diff --git a/lld/test/elf/branch.objtxt b/lld/test/elf/branch.objtxt index aa1f5a4c9f3..7110840d621 100644 --- a/lld/test/elf/branch.objtxt +++ b/lld/test/elf/branch.objtxt @@ -1,24 +1,19 @@ -RUN: lld-core -arch hexagon -reader ELF %p/Inputs/branch-test.hexagon %p/Inputs/target-test.hexagon | FileCheck %s -check-prefix hexagon-yaml -RUN: lld-core -arch hexagon -reader ELF -writer ELF -o %t1 %p/Inputs/branch-test.hexagon %p/Inputs/target-test.hexagon +RUN: lld -flavor gnu -target hexagon -static -emit-yaml %p/Inputs/branch-test.hexagon %p/Inputs/target-test.hexagon | FileCheck %s -check-prefix hexagon-yaml +RUN: lld -flavor gnu -target hexagon -e target -o %t1 %p/Inputs/branch-test.hexagon %p/Inputs/target-test.hexagon RUN: elf-dump %t1 | FileCheck -check-prefix=hexagon-elfdump %s hexagon-yaml: - name: back hexagon-yaml: scope: global hexagon-yaml: content: [ 00, C0, 00, 7F, 00, C0, 00, 5A, 00, 00, 00, 00, hexagon-yaml: 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00 ] -hexagon-yaml: section-choice: custom-required -hexagon-yaml: section-name: .text - hexagon-yaml: references: -hexagon-yaml: - kind: -hexagon-yaml: offset: 4 -hexagon-yaml: target: target +hexagon-yaml: - kind: +hexagon-yaml: offset: 4 +hexagon-yaml: target: target hexagon-yaml: - name: target hexagon-yaml: scope: global hexagon-yaml: content: [ 00, C0, 00, 5A ] -hexagon-yaml: section-choice: custom-required -hexagon-yaml: section-name: .text hexagon-yaml: references: hexagon-yaml: - kind: hexagon-yaml: offset: 0 diff --git a/lld/test/elf/check.objtxt b/lld/test/elf/check.objtxt index f16f1d7a1a1..337c81a59bb 100644 --- a/lld/test/elf/check.objtxt +++ b/lld/test/elf/check.objtxt @@ -1,7 +1,17 @@ -RUN: lld-core -reader ELF %p/Inputs/object-test.elf-i386 | FileCheck %s -check-prefix ELF-i386 -RUN: lld-core -arch hexagon -reader ELF %p/Inputs/object-test.elf-hexagon | FileCheck %s -check-prefix ELF-hexagon +RUN: lld -flavor gnu -target i386 -e global_func --noinhibit-exec -emit-yaml %p/Inputs/object-test.elf-i386 | FileCheck %s -check-prefix ELF-i386 +RUN: lld -flavor gnu -target hexagon -e global_func --noinhibit-exec -emit-yaml %p/Inputs/object-test.elf-hexagon | FileCheck %s -check-prefix ELF-hexagon ELF-i386:defined-atoms: +ELF-i386: - name: tentative +ELF-i386: scope: global +ELF-i386: type: zero-fill +ELF-i386: merge: as-tentative + +ELF-i386: - name: common_symbol +ELF-i386: scope: global +ELF-i386: type: zero-fill +ELF-i386: merge: as-tentative + ELF-i386: - name: global_func ELF-i386: scope: global ELF-i386: content: [ 55, 89, E5, 83, EC, 18, C7, 04, 24, 00, 00, 00, @@ -36,16 +46,6 @@ ELF-i386: content: [ 55, 89, E5, 5D, C3 ] ELF-i386: section-choice: custom-required ELF-i386: section-name: special_section -ELF-i386: - name: tentative -ELF-i386: scope: global -ELF-i386: type: zero-fill -ELF-i386: merge: as-tentative - -ELF-i386: - name: common_symbol -ELF-i386: scope: global -ELF-i386: type: zero-fill -ELF-i386: merge: as-tentative - ELF-i386:undefined-atoms: ELF-i386: - name: puts @@ -53,7 +53,17 @@ ELF-i386:absolute-atoms: ELF-i386: - name: sample.c ELF-i386: value: 0x0 -ELF-hexagon:atoms: +ELF-hexagon:defined-atoms: +ELF-hexagon: - name: tentative +ELF-hexagon: scope: global +ELF-hexagon: type: zero-fill +ELF-hexagon: merge: as-tentative + +ELF-hexagon: - name: common_symbol +ELF-hexagon: scope: global +ELF-hexagon: type: zero-fill +ELF-hexagon: merge: as-tentative + ELF-hexagon: - name: global_func ELF-hexagon: scope: global ELF-hexagon: content: [ 00, C0, 9D, A0, 00, 40, 00, 00, 00, C0, 00, 78, @@ -88,16 +98,6 @@ ELF-hexagon: content: [ 00, C0, 9D, A0, 1E, C0, 1E, 96 ] ELF-hexagon: section-choice: custom-required ELF-hexagon: section-name: special_section -ELF-hexagon: - name: tentative -ELF-hexagon: scope: global -ELF-hexagon: type: zero-fill -ELF-hexagon: merge: as-tentative - -ELF-hexagon: - name: common_symbol -ELF-hexagon: scope: global -ELF-hexagon: type: zero-fill -ELF-hexagon: merge: as-tentative - ELF-hexagon: undefined-atoms: ELF-hexagon: - name: puts diff --git a/lld/test/elf/common.test b/lld/test/elf/common.test index 85810e43f14..46fcfe39d48 100644 --- a/lld/test/elf/common.test +++ b/lld/test/elf/common.test @@ -1,5 +1,5 @@ -RUN: lld -core -target x86_64-linux -output=%t %p/Inputs/relocs.x86-64 \ -RUN: -output-type=static +RUN: lld -flavor gnu -target x86_64-linux -o %t %p/Inputs/relocs.x86-64 \ +RUN: -e _start -static RUN: llvm-readobj -t %t | FileCheck %s CHECK: Symbol { diff --git a/lld/test/elf/dynamic-segorder.test b/lld/test/elf/dynamic-segorder.test index 57fa661f289..b09249ae228 100644 --- a/lld/test/elf/dynamic-segorder.test +++ b/lld/test/elf/dynamic-segorder.test @@ -1,6 +1,5 @@ -RUN: lld -core -target x86_64-linux %p/Inputs/tls.x86-64 \ -RUN: %p/Inputs/shared.so-x86-64 -output=%t -entry=main \ -RUN: -output-type=dynamic +RUN: lld -flavor gnu -target x86_64-linux %p/Inputs/tls.x86-64 \ +RUN: %p/Inputs/shared.so-x86-64 -o %t -e main RUN: llvm-objdump -p %t | FileCheck %s CHECK: PHDR diff --git a/lld/test/elf/dynamic.test b/lld/test/elf/dynamic.test index fa2e5d7174a..b3c16989a6d 100644 --- a/lld/test/elf/dynamic.test +++ b/lld/test/elf/dynamic.test @@ -1,26 +1,26 @@ -RUN: lld -core -target x86_64-linux %p/Inputs/use-shared.x86-64 \ -RUN: %p/Inputs/shared.so-x86-64 -output=%t -entry=main \ -RUN: -output-type=dynamic -RUN: lld -core -target x86_64-linux %p/Inputs/use-shared.x86-64 \ -RUN: %p/Inputs/shared.so-x86-64 -emit-yaml -output=%t2 -noinhibit-exec \ -RUN: -output-type=dynamic +RUN: lld -flavor gnu -target x86_64-linux %p/Inputs/use-shared.x86-64 \ +RUN: %p/Inputs/shared.so-x86-64 -o %t -e main +RUN: lld -flavor gnu -target x86_64-linux %p/Inputs/use-shared.x86-64 \ +RUN: %p/Inputs/shared.so-x86-64 -emit-yaml -o %t2 --noinhibit-exec RUN: llvm-objdump -p %t >> %t2 RUN: llvm-readobj -s -dyn-symbols -dynamic-table %t >> %t2 RUN: FileCheck %s < %t2 CHECK: type: got -CHECK: R_X86_64_JUMP_SLOT +CHECK: references: +CHECK: kind: R_X86_64_JUMP_SLOT CHECK: name: main CHECK: kind: R_X86_64_PC32 -CHECK: target: [[PLTNAME:[-a-zA-Z0-9_]+]] +CHECK: offset: 18 +CHECK: target: [[PLTNAME:[-a-zA-Z0-9_]+]] CHECK: name: [[PLTNAME]] CHECK: type: stub CHECK: shared-library-atoms: -CHECK: name: foo -CHECK: load-name: shared.so-x86-64 +CHECK: name: foo +CHECK: load-name: shared.so-x86-64 CHECK: PHDR off 0x{{0+}}40 CHECK: INTERP diff --git a/lld/test/elf/entry.objtxt b/lld/test/elf/entry.objtxt index 66422bceba9..1cc600cd655 100644 --- a/lld/test/elf/entry.objtxt +++ b/lld/test/elf/entry.objtxt @@ -8,12 +8,12 @@ # } # -# RUN: lld-core -reader YAML %s -writer ELF --entry=_entrypoint -o %t1 +# RUN: lld -flavor gnu %s -e _entrypoint --noinhibit-exec -o %t1 # RUN: llvm-nm -n %t1 | FileCheck %s # -# CHECK: 00000080 T main -# CHECK: 00001000 A _end -# CHECK: 00001000 A end +# CHECK: 004001b0 T main +# CHECK: 00401000 A _end +# CHECK: 00401000 A end # CHECK: U _entrypoint defined-atoms: @@ -52,6 +52,6 @@ defined-atoms: section-name: .eh_frame permissions: r-- references: - - kind: call32 + - kind: R_X86_64_PC32 offset: 32 target: .text diff --git a/lld/test/elf/gotpcrel.test b/lld/test/elf/gotpcrel.test index 42300ba6710..a2a87b0fddc 100644 --- a/lld/test/elf/gotpcrel.test +++ b/lld/test/elf/gotpcrel.test @@ -1,6 +1,6 @@ -RUN: lld -core -target x86_64-linux -output=- -entry=main -output-type=static \ -RUN: %p/Inputs/gotpcrel.x86-64 -emit-yaml -noinhibit-exec \ -RUN: | FileCheck %s -check-prefix=YAML +RUN: lld -flavor gnu -target x86_64-linux -static -e main -emit-yaml \ +RUN: --noinhibit-exec %p/Inputs/gotpcrel.x86-64 \ +RUN: | FileCheck %s -check-prefix=YAML YAML: name: [[NULLGOT:[a-zA-Z0-9_]+]] YAML: content: [ 00, 00, 00, 00, 00, 00, 00, 00 ] @@ -11,7 +11,11 @@ YAML: kind: R_X86_64_64 YAML: target: main YAML: name: main -YAML: kind: R_X86_64_PC32 -YAML: target: [[NULLGOT]] -YAML: kind: R_X86_64_PC32 -YAML: target: [[MAINGOT]] +YAML: references: +YAML: kind: R_X86_64_PC32 +YAML: offset: 3 +YAML: target: [[NULLGOT]] +YAML: kind: R_X86_64_PC32 +YAML: offset: 10 +YAML: target: [[MAINGOT]] + diff --git a/lld/test/elf/hexagon-quickdata-sort.test b/lld/test/elf/hexagon-quickdata-sort.test index 952ed6ed4d7..199cb9d1afc 100644 --- a/lld/test/elf/hexagon-quickdata-sort.test +++ b/lld/test/elf/hexagon-quickdata-sort.test @@ -1,12 +1,12 @@ -RUN: lld-core -arch hexagon -reader ELF %p/Inputs/quickdata-sort-test.o.elf-hexagon -writer ELF -o %t1 +RUN: lld -flavor gnu -target hexagon %p/Inputs/quickdata-sort-test.o.elf-hexagon -o %t1 --noinhibit-exec RUN: llvm-nm -n %t1 | FileCheck %s -check-prefix=quickdataSort -quickdataSort: 00001000 D A1 -quickdataSort: 00001001 D AA1 -quickdataSort: 00001002 D B1 -quickdataSort: 00001004 D BB1 -quickdataSort: 00001008 D C1 -quickdataSort: 0000100c D CC1 -quickdataSort: 00001010 D D1 -quickdataSort: 00001018 D DD1 +quickdataSort: 00002000 D A1 +quickdataSort: 00002001 D AA1 +quickdataSort: 00002002 D B1 +quickdataSort: 00002004 D BB1 +quickdataSort: 00002008 D C1 +quickdataSort: 0000200c D CC1 +quickdataSort: 00002010 D D1 +quickdataSort: 00002018 D DD1 diff --git a/lld/test/elf/hexagon-quickdata-sortcommon.test b/lld/test/elf/hexagon-quickdata-sortcommon.test index eb66da56265..f7b2d063545 100644 --- a/lld/test/elf/hexagon-quickdata-sortcommon.test +++ b/lld/test/elf/hexagon-quickdata-sortcommon.test @@ -1,16 +1,17 @@ -RUN: lld-core -arch hexagon -reader ELF %p/Inputs/quickdata-sortcommon-test.o.elf-hexagon -writer ELF -o %t1 +RUN: lld -flavor gnu -target hexagon -o %t1 --noinhibit-exec \ +RUN: %p/Inputs/quickdata-sortcommon-test.o.elf-hexagon RUN: llvm-nm -n %t1 | FileCheck %s -check-prefix=quickdataSortCommon -quickdataSortCommon: 00001000 D A1 -quickdataSortCommon: 00001001 D AA1 -quickdataSortCommon: 00001002 D AAA1 -quickdataSortCommon: 00001004 D B1 -quickdataSortCommon: 00001006 D BB1 -quickdataSortCommon: 00001008 D BBB1 -quickdataSortCommon: 0000100c D C1 -quickdataSortCommon: 00001010 D CC1 -quickdataSortCommon: 00001014 D CCC1 -quickdataSortCommon: 00001018 D D1 -quickdataSortCommon: 00001020 D DD1 -quickdataSortCommon: 00001028 D DDD1 +quickdataSortCommon: 00002000 D A1 +quickdataSortCommon: 00002001 D AA1 +quickdataSortCommon: 00002002 D AAA1 +quickdataSortCommon: 00002004 D B1 +quickdataSortCommon: 00002006 D BB1 +quickdataSortCommon: 00002008 D BBB1 +quickdataSortCommon: 0000200c D C1 +quickdataSortCommon: 00002010 D CC1 +quickdataSortCommon: 00002014 D CCC1 +quickdataSortCommon: 00002018 D D1 +quickdataSortCommon: 00002020 D DD1 +quickdataSortCommon: 00002028 D DDD1 diff --git a/lld/test/elf/ifunc.test b/lld/test/elf/ifunc.test index a1c55f29d2a..e67cfbf7910 100644 --- a/lld/test/elf/ifunc.test +++ b/lld/test/elf/ifunc.test @@ -1,42 +1,51 @@ -RUN: lld -core -target x86_64-linux -emit-yaml -output=- -output-type=static \ -RUN: %p/Inputs/ifunc.x86-64 -noinhibit-exec | FileCheck %s +RUN: lld -flavor gnu -target x86_64-linux -emit-yaml -r \ +RUN: %p/Inputs/ifunc.x86-64 | FileCheck %s -RUN: lld -core -target x86_64-linux -emit-yaml -output=- -output-type=static \ -RUN: %p/Inputs/ifunc.x86-64 -noinhibit-exec %p/Inputs/ifunc.cpp.x86-64 \ +RUN: lld -flavor gnu -target x86_64-linux -emit-yaml --noinhibit-exec \ +RUN: %p/Inputs/ifunc.x86-64 %p/Inputs/ifunc.cpp.x86-64 \ RUN: | FileCheck %s --check-prefix=PLT -RUN: lld -core -target x86_64-linux -output=%t %p/Inputs/ifunc.x86-64 \ -RUN: -entry=main -output-type=static %p/Inputs/ifunc.cpp.x86-64 \ +RUN: lld -flavor gnu -target x86_64-linux -o %t %p/Inputs/ifunc.x86-64 \ +RUN: -e main -static %p/Inputs/ifunc.cpp.x86-64 \ RUN: && llvm-objdump -d -s %t| FileCheck %s --check-prefix=BIN + +PLT: defined-atoms: + // Make sure there's a got entry with a IRELATIVE relocation. PLT: type: got -PLT: kind: R_X86_64_IRELATIVE -PLT: target: hey +PLT: references: +PLT: kind: R_X86_64_IRELATIVE +PLT: target: hey -PLT: name: plt +PLT: name: plt PLT: scope: global -PLT: kind: R_X86_64_PC32 -PLT: target: [[PLTNAME:[-a-zA-Z0-9_]+]] - +PLT: references: +PLT: kind: R_X86_64_PC32 +PLT: target: [[PLTNAME:[-a-zA-Z0-9_]+]] +PLT: kind: layout-before +PLT: target: __hey_1 PLT: name: main PLT: scope: global -PLT: references -PLT: kind: R_X86_64_PC32 -PLT: target: [[PLTNAME]] - -CHECK: name: hey -CHECK: scope: global -CHECK: type: resolver +PLT: references: +PLT: kind: R_X86_64_PC32 +PLT: target: [[PLTNAME]] // Make sure the target of main's relocation is a stub with a PC32 relocation. // This relocation is to the got atom, but you can't really write that check in // FileCheck. -PLT: name: [[PLTNAME]] +PLT: name: PLT: type: stub PLT: references -PLT: kind: R_X86_64_PC32 +PLT: kind: R_X86_64_PC32 + +CHECK: name: hey +CHECK: scope: global +CHECK: type: resolver + +// This is a horribly brittle test. We need a way to do arithmetic on captured +// variables. BIN: {{[0-9a-f]+}}: ff 25 {{[0-9a-f]+}} {{[0-9a-f]+}} 00 00 jmpq *{{[0-9]+}}(%rip) BIN: .got.plt: BIN-NEXT: {{[0-9a-f]+}} 00000000 00000000 diff --git a/lld/test/elf/init_array.test b/lld/test/elf/init_array.test index 0fa926f1295..1acf4a7e7a2 100644 --- a/lld/test/elf/init_array.test +++ b/lld/test/elf/init_array.test @@ -1,5 +1,5 @@ -RUN: lld -core -target x86_64-linux -output=%t %p/Inputs/init_array.x86-64 \ -RUN: -output-type=static +RUN: lld -flavor gnu -target x86_64-linux -o %t %p/Inputs/init_array.x86-64 \ +RUN: -e __init_array_start RUN: llvm-objdump -t -section-headers %t | FileCheck %s CHECK: .init_array {{[0-9]+}} [[ADDR:[0-9]+]] diff --git a/lld/test/elf/mergeatoms.objtxt b/lld/test/elf/mergeatoms.objtxt index 82761caede4..f2aadefaf57 100644 --- a/lld/test/elf/mergeatoms.objtxt +++ b/lld/test/elf/mergeatoms.objtxt @@ -1,5 +1,5 @@ -RUN: lld-core -merge-strings=true -reader ELF -writer ELF \ -RUN: -o %t1 %p/Inputs/foo.o.x86-64 %p/Inputs/bar.o.x86-64 +RUN: lld -flavor gnu --merge-strings -o %t1 \ +RUN: %p/Inputs/foo.o.x86-64 %p/Inputs/bar.o.x86-64 -e bar1 RUN: llvm-objdump -s %t1 | FileCheck -check-prefix=mergeAtoms %s -mergeAtoms: 0074 62617200 666f6f00 bar.foo. +mergeAtoms: 62617200 666f6f00 bar.foo. diff --git a/lld/test/elf/mergeconstants.objtxt b/lld/test/elf/mergeconstants.objtxt index 75284ac37e2..d9cf4dd912b 100644 --- a/lld/test/elf/mergeconstants.objtxt +++ b/lld/test/elf/mergeconstants.objtxt @@ -1,4 +1,4 @@ -RUN: lld-core -merge-strings=true -reader ELF %p/Inputs/constants-merge.x86-64 | FileCheck -check-prefix=mergeAtoms %s +RUN: lld -flavor gnu --merge-strings -emit-yaml %p/Inputs/constants-merge.x86-64 | FileCheck -check-prefix=mergeAtoms %s mergeAtoms: - name: foo mergeAtoms: scope: global @@ -8,7 +8,7 @@ mergeAtoms: alignment: 2^3 mergeAtoms: section-choice: custom-required mergeAtoms: section-name: .data mergeAtoms: references: -mergeAtoms: - kind: <unknown> +mergeAtoms: - kind: R_X86_64_64 mergeAtoms: offset: 3 mergeAtoms: target: L001 mergeAtoms: - kind: layout-before diff --git a/lld/test/elf/mergeglobalatoms.test b/lld/test/elf/mergeglobalatoms.test index 10d70363b4b..7831b719cd5 100644 --- a/lld/test/elf/mergeglobalatoms.test +++ b/lld/test/elf/mergeglobalatoms.test @@ -1,6 +1,7 @@ # ELF files can have mergeable strings which are global!, treat them as global # defined atoms -RUN: lld-core -merge-strings=true -reader ELF %p/Inputs/globalconst.o.x86-64 | FileCheck -check-prefix=globalatoms %s +RUN: lld -flavor gnu -emit-yaml %p/Inputs/globalconst.o.x86-64 \ +RUN: | FileCheck -check-prefix=globalatoms %s globalatoms: - name: mystr globalatoms: scope: global diff --git a/lld/test/elf/phdr.objtxt b/lld/test/elf/phdr.objtxt index 5b6bdf45798..7e26f45af94 100644 --- a/lld/test/elf/phdr.objtxt +++ b/lld/test/elf/phdr.objtxt @@ -1,20 +1,40 @@ -RUN: lld-core -reader ELF -writer ELF -o %t1 %p/Inputs/phdr.i386 -RUN: elf-dump %t1 | FileCheck -check-prefix=ED %s +RUN: lld -flavor gnu -target i386-linux -o %t1 -e main %p/Inputs/phdr.i386 \ +RUN: | elf-dump %t1 | FileCheck -check-prefix=ED %s +RUN: lld -flavor gnu -target x86_64-linux -o %t1 -e _start %p/Inputs/relocs.x86-64 -static \ +RUN: && llvm-objdump -p %t1 | FileCheck %s -check-prefix=X86_64 -RUN: lld -core -target x86_64-linux -output=%t1 %p/Inputs/relocs.x86-64 \ -RUN: -output-type=static && llvm-objdump -p %t1 \ -RUN: | FileCheck %s -check-prefix=X86_64 +ED: # Program Header 0 +ED: (('p_type', 0x00000006) +ED: ('p_flags', 0x00000005) +ED: ('p_offset', 0x00000034) +ED: ('p_vaddr', 0x00000034) +ED: ('p_paddr', 0x00000034) +ED: ('p_filesz', 0x000000c0) +ED: ('p_memsz', 0x000000c0) +ED: ('p_align', 0x00000008) +ED: ), +ED: # Program Header 1 +ED: (('p_type', 0x00000003) +ED: ('p_flags', 0x00000004) +ED: ('p_offset', 0x000000f4) +ED: ('p_vaddr', 0x000000f4) +ED: ('p_paddr', 0x000000f4) +ED: ('p_filesz', 0x0000001c) +ED: ('p_memsz', 0x0000001c) +ED: ('p_align', 0x00000001) +ED: ), +ED: # Program Header 2 ED: (('p_type', 0x00000001) ED: ('p_flags', 0x00000005) ED: ('p_offset', 0x00000000) ED: ('p_vaddr', 0x00000000) ED: ('p_paddr', 0x00000000) -ED: ('p_filesz', 0x00000144) -ED: ('p_memsz', 0x00000144) +ED: ('p_filesz', 0x00000214) +ED: ('p_memsz', 0x00000214) ED: ('p_align', 0x00001000) ED: ), -ED: # Program Header 1 +ED: # Program Header 3 ED: (('p_type', 0x00000001) ED: ('p_flags', 0x00000006) ED: ('p_offset', 0x00001000) @@ -24,7 +44,7 @@ ED: ('p_filesz', 0x00000104) ED: ('p_memsz', 0x00000004) ED: ('p_align', 0x00001000) ED: ), -ED: # Program Header 2 +ED: # Program Header 4 ED: (('p_type', 0x00000001) ED: ('p_flags', 0x00000006) ED: ('p_offset', 0x00004000) @@ -34,5 +54,16 @@ ED: ('p_filesz', 0x00000004) ED: ('p_memsz', 0x00004008) ED: ('p_align', 0x00001000) ED: ), +ED: # Program Header 5 +ED: (('p_type', 0x00000002) +ED: ('p_flags', 0x00000004) +ED: ('p_offset', 0x000001e4) +ED: ('p_vaddr', 0x000001e4) +ED: ('p_paddr', 0x000001e4) +ED: ('p_filesz', 0x00000030) +ED: ('p_memsz', 0x00000030) +ED: ('p_align', 0x00000004) +ED: ), -X86_64: vaddr 0x0000000000400000 +X86_64: LOAD off 0x0000000000000000 +X86_64: LOAD off 0x0000000000001000 diff --git a/lld/test/elf/ppc.objtxt b/lld/test/elf/ppc.objtxt index d3b9344eeca..398e35143ab 100644 --- a/lld/test/elf/ppc.objtxt +++ b/lld/test/elf/ppc.objtxt @@ -1,4 +1,4 @@ -RUN: lld-core -reader ELF -writer ELF -arch ppc -endian big %p/Inputs/branch-test.ppc %p/Inputs/target-test.ppc -o %t1 +RUN: lld -flavor gnu -target powerpc %p/Inputs/branch-test.ppc %p/Inputs/target-test.ppc -o %t1 --noinhibit-exec RUN: elf-dump %t1 | FileCheck -check-prefix=ppc-elfdump %s ppc-elfdump: ('e_indent[EI_CLASS]', 0x01) diff --git a/lld/test/elf/quickdata.test b/lld/test/elf/quickdata.test index 5a121924907..4ec21a924cc 100644 --- a/lld/test/elf/quickdata.test +++ b/lld/test/elf/quickdata.test @@ -1,4 +1,5 @@ -RUN: lld-core -arch hexagon -reader ELF %p/Inputs/quickdata-test.elf-hexagon | FileCheck %s -check-prefix hexagon +RUN: lld -flavor gnu -target hexagon -emit-yaml %p/Inputs/quickdata-test.elf-hexagon \ +RUN: | FileCheck %s -check-prefix hexagon hexagon: - name: init hexagon: scope: global diff --git a/lld/test/elf/reloc.objtxt b/lld/test/elf/reloc.objtxt index 1afbcba076f..03c9b3f93fc 100644 --- a/lld/test/elf/reloc.objtxt +++ b/lld/test/elf/reloc.objtxt @@ -1,45 +1,10 @@ -RUN: lld-core -merge-strings=true -reader ELF %p/Inputs/reloc-test.elf-i386 | FileCheck %s -check-prefix ELF-i386 +RUN: lld -flavor gnu --merge-strings -r -emit-yaml %p/Inputs/reloc-test.elf-i386 | FileCheck %s -check-prefix ELF-i386 ELF-i386: defined-atoms: -ELF-i386: - ref-name: L000 +ELF-i386: - ref-name: [[STRNAME:[-a-zA-Z0-9_]+]] ELF-i386: type: constant ELF-i386: content: [ 68, 65, 6C, 6C, 6F, 20, 77, 6F, 72, 6C, 64, 00 ] ELF-i386: merge: by-content -ELF-i386: section-choice: custom-required -ELF-i386: section-name: .rodata.str1.1 -ELF-i386: - type: constant -ELF-i386: content: [ 00 ] -ELF-i386: merge: by-content -ELF-i386: section-choice: custom-required -ELF-i386: section-name: .comment -ELF-i386: - type: constant -ELF-i386: content: [ 47, 43, 43, 3A, 20, 28, 47, 4E, 55, 29, 20, 34, -ELF-i386: 2E, 37, 2E, 30, 00 ] -ELF-i386: merge: by-content -ELF-i386: section-choice: custom-required -ELF-i386: section-name: .comment -ELF-i386: - name: .text -ELF-i386: alignment: 2^2 -ELF-i386: section-choice: custom-required -ELF-i386: section-name: .text -ELF-i386: - name: .data -ELF-i386: type: data -ELF-i386: alignment: 2^2 -ELF-i386: section-choice: custom-required -ELF-i386: section-name: .data -ELF-i386: - name: .bss -ELF-i386: type: zero-fill -ELF-i386: alignment: 2^2 -ELF-i386: section-choice: custom-required -ELF-i386: section-name: .bss -ELF-i386: - name: .text.startup -ELF-i386: alignment: 2^4 -ELF-i386: section-choice: custom-required -ELF-i386: section-name: .text.startup -ELF-i386: references: -ELF-i386: - kind: layout-after -ELF-i386: offset: 0 -ELF-i386: target: main ELF-i386: - name: main ELF-i386: scope: global ELF-i386: content: [ 55, 89, E5, 83, E4, F0, 83, EC, 10, C7, 04, 24, @@ -49,34 +14,16 @@ ELF-i386: alignment: 2^4 ELF-i386: section-choice: custom-required ELF-i386: section-name: .text.startup ELF-i386: references: -ELF-i386: - kind: <unknown> +ELF-i386: - kind: R_X86_64_64 ELF-i386: offset: 12 -ELF-i386: target: L000 -ELF-i386: - kind: call32 +ELF-i386: target: [[STRNAME]] +ELF-i386: - kind: R_X86_64_PC32 ELF-i386: offset: 17 ELF-i386: target: puts ELF-i386: addend: 252 ELF-i386: - kind: layout-before ELF-i386: offset: 0 ELF-i386: target: .text.startup -ELF-i386: - name: .note.GNU-stack -ELF-i386: section-choice: custom-required -ELF-i386: section-name: .note.GNU-stack -ELF-i386: permissions: r-- -ELF-i386: - name: .eh_frame -ELF-i386: content: [ 14, 00, 00, 00, 00, 00, 00, 00, 01, 7A, 52, 00, -ELF-i386: 01, 7C, 08, 01, 1B, 0C, 04, 04, 88, 01, 00, 00, -ELF-i386: 1C, 00, 00, 00, 1C, 00, 00, 00, 00, 00, 00, 00, -ELF-i386: 19, 00, 00, 00, 00, 41, 0E, 08, 85, 02, 42, 0D, -ELF-i386: 05, 55, C5, 0C, 04, 04, 00, 00 ] -ELF-i386: alignment: 2^2 -ELF-i386: section-choice: custom-required -ELF-i386: section-name: .eh_frame -ELF-i386: permissions: r-- -ELF-i386: references: -ELF-i386: - kind: call32 -ELF-i386: offset: 32 -ELF-i386: target: .text.startup ELF-i386: undefined-atoms: ELF-i386: - name: puts ELF-i386: absolute-atoms: diff --git a/lld/test/elf/rodata.objtxt b/lld/test/elf/rodata.objtxt index e6dcfeef51e..af48210e1ac 100644 --- a/lld/test/elf/rodata.objtxt +++ b/lld/test/elf/rodata.objtxt @@ -1,9 +1,9 @@ -RUN: lld-core -reader ELF -writer ELF -o %t1 %p/Inputs/rodata-test.i386 + +RUN: lld -flavor gnu -target i386 -o %t1 %p/Inputs/rodata-test.i386 --noinhibit-exec RUN: llvm-objdump -section-headers %t1 | FileCheck -check-prefix=i386 %s -RUN: lld-core -arch hexagon -reader ELF -writer ELF -o %t2 \ -RUN: %p/Inputs/rodata-test.hexagon +RUN: lld -flavor gnu -target hexagon -o %t2 %p/Inputs/rodata-test.hexagon --noinhibit-exec RUN: llvm-objdump -section-headers %t2 | FileCheck -check-prefix=hexagon %s -i386: 1 .rodata 00000004 0000000000000074 DATA +i386: .rodata 00000004 0000000000000111 DATA -hexagon: 1 .rodata 00000004 0000000000000074 DATA +hexagon: .rodata 00000004 0000000000000111 DATA diff --git a/lld/test/elf/rodata.test b/lld/test/elf/rodata.test index 9195484114c..dfe6985c073 100644 --- a/lld/test/elf/rodata.test +++ b/lld/test/elf/rodata.test @@ -1,5 +1,5 @@ -RUN: lld -core -target x86_64-linux -output=%t %p/Inputs/constdata.x86-64 \ -RUN: -output-type=static +RUN: lld -flavor gnu -target x86_64-linux -o %t %p/Inputs/constdata.x86-64 \ +RUN: -static -e _start RUN: llvm-objdump -s %t | FileCheck %s CHECK: Hellooooooooo diff --git a/lld/test/elf/sections.objtxt b/lld/test/elf/sections.objtxt index 7f687aa011b..784d8610855 100644 --- a/lld/test/elf/sections.objtxt +++ b/lld/test/elf/sections.objtxt @@ -1,4 +1,5 @@ -RUN: lld-core -reader ELF -writer ELF -o %t1 %p/Inputs/section-test.i386 +RUN: lld -flavor gnu -target i386 -o %t1 %p/Inputs/section-test.i386 \ +RUN: -static -e baz RUN: llvm-objdump -section-headers %t1 | FileCheck -check-prefix=OBJDUMP %s RUN: llvm-readobj -h -s -t %t1 | FileCheck -check-prefix=READOBJ %s diff --git a/lld/test/elf/symbols.objtxt b/lld/test/elf/symbols.objtxt index 18910ec870f..3fcc7841160 100644 --- a/lld/test/elf/symbols.objtxt +++ b/lld/test/elf/symbols.objtxt @@ -14,14 +14,13 @@ #} # -RUN: lld-core -reader ELF %p/Inputs/writersyms.o -writer ELF -o %t1 +RUN: lld -flavor gnu -target i386 -e main %p/Inputs/writersyms.o -o %t1 RUN: llvm-nm -n %t1 | FileCheck -check-prefix CHECKSYMS %s CHECKSYMS: 00000000 a 1.c -CHECKSYMS: 00000074 T main +CHECKSYMS: 00000114 T main CHECKSYMS: 00001000 A __bss_start CHECKSYMS: 00001000 B a CHECKSYMS: 00001004 A __bss_end CHECKSYMS: 00001004 A _end CHECKSYMS: 00001004 A end -CHECKSYMS: U _start diff --git a/lld/test/elf/tls.test b/lld/test/elf/tls.test index c3efdca0aa3..d18c6fccfac 100644 --- a/lld/test/elf/tls.test +++ b/lld/test/elf/tls.test @@ -1,31 +1,33 @@ -RUN: lld -core -target x86_64-linux %p/Inputs/tls.x86-64 -output=- \ -RUN: -noinhibit-exec -entry=main -emit-yaml -output-type=static \ -RUN: | FileCheck %s -check-prefix=YAML +RUN: lld -flavor gnu -target x86_64-linux %p/Inputs/tls.x86-64 -static \ +RUN: -emit-yaml --noinhibit-exec | FileCheck %s -check-prefix=YAML -RUN: lld -core -target x86_64-linux %p/Inputs/tls.x86-64 -output=%t \ -RUN: -noinhibit-exec -entry=main -output-type=static && llvm-objdump -d %t \ -RUN: | FileCheck %s +RUN: lld -flavor gnu -target x86_64-linux %p/Inputs/tls.x86-64 -output=%t \ +RUN: --noinhibit-exec -e main -static && llvm-objdump -d %t | FileCheck %s // Verify that the TLS accesses have the correct offsets. -YAML: type: got -YAML: kind: R_X86_64_TPOFF64 -YAML: target: tls2 - -YAML: name: main -YAML: kind: R_X86_64_TPOFF32 -YAML: offset: 9 -YAML: target: tls1 -YAML: kind: R_X86_64_TPOFF32 -YAML: offset: 17 -YAML: target: tls0 -YAML: kind: R_X86_64_TPOFF32 -YAML: offset: 25 -YAML: target: tls2 - -YAML: name: GOTTPOFF -YAML: kind: R_X86_64_PC32 -YAML: target: [[GOTNAME:[a-zA-Z0-9_]+]] +YAML: defined-atoms: +YAML: type: got +YAML: references: +YAML: kind: R_X86_64_TPOFF64 +YAML: target: tls2 + +YAML: name: main +YAML: references: +YAML: kind: R_X86_64_TPOFF32 +YAML: offset: 9 +YAML: target: tls1 +YAML: kind: R_X86_64_TPOFF32 +YAML: offset: 17 +YAML: target: tls0 +YAML: kind: R_X86_64_TPOFF32 +YAML: offset: 25 +YAML: target: tls2 + +YAML: name: GOTTPOFF +YAML: kind: R_X86_64_PC32 +YAML: target: [[GOTNAME:[a-zA-Z0-9_]+]] + // main CHECK: addl %fs:-4 diff --git a/lld/test/elf/x86-64-dynamic-relocs.test b/lld/test/elf/x86-64-dynamic-relocs.test index c1ddad72bb2..ee86ab2ac87 100644 --- a/lld/test/elf/x86-64-dynamic-relocs.test +++ b/lld/test/elf/x86-64-dynamic-relocs.test @@ -1,5 +1,5 @@ -RUN: lld -core -target x86_64-linux %p/Inputs/relocs-dynamic.x86-64 -emit-yaml \ -RUN: -output=- -noinhibit-exec -output-type=dynamic | FileCheck %s +RUN: lld -flavor gnu -target x86_64-linux %p/Inputs/relocs-dynamic.x86-64 \ +RUN: -emit-yaml --noinhibit-exec | FileCheck %s path: <linker-internal> defined-atoms: diff --git a/lld/test/elf/x86-64-dynamic.test b/lld/test/elf/x86-64-dynamic.test index 21688b4bffe..5a3b02c74e4 100644 --- a/lld/test/elf/x86-64-dynamic.test +++ b/lld/test/elf/x86-64-dynamic.test @@ -1,47 +1,10 @@ -RUN: lld -core -target x86_64-linux %p/Inputs/use-shared.x86-64 \ -RUN: %p/Inputs/shared.so-x86-64 -emit-yaml -output=%t1 -noinhibit-exec \ -RUN: -output-type=dynamic +RUN: lld -flavor gnu -target x86_64-linux %p/Inputs/use-shared.x86-64 \ +RUN: %p/Inputs/shared.so-x86-64 -emit-yaml -o %t1 --noinhibit-exec RUN: FileCheck %s < %t1 // Don't check the GOT and PLT names as they are only present in assert builds. - - name: __got_null -CHECK: type: got -CHECK: content: [ 00, 00, 00, 00, 00, 00, 00, 00 ] -CHECK: alignment: 2^3 -CHECK: section-choice: custom-required -CHECK: section-name: .got.plt -CHECK: permissions: rw- - - name: __got0 -CHECK: type: got -CHECK: content: [ 00, 00, 00, 00, 00, 00, 00, 00 ] -CHECK: alignment: 2^3 -CHECK: section-choice: custom-required -CHECK: section-name: .got.plt -CHECK: permissions: rw- - - name: __got1 -CHECK: type: got -CHECK: content: [ 00, 00, 00, 00, 00, 00, 00, 00 ] -CHECK: alignment: 2^3 -CHECK: section-choice: custom-required -CHECK: section-name: .got.plt -CHECK: permissions: rw- - - name: __got_foo -CHECK: type: got -CHECK: content: [ 00, 00, 00, 00, 00, 00, 00, 00 ] -CHECK: alignment: 2^3 -CHECK: section-choice: custom-required -CHECK: section-name: .got.plt -CHECK: permissions: rw- -CHECK: references: -CHECK: - kind: R_X86_64_JUMP_SLOT -CHECK: offset: 0 -CHECK: target: foo -CHECK: - kind: R_X86_64_64 -CHECK: offset: 0 - target: __plt_foo -CHECK: addend: 6 - - name: __got_i +CHECK: name: [[GOTNAME:[-a-zA-Z0-9_]+]] CHECK: type: got CHECK: content: [ 00, 00, 00, 00, 00, 00, 00, 00 ] CHECK: section-choice: custom-required @@ -57,11 +20,11 @@ CHECK: scope: global CHECK: references: CHECK: - kind: R_X86_64_PC32 CHECK: offset: 18 - target: __plt_foo + target: [[PLTNAME:[-a-zA-Z0-9_]+]] CHECK: addend: -4 -CHECK: - kind: R_X86_64_PC32 +CHECK: - kind: R_X86_64_PC32 CHECK: offset: 25 - target: __got_i + target: [[GOTNAME]] CHECK: addend: -4 - name: .PLT0 @@ -80,7 +43,7 @@ CHECK: - kind: R_X86_64_PC32 CHECK: offset: 8 target: __got1 CHECK: addend: -4 - - name: __plt_foo + - name: [[PLTNAME]] CHECK: type: stub CHECK: content: [ FF, 25, 00, 00, 00, 00, 68, 00, 00, 00, 00, E9, CHECK: 00, 00, 00, 00 ] @@ -100,6 +63,7 @@ CHECK: offset: 12 target: .PLT0 CHECK: addend: -4 + CHECK:shared-library-atoms: CHECK: - name: foo CHECK: load-name: shared.so-x86-64 diff --git a/lld/test/elf/x86.objtxt b/lld/test/elf/x86.objtxt index 386da17bf64..3a7a7fe2363 100644 --- a/lld/test/elf/x86.objtxt +++ b/lld/test/elf/x86.objtxt @@ -18,13 +18,13 @@ # # Assembled with: "as --32" -RUN: lld-core -reader ELF -arch=i386 %p/Inputs/reloc-xb.x86 %p/Inputs/reloc-xt.x86 | FileCheck %s -check-prefix x86-yaml +RUN: lld -flavor gnu -target i386 -e back -emit-yaml %p/Inputs/reloc-xb.x86 %p/Inputs/reloc-xt.x86 | FileCheck %s -check-prefix x86-yaml x86-yaml: - name: back x86-yaml: scope: global x86-yaml: content: [ E8, FC, FF, FF, FF ] x86-yaml: references: -x86-yaml: - kind: call32 +x86-yaml: - kind: R_386_PC32 x86-yaml: offset: 1 x86-yaml: target: target @@ -32,7 +32,7 @@ x86-yaml: - name: target x86-yaml: scope: global x86-yaml: content: [ E8, FC, FF, FF, FF ] x86-yaml: references: -x86-yaml: - kind: call32 +x86-yaml: - kind: R_386_PC32 x86-yaml: offset: 1 x86-yaml: target: back diff --git a/lld/test/elf/x86_64-kinds.test b/lld/test/elf/x86_64-kinds.test index 41de35be17a..33e24b66781 100644 --- a/lld/test/elf/x86_64-kinds.test +++ b/lld/test/elf/x86_64-kinds.test @@ -1,8 +1,8 @@ -RUN: lld -core -target x86_64-linux -output=%t1 %p/Inputs/relocs.x86-64 \ -RUN: -output-type=static +RUN: lld -flavor gnu -target x86_64-linux -o %t1 %p/Inputs/relocs.x86-64 \ +RUN: -e _start -static RUN: llvm-objdump -d %t1 | FileCheck %s -check-prefix=RELOCS -RUN: lld -core -target x86_64-linux -output=- -emit-yaml -output-type=static \ +RUN: lld -flavor gnu -target x86_64-linux -emit-yaml -e _start -static \ RUN: %p/Inputs/relocs.x86-64 | FileCheck %s -check-prefix=X86_64 RELOCS: ELF64-x86-64 diff --git a/lld/test/empty.objtxt b/lld/test/empty.objtxt index 92427ff7ba3..a78a3bfbd5c 100644 --- a/lld/test/empty.objtxt +++ b/lld/test/empty.objtxt @@ -1,4 +1,4 @@ -# RUN: lld-core %s | FileCheck %s +# RUN: lld -core %s | FileCheck %s # # Test that an empty file is handled properly diff --git a/lld/test/error-atom-attribute.objtxt b/lld/test/error-atom-attribute.objtxt index 9355a18d045..dfcf176a874 100644 --- a/lld/test/error-atom-attribute.objtxt +++ b/lld/test/error-atom-attribute.objtxt @@ -1,4 +1,4 @@ -# RUN: not lld-core %s 2> %t.err +# RUN: not lld -core %s 2> %t.err # RUN: FileCheck < %t.err %s # diff --git a/lld/test/error-atom-content-byte-value.objtxt b/lld/test/error-atom-content-byte-value.objtxt index 42fe53376b0..601161ee74d 100644 --- a/lld/test/error-atom-content-byte-value.objtxt +++ b/lld/test/error-atom-content-byte-value.objtxt @@ -1,4 +1,4 @@ -# RUN: not lld-core %s 2> %t.err +# RUN: not lld -core %s 2> %t.err # RUN: FileCheck < %t.err %s # diff --git a/lld/test/error-atom-content-bytes.objtxt b/lld/test/error-atom-content-bytes.objtxt index f887da56953..49ada258c99 100644 --- a/lld/test/error-atom-content-bytes.objtxt +++ b/lld/test/error-atom-content-bytes.objtxt @@ -1,4 +1,4 @@ -# RUN: not lld-core %s 2> %t.err +# RUN: not lld -core %s 2> %t.err # RUN: FileCheck < %t.err %s # diff --git a/lld/test/error-atom-type.objtxt b/lld/test/error-atom-type.objtxt index aae1ffff862..533df5704f6 100644 --- a/lld/test/error-atom-type.objtxt +++ b/lld/test/error-atom-type.objtxt @@ -1,4 +1,4 @@ -# RUN: not lld-core %s 2> %t.err +# RUN: not lld -core %s 2> %t.err # RUN: FileCheck < %t.err %s # diff --git a/lld/test/error-atom-undefined-wrong-attribue.objtxt b/lld/test/error-atom-undefined-wrong-attribue.objtxt index b5a117fac7f..694b3c7915a 100644 --- a/lld/test/error-atom-undefined-wrong-attribue.objtxt +++ b/lld/test/error-atom-undefined-wrong-attribue.objtxt @@ -1,4 +1,4 @@ -# RUN: not lld-core %s 2> %t.err +# RUN: not lld -core %s 2> %t.err # RUN: FileCheck < %t.err %s # diff --git a/lld/test/error-file-attribute.objtxt b/lld/test/error-file-attribute.objtxt index 3a3997f0d63..f189c596f26 100644 --- a/lld/test/error-file-attribute.objtxt +++ b/lld/test/error-file-attribute.objtxt @@ -1,4 +1,4 @@ -# RUN: not lld-core %s 2> %t.err +# RUN: not lld -core %s 2> %t.err # RUN: FileCheck < %t.err %s # diff --git a/lld/test/error-fixup-attribute.objtxt b/lld/test/error-fixup-attribute.objtxt index 560ef96a77e..f856e21c1f8 100644 --- a/lld/test/error-fixup-attribute.objtxt +++ b/lld/test/error-fixup-attribute.objtxt @@ -1,4 +1,4 @@ -# RUN: not lld-core %s 2> %t.err +# RUN: not lld -core %s 2> %t.err # RUN: FileCheck < %t.err %s # @@ -11,7 +11,7 @@ defined-atoms: scope: hidden references: - offset: 3 - kind: 3 + kind: pcrel32 weasel: bar addend: 100 diff --git a/lld/test/error-fixup-target.objtxt b/lld/test/error-fixup-target.objtxt index f6c37fb8de7..c89f8db5fa6 100644 --- a/lld/test/error-fixup-target.objtxt +++ b/lld/test/error-fixup-target.objtxt @@ -1,4 +1,4 @@ -# RUN: not lld-core %s 2> %t.err +# RUN: not lld -core %s 2> %t.err # RUN: FileCheck < %t.err %s # @@ -11,10 +11,10 @@ defined-atoms: scope: hidden references: - offset: 3 - kind: 3 + kind: pcrel32 target: bar - offset: 5 - kind: 3 + kind: pcrel32 target: baz undefined-atoms: diff --git a/lld/test/fixups-addend.objtxt b/lld/test/fixups-addend.objtxt index c812f584ef7..24af91ffa7c 100644 --- a/lld/test/fixups-addend.objtxt +++ b/lld/test/fixups-addend.objtxt @@ -1,4 +1,4 @@ -# RUN: lld-core %s | FileCheck %s +# RUN: lld -core %s | FileCheck %s # # Test addends in references @@ -12,11 +12,11 @@ defined-atoms: 48, 8D, 3D, 00, 00, 00, 00 ] references: - offset: 3 - kind: 3 + kind: pcrel32 target: bar addend: 100 - offset: 10 - kind: 3 + kind: pcrel32 target: bar addend: -50 @@ -26,11 +26,11 @@ defined-atoms: 48, 8D, 3D, 00, 00, 00, 00 ] references: - offset: 3 - kind: 3 + kind: pcrel32 target: bar addend: 8000000000 - offset: 10 - kind: 3 + kind: pcrel32 target: bar addend: -50 diff --git a/lld/test/fixups-dup-named.objtxt b/lld/test/fixups-dup-named.objtxt index e66297a2432..38ca56ebca5 100644 --- a/lld/test/fixups-dup-named.objtxt +++ b/lld/test/fixups-dup-named.objtxt @@ -1,4 +1,4 @@ -# RUN: lld-core %s | FileCheck %s +# RUN: lld -core %s | FileCheck %s # # Test references referencing multiple atoms that have the same name @@ -11,10 +11,10 @@ defined-atoms: content: [ E8, 00, 00, 00, 00, E8, 00, 00, 00, 00 ] references: - offset: 1 - kind: 3 + kind: pcrel32 target: bar_1 - offset: 6 - kind: 3 + kind: pcrel32 target: bar_2 - name: bar diff --git a/lld/test/fixups-named.objtxt b/lld/test/fixups-named.objtxt index 61d16ebf71d..7eebb06e372 100644 --- a/lld/test/fixups-named.objtxt +++ b/lld/test/fixups-named.objtxt @@ -1,4 +1,4 @@ -# RUN: lld-core %s | FileCheck %s +# RUN: lld -core %s | FileCheck %s # # Test references to simple named atoms @@ -12,10 +12,10 @@ defined-atoms: E8, 00, 00, 00, 00 ] references: - offset: 1 - kind: 3 + kind: pcrel32 target: bar - offset: 6 - kind: 3 + kind: pcrel32 target: baz - name: baz diff --git a/lld/test/fixups-unnamed.objtxt b/lld/test/fixups-unnamed.objtxt index 2c3d7aa09d9..3ca0b30fdcd 100644 --- a/lld/test/fixups-unnamed.objtxt +++ b/lld/test/fixups-unnamed.objtxt @@ -1,4 +1,4 @@ -# RUN: lld-core %s | FileCheck %s +# RUN: lld -core %s | FileCheck %s # # Test references to unnamed atoms @@ -12,10 +12,10 @@ defined-atoms: 48, 8D, 3D, 00, 00, 00, 00 ] references: - offset: 3 - kind: 3 + kind: pcrel32 target: LC1 - offset: 10 - kind: 3 + kind: pcrel32 target: LC2 diff --git a/lld/test/ingroup-test-big.objtxt b/lld/test/ingroup-test-big.objtxt index 09ba08e7474..d0b2c46d770 100644 --- a/lld/test/ingroup-test-big.objtxt +++ b/lld/test/ingroup-test-big.objtxt @@ -1,4 +1,4 @@ -# RUN: lld-core -layout-pass=true %s | FileCheck %s -check-prefix=CHKORDER +# RUN: lld -core --add-pass layout %s | FileCheck %s -check-prefix=CHKORDER --- defined-atoms: diff --git a/lld/test/ingroup-test-loop.objtxt b/lld/test/ingroup-test-loop.objtxt index 2bdcc624a61..7bed173f35b 100644 --- a/lld/test/ingroup-test-loop.objtxt +++ b/lld/test/ingroup-test-loop.objtxt @@ -1,4 +1,4 @@ -# RUN: lld-core -layout-pass=true %s | FileCheck %s -check-prefix=CHKORDER +# RUN: lld -core --add-pass layout %s | FileCheck %s -check-prefix=CHKORDER --- defined-atoms: diff --git a/lld/test/ingroup-test-with-layout-after.objtxt b/lld/test/ingroup-test-with-layout-after.objtxt index e2555cb4661..6a8bac28a6c 100644 --- a/lld/test/ingroup-test-with-layout-after.objtxt +++ b/lld/test/ingroup-test-with-layout-after.objtxt @@ -1,4 +1,4 @@ -# RUN: lld-core -layout-pass=true %s | FileCheck %s -check-prefix=CHKORDER +# RUN: lld -core --add-pass layout %s | FileCheck %s -check-prefix=CHKORDER --- defined-atoms: diff --git a/lld/test/ingroup-test.objtxt b/lld/test/ingroup-test.objtxt index b4dd32becb4..6ebbb815485 100644 --- a/lld/test/ingroup-test.objtxt +++ b/lld/test/ingroup-test.objtxt @@ -1,4 +1,4 @@ -# RUN: lld-core -layout-pass=true %s | FileCheck %s -check-prefix=CHKORDER +# RUN: lld -core --add-pass layout %s | FileCheck %s -check-prefix=CHKORDER --- defined-atoms: diff --git a/lld/test/inline-coalesce.objtxt b/lld/test/inline-coalesce.objtxt index 218967e7d08..6df9d0e7a49 100644 --- a/lld/test/inline-coalesce.objtxt +++ b/lld/test/inline-coalesce.objtxt @@ -1,4 +1,4 @@ -# RUN: lld-core %s | FileCheck %s +# RUN: lld -core %s | FileCheck %s # # Test that non-inlined inlined functions are silently coalesced diff --git a/lld/test/layoutafter-test.objtxt b/lld/test/layoutafter-test.objtxt index 3ce3fcb567e..7d5ca3ac5d6 100644 --- a/lld/test/layoutafter-test.objtxt +++ b/lld/test/layoutafter-test.objtxt @@ -1,4 +1,4 @@ -# RUN: lld-core -layout-pass=true %s | FileCheck %s -check-prefix=CHKORDER +# RUN: lld -core -layout-pass=true %s | FileCheck %s -check-prefix=CHKORDER --- defined-atoms: diff --git a/lld/test/layoutbefore-test.objtxt b/lld/test/layoutbefore-test.objtxt index d5aa7608092..ed1afe76119 100644 --- a/lld/test/layoutbefore-test.objtxt +++ b/lld/test/layoutbefore-test.objtxt @@ -1,4 +1,4 @@ -# RUN: lld-core -layout-pass=true %s | FileCheck %s -check-prefix=CHKORDER +# RUN: lld -core --add-pass layout %s | FileCheck %s -check-prefix=CHKORDER --- defined-atoms: diff --git a/lld/test/multiple-def-error.objtxt b/lld/test/multiple-def-error.objtxt index 62281e889d1..62defbd52bc 100644 --- a/lld/test/multiple-def-error.objtxt +++ b/lld/test/multiple-def-error.objtxt @@ -1,4 +1,4 @@ -# RUN: lld-core %s 2>&1 | FileCheck %s +# RUN: lld -core %s 2>&1 | FileCheck %s # # Test that multiple definitions cause an error diff --git a/lld/test/pass-got-basic.objtxt b/lld/test/pass-got-basic.objtxt index 45ba1550cfe..6f0d4f2bcec 100644 --- a/lld/test/pass-got-basic.objtxt +++ b/lld/test/pass-got-basic.objtxt @@ -1,4 +1,4 @@ -# RUN: lld-core %s -got-pass | FileCheck %s +# RUN: lld -core %s --add-pass GOT | FileCheck %s # # Test that GOT pass instantiates GOT entires and alters references diff --git a/lld/test/pass-stubs-basic.objtxt b/lld/test/pass-stubs-basic.objtxt index 29279f29e78..8203755fc85 100644 --- a/lld/test/pass-stubs-basic.objtxt +++ b/lld/test/pass-stubs-basic.objtxt @@ -1,4 +1,4 @@ -# RUN: lld-core %s -stubs-pass | FileCheck %s +# RUN: lld -core %s --add-pass stubs | FileCheck %s # # Test that stubs pass adds stubs and rebinds call sites to the stub diff --git a/lld/test/permissions.objtxt b/lld/test/permissions.objtxt index b17c50ef223..fd07f29a6ff 100644 --- a/lld/test/permissions.objtxt +++ b/lld/test/permissions.objtxt @@ -1,4 +1,4 @@ -# RUN: lld-core %s | FileCheck %s +# RUN: lld -core %s | FileCheck %s # # Test permissions for known content types are implicit, but can be overridden. diff --git a/lld/test/section-position.objtxt b/lld/test/section-position.objtxt index 4a7c830e111..675c1edc0d5 100644 --- a/lld/test/section-position.objtxt +++ b/lld/test/section-position.objtxt @@ -1,5 +1,5 @@ -# RUN: lld-core -layout-pass=true %s | FileCheck %s -check-prefix=CHKORDER -# RUN: lld-core -layout-pass=false %s | FileCheck %s -check-prefix=CHKUNORD +# RUN: lld -core --add-pass layout %s | FileCheck %s -check-prefix=CHKORDER +# RUN: lld -core %s | FileCheck %s -check-prefix=CHKUNORD # # Test that atoms with section position requirements are sorted properly. diff --git a/lld/test/shared-library-basic.objtxt b/lld/test/shared-library-basic.objtxt index bcdf04d3176..be76d0e4162 100644 --- a/lld/test/shared-library-basic.objtxt +++ b/lld/test/shared-library-basic.objtxt @@ -1,4 +1,4 @@ -# RUN: lld-core %s | FileCheck %s +# RUN: lld -core %s | FileCheck %s # # Test that shared-library symbols are parsed and preserved diff --git a/lld/test/shared-library-coalesce.objtxt b/lld/test/shared-library-coalesce.objtxt index 04102487919..5c860ccc043 100644 --- a/lld/test/shared-library-coalesce.objtxt +++ b/lld/test/shared-library-coalesce.objtxt @@ -1,4 +1,4 @@ -# RUN: lld-core %s | FileCheck %s +# RUN: lld -core %s | FileCheck %s # # Test that shared library symbols preserve their attributes and merge properly diff --git a/lld/test/tent-merge.objtxt b/lld/test/tent-merge.objtxt index 18d6f56662a..8ad46d40ae1 100644 --- a/lld/test/tent-merge.objtxt +++ b/lld/test/tent-merge.objtxt @@ -1,4 +1,4 @@ -# RUN: lld-core %s | FileCheck %s +# RUN: lld -core %s | FileCheck %s # # Test that a tentative definition and a regular global are merged into diff --git a/lld/test/undef-coalesce-error.objtxt b/lld/test/undef-coalesce-error.objtxt index bbf6d1db765..7c82f1a8346 100644 --- a/lld/test/undef-coalesce-error.objtxt +++ b/lld/test/undef-coalesce-error.objtxt @@ -1,6 +1,6 @@ -# RUN: not lld-core -undefines-are-errors %s 2> %t.err +# RUN: not lld -core --undefines-are-errors %s 2> %t.err # RUN: FileCheck -check-prefix=CHECKERR < %t.err %s -# RUN: lld-core -undefines-are-errors=false %s | FileCheck %s +# RUN: lld -core %s | FileCheck %s # # Test that -undefines-are-errors triggers and error diff --git a/lld/test/undef-coalesce.objtxt b/lld/test/undef-coalesce.objtxt index 08e1cf80a53..8a9f502ab1a 100644 --- a/lld/test/undef-coalesce.objtxt +++ b/lld/test/undef-coalesce.objtxt @@ -1,4 +1,4 @@ -# RUN: lld-core %s | FileCheck %s +# RUN: lld -core %s | FileCheck %s # # Test that undefined symbols are coalesced with other undefined symbols diff --git a/lld/test/undef-weak-coalesce.objtxt b/lld/test/undef-weak-coalesce.objtxt index 7a324e0166d..daf6ee0eb87 100644 --- a/lld/test/undef-weak-coalesce.objtxt +++ b/lld/test/undef-weak-coalesce.objtxt @@ -1,4 +1,4 @@ -# RUN: lld-core %s | FileCheck %s +# RUN: lld -core %s | FileCheck %s # # Test that undefined symbols preserve their attributes and merge properly diff --git a/lld/test/weak-coalesce.objtxt b/lld/test/weak-coalesce.objtxt index fdeae89a386..550c10cfa46 100644 --- a/lld/test/weak-coalesce.objtxt +++ b/lld/test/weak-coalesce.objtxt @@ -1,4 +1,4 @@ -# RUN: lld-core %s | FileCheck %s +# RUN: lld -core %s | FileCheck %s # # Test that weak definitions are coalesced away in favor of a regular definition |