diff options
Diffstat (limited to 'lld/test')
42 files changed, 263 insertions, 396 deletions
diff --git a/lld/test/absolute-basic.objtxt b/lld/test/absolute-basic.objtxt index f5f1eedaf08..19772881340 100644 --- a/lld/test/absolute-basic.objtxt +++ b/lld/test/absolute-basic.objtxt @@ -5,21 +5,19 @@ # --- -atoms: +absolute-atoms: - name: putchar - definition: absolute value: 0xFFFF0040 - name: reset - definition: absolute value: 0xFFFF0080 ... + +# CHECK: absolute-atoms: # CHECK: name: putchar -# CHECK: definition: absolute -# CHECK: value: 0xffff0040 +# CHECK: value: 0x00000000FFFF0040 # CHECK: name: reset -# CHECK: definition: absolute -# CHECK: value: 0xffff0080 +# CHECK: value: 0x00000000FFFF0080 # CHECK: ... diff --git a/lld/test/absolute-local.objtxt b/lld/test/absolute-local.objtxt index 0db54e5df7e..e9324255cec 100644 --- a/lld/test/absolute-local.objtxt +++ b/lld/test/absolute-local.objtxt @@ -4,23 +4,22 @@ # Test that absolute symbols with local scope do not cause name conflict # --- -atoms: +absolute-atoms: - name: putchar - definition: absolute + ref-name: pc1 value: 0xFFFF0040 scope: static - name: putchar - definition: absolute + ref-name: pc2 value: 0xFFFF0040 scope: static ... -# CHECK: --- +# CHECK: --- +# CHECK: absolute-atoms: # CHECK: - name: putchar -# CHECK: definition: absolute -# CHECK: value: 0xffff0040 +# CHECK: value: 0x00000000FFFF0040 # CHECK: - name: putchar -# CHECK: definition: absolute -# CHECK: value: 0xffff0040 -# CHECK: ... +# CHECK: value: 0x00000000FFFF0040 +# CHECK: ... diff --git a/lld/test/archive-basic.objtxt b/lld/test/archive-basic.objtxt index 0e4a754ed45..80d945457f8 100644 --- a/lld/test/archive-basic.objtxt +++ b/lld/test/archive-basic.objtxt @@ -6,37 +6,40 @@ # --- -atoms: +defined-atoms: - name: foo type: code +undefined-atoms: - name: bar - definition: undefined --- -archive: - - name: bar.o - atoms: - - name: bar - scope: global - type: code - - - name: bar2 - type: code - - - name: baz.o - atoms: - - name: baz - scope: global - type: code - - - name: baz2 - type: code +kind: archive +members: + - name: bar.o + content: + defined-atoms: + - name: bar + scope: global + type: code + + - name: bar2 + type: code + + - name: baz.o + content: + defined-atoms: + - name: baz + scope: global + type: code + + - name: baz2 + type: code ... # CHECK: name: foo +# CHECK-NOT: undefined-atoms: # CHECK: name: bar -# CHECK-NOT: definition: undefined # CHECK: name: bar2 # CHECK-NOT: name: baz # CHECK: ... diff --git a/lld/test/archive-chain.objtxt b/lld/test/archive-chain.objtxt index f0d8e6c08ed..286b60da22a 100644 --- a/lld/test/archive-chain.objtxt +++ b/lld/test/archive-chain.objtxt @@ -5,55 +5,61 @@ # --- -atoms: +defined-atoms: - name: foo type: code +undefined-atoms: - name: bar1 - definition: undefined --- -archive: - - name: bar1.o - - atoms: - - name: bar1 - scope: global - type: code +kind: archive +members: + - name: bar1.o + content: + defined-atoms: + - name: bar1 + scope: global + type: code - - name: bar1b - type: code + - name: bar1b + type: code - - name: baz1 - definition: undefined + undefined-atoms: + - name: baz1 - - name: bar2.o - - atoms: - - name: bar2 - scope: global - type: code + - name: bar2.o + content: + defined-atoms: + - name: bar2 + scope: global + type: code - - name: bar2b - type: code + - name: bar2b + type: code --- -archive: - - name: baz1.o - - atoms: - - name: baz1 - scope: global - type: code +kind: archive +members: + - name: baz1.o + content: + defined-atoms: + - name: baz1 + scope: global + type: code + + - name: baz1b + type: code - - name: baz1b - type: code + - name: baz2.o + content: + defined-atoms: + - name: baz2 + scope: global + type: code - - name: baz2.o - - atoms: - - name: baz2 - scope: global - type: code - - - name: baz2b - type: code + - name: baz2b + type: code ... # CHECK: name: foo diff --git a/lld/test/archive-tentdef-search.objtxt b/lld/test/archive-tentdef-search.objtxt index 09cb3673ec5..730bf59e0d4 100644 --- a/lld/test/archive-tentdef-search.objtxt +++ b/lld/test/archive-tentdef-search.objtxt @@ -8,34 +8,36 @@ # --- -atoms: +defined-atoms: - name: foo type: code - name: bar scope: global type: zero-fill - merge: asTentative + merge: as-tentative --- -archive: - - name: bar.o - - atoms: - - name: bar - scope: global - type: data +kind: archive +members: + - name: bar.o + content: + defined-atoms: + - name: bar + scope: global + type: data - - name: bar2 - type: data + - name: bar2 + type: data ... # CHK1: name: foo # CHK1: name: bar -# CHK1: merge: asTentative +# CHK1: merge: as-tentative # CHK1: ... # CHK2: name: foo # CHK2: name: bar -# CHK2-NOT: merge: asTentative +# CHK2-NOT: merge: as-tentative # CHK2: name: bar2 # CHK2: ... diff --git a/lld/test/auto-hide-coalesce.objtxt b/lld/test/auto-hide-coalesce.objtxt index 5471809491b..8d621b75400 100644 --- a/lld/test/auto-hide-coalesce.objtxt +++ b/lld/test/auto-hide-coalesce.objtxt @@ -5,64 +5,56 @@ # --- -atoms: +defined-atoms: - name: _inlineFunc1 scope: global - definition: regular type: code - merge: asWeak + merge: as-weak - name: _inlineFunc2 scope: global - definition: regular type: code - merge: asWeak + merge: as-weak - name: _inlineFunc3 scope: global - definition: regular type: code - merge: asAddressedWeak + merge: as-addressed-weak - name: _inlineFunc4 scope: global - definition: regular type: code - merge: asAddressedWeak + merge: as-addressed-weak --- -atoms: +defined-atoms: - name: _inlineFunc1 scope: global - definition: regular type: code - merge: asWeak + merge: as-weak - name: _inlineFunc2 scope: global - definition: regular type: code - merge: asAddressedWeak + merge: as-addressed-weak - name: _inlineFunc3 scope: global - definition: regular type: code - merge: asWeak + merge: as-weak - name: _inlineFunc4 scope: global - definition: regular type: code - merge: asAddressedWeak + merge: as-addressed-weak ... # CHECK: name: _inlineFunc1 -# CHECK: merge: asWeak +# CHECK: merge: as-weak # CHECK: name: _inlineFunc3 -# CHECK: merge: asAddressedWeak +# CHECK: merge: as-addressed-weak # CHECK: name: _inlineFunc4 -# CHECK: merge: asAddressedWeak +# CHECK: merge: as-addressed-weak # CHECK: name: _inlineFunc2 -# CHECK: merge: asAddressedWeak +# CHECK: merge: as-addressed-weak # CHECK: ... diff --git a/lld/test/cstring-coalesce.objtxt b/lld/test/cstring-coalesce.objtxt index faf35486e6b..5b37acca5c7 100644 --- a/lld/test/cstring-coalesce.objtxt +++ b/lld/test/cstring-coalesce.objtxt @@ -5,7 +5,7 @@ # --- -atoms: +defined-atoms: - ref-name: L0 scope: hidden type: c-string @@ -16,13 +16,13 @@ atoms: type: c-string content: [ 74, 68, 65, 72, 65, 00 ] --- -atoms: +defined-atoms: - ref-name: L2 scope: hidden type: c-string content: [ 68, 65, 6c, 6c, 6f, 00 ] --- -atoms: +defined-atoms: - ref-name: L2 scope: hidden type: c-string diff --git a/lld/test/custom-section.objtxt b/lld/test/custom-section.objtxt index 99a119fcef1..f92b3fdc91f 100644 --- a/lld/test/custom-section.objtxt +++ b/lld/test/custom-section.objtxt @@ -5,7 +5,7 @@ # --- -atoms: +defined-atoms: - name: _foo1 scope: global section-choice: content diff --git a/lld/test/darwin/hello-world.objtxt b/lld/test/darwin/hello-world.objtxt index 49df58b85e3..b2e42d15e96 100644 --- a/lld/test/darwin/hello-world.objtxt +++ b/lld/test/darwin/hello-world.objtxt @@ -5,12 +5,13 @@ # --- -atoms: +defined-atoms: - name: _main type: code scope: global - content: [ 55, 48, 89, E5, 48, 8D, 3D, 00, 00, 00, 00, - E8, 00, 00, 00, 00, 31, C0, 5D, C3 ] + content: [ 55, 48, 89, E5, 48, 8D, 3D, 00, + 00, 00, 00, E8, 00, 00, 00, 00, + 31, C0, 5D, C3 ] fixups: - offset: 7 kind: pcrel32 @@ -24,8 +25,8 @@ atoms: type: c-string content: [ 68, 65, 6C, 6C, 6F, 0A, 00 ] +shared-library-atoms: - name: _printf - definition: shared-library load-name: /usr/lib/libSystem.B.dylib ... diff --git a/lld/test/dead-strip-attributes.objtxt b/lld/test/dead-strip-attributes.objtxt index 47f46c60f48..a5d21b67245 100644 --- a/lld/test/dead-strip-attributes.objtxt +++ b/lld/test/dead-strip-attributes.objtxt @@ -5,15 +5,15 @@ # --- -atoms: +defined-atoms: - name: _foo1 dead-strip: normal --- -atoms: +defined-atoms: - name: _foo2 dead-strip: never --- -atoms: +defined-atoms: - name: _foo3 dead-strip: always ... diff --git a/lld/test/dead-strip-basic.objtxt b/lld/test/dead-strip-basic.objtxt index cd09b34b089..a647d9d6927 100644 --- a/lld/test/dead-strip-basic.objtxt +++ b/lld/test/dead-strip-basic.objtxt @@ -7,7 +7,7 @@ # --- -atoms: +defined-atoms: - name: entry dead-strip: never fixups: @@ -21,13 +21,12 @@ atoms: - name: mydead1 scope: global +undefined-atoms: - name: bar - definition: undefined - name: baz - definition: undefined --- -atoms: +defined-atoms: - name: mydead2 scope: global type: data @@ -36,7 +35,7 @@ atoms: scope: global type: data --- -atoms: +defined-atoms: - name: baz scope: global type: code diff --git a/lld/test/dead-strip-globals.objtxt b/lld/test/dead-strip-globals.objtxt index be0d1f8189e..3c975d69e79 100644 --- a/lld/test/dead-strip-globals.objtxt +++ b/lld/test/dead-strip-globals.objtxt @@ -6,7 +6,7 @@ # --- -atoms: +defined-atoms: - name: entry dead-strip: never fixups: @@ -20,13 +20,11 @@ atoms: - name: myglobal1 scope: global +undefined-atoms: - name: bar - definition: undefined - - name: baz - definition: undefined --- -atoms: +defined-atoms: - name: myglobal2 scope: global type: data @@ -35,7 +33,7 @@ atoms: scope: hidden type: data --- -atoms: +defined-atoms: - name: baz scope: hidden type: code diff --git a/lld/test/elf/abs.objtxt b/lld/test/elf/abs.objtxt index 4ec9fa97c39..1466831d35f 100644 --- a/lld/test/elf/abs.objtxt +++ b/lld/test/elf/abs.objtxt @@ -11,11 +11,9 @@ # RUN: lld-core -reader ELF %p/Inputs/abs-test.i386 | FileCheck -check-prefix=YAML %s +YAML: absolute-atoms: YAML: - name: absLocalSymbol -YAML: definition: absolute -YAML: value: 0xc0000 - +YAML: value: {{0x[0]+C0000}} YAML: - name: absGlobalSymbol -YAML: definition: absolute YAML: scope: global -YAML: value: 0xd0000 +YAML: value: {{0x[0]+D0000}} diff --git a/lld/test/elf/archive-elf-forceload.objtxt b/lld/test/elf/archive-elf-forceload.objtxt index 2e53a2114aa..efcd1fce96f 100644 --- a/lld/test/elf/archive-elf-forceload.objtxt +++ b/lld/test/elf/archive-elf-forceload.objtxt @@ -25,6 +25,7 @@ RUN: lld-core -reader ELF %p/Inputs/mainobj.x86_64 %p/Inputs/libfnarchive.x86_64 -force-load | FileCheck -check-prefix FORCELOAD %s +FORCELOAD: defined-atoms: FORCELOAD: - name: fn1 FORCELOAD: scope: global FORCELOAD: type: code @@ -37,12 +38,10 @@ FORCELOAD: type: code FORCELOAD: section-choice: custom-required FORCELOAD: section-name: .text FORCELOAD: content: [ 55, 48, 89, E5, B8, 00, 00, 00, 00, 5D, C3 ] +FORCELOAD: absolute-atoms: FORCELOAD: - name: main.c -FORCELOAD: definition: absolute FORCELOAD: value: 0x0 FORCELOAD: - name: fn1.c -FORCELOAD: definition: absolute FORCELOAD: value: 0x0 FORCELOAD: - name: fn.c -FORCELOAD: definition: absolute FORCELOAD: value: 0x0 diff --git a/lld/test/elf/archive-elf.objtxt b/lld/test/elf/archive-elf.objtxt index 0b85e4238f3..34e36d04367 100644 --- a/lld/test/elf/archive-elf.objtxt +++ b/lld/test/elf/archive-elf.objtxt @@ -25,15 +25,12 @@ RUN: lld-core -reader ELF %p/Inputs/mainobj.x86_64 %p/Inputs/libfnarchive.x86_64 | FileCheck -check-prefix NOFORCELOAD %s +NOFORCELOAD: defined-atoms: NOFORCELOAD: - name: fn NOFORCELOAD: scope: global -NOFORCELOAD: type: code -NOFORCELOAD: section-choice: custom-required -NOFORCELOAD: section-name: .text NOFORCELOAD: content: [ 55, 48, 89, E5, B8, 00, 00, 00, 00, 5D, C3 ] +NOFORCELOAD: absolute-atoms: NOFORCELOAD: - name: main.c -NOFORCELOAD: definition: absolute NOFORCELOAD: value: 0x0 NOFORCELOAD: - name: fn.c -NOFORCELOAD: definition: absolute NOFORCELOAD: value: 0x0 diff --git a/lld/test/elf/branch.objtxt b/lld/test/elf/branch.objtxt index 91c25b6754f..ce3caee2169 100644 --- a/lld/test/elf/branch.objtxt +++ b/lld/test/elf/branch.objtxt @@ -4,24 +4,24 @@ RUN: elf-dump %t1 | FileCheck -check-prefix=hexagon-elfdump %s hexagon-yaml: - name: back hexagon-yaml: scope: global -hexagon-yaml: type: code -hexagon-yaml: section-choice: custom-required -hexagon-yaml: section-name: .text 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: fixups: -hexagon-yaml: - offset: 4 +hexagon-yaml: - kind: +hexagon-yaml: offset: 4 hexagon-yaml: target: target hexagon-yaml: - name: target hexagon-yaml: scope: global -hexagon-yaml: type: code +hexagon-yaml: content: [ 00, C0, 00, 5A ] hexagon-yaml: section-choice: custom-required hexagon-yaml: section-name: .text -hexagon-yaml: content: [ 00, C0, 00, 5A ] hexagon-yaml: fixups: -hexagon-yaml: - offset: 0 +hexagon-yaml: - kind: +hexagon-yaml: offset: 0 hexagon-yaml: target: back diff --git a/lld/test/elf/check.objtxt b/lld/test/elf/check.objtxt index cb0f6bb9288..6ad87fb1253 100644 --- a/lld/test/elf/check.objtxt +++ b/lld/test/elf/check.objtxt @@ -1,144 +1,106 @@ 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 -ELF-i386:atoms: +ELF-i386:defined-atoms: ELF-i386: - name: global_func ELF-i386: scope: global -ELF-i386: type: code -ELF-i386: section-choice: custom-required -ELF-i386: section-name: .text ELF-i386: content: [ 55, 89, E5, 83, EC, 18, C7, 04, 24, 00, 00, 00, ELF-i386: 00, E8, FC, FF, FF, FF, C9, C3 ] ELF-i386: - name: static_func -ELF-i386: type: code -ELF-i386: section-choice: custom-required -ELF-i386: section-name: .text ELF-i386: content: [ 55, 89, E5, 83, EC, 18, C7, 04, 24, 07, 00, 00, ELF-i386: 00, E8, FC, FF, FF, FF, C9, C3 ] ELF-i386: - name: weak_func ELF-i386: scope: global -ELF-i386: merge: asWeak -ELF-i386: type: code -ELF-i386: section-choice: custom-required -ELF-i386: section-name: .text ELF-i386: content: [ 55, 89, E5, 83, EC, 18, C7, 04, 24, 0E, 00, 00, ELF-i386: 00, E8, FC, FF, FF, FF, C9, C3 ] +ELF-i386: merge: as-weak ELF-i386: - name: hidden_func ELF-i386: scope: hidden -ELF-i386: type: code -ELF-i386: section-choice: custom-required -ELF-i386: section-name: .text ELF-i386: content: [ 55, 89, E5, 83, EC, 18, C7, 04, 24, 13, 00, 00, ELF-i386: 00, E8, FC, FF, FF, FF, C9, C3 ] ELF-i386: - name: no_dead_strip ELF-i386: scope: global -ELF-i386: type: code -ELF-i386: section-choice: custom-required -ELF-i386: section-name: .text ELF-i386: content: [ 55, 89, E5, 5D, C3 ] ELF-i386: - name: no_special_section_func ELF-i386: scope: global -ELF-i386: type: code -ELF-i386: section-choice: custom-required -ELF-i386: section-name: .text ELF-i386: content: [ 55, 89, E5, 5D, C3 ] ELF-i386: - name: special_section_func ELF-i386: scope: global -ELF-i386: type: code +ELF-i386: content: [ 55, 89, E5, 5D, C3 ] ELF-i386: section-choice: custom-required ELF-i386: section-name: special_section -ELF-i386: content: [ 55, 89, E5, 5D, C3 ] ELF-i386: - name: tentative ELF-i386: scope: global -ELF-i386: merge: asTentative ELF-i386: type: zero-fill +ELF-i386: merge: as-tentative ELF-i386: - name: common_symbol ELF-i386: scope: global -ELF-i386: merge: asTentative ELF-i386: type: zero-fill +ELF-i386: merge: as-tentative +ELF-i386:undefined-atoms: ELF-i386: - name: puts -ELF-i386: definition: undefined +ELF-i386:absolute-atoms: ELF-i386: - name: sample.c -ELF-i386: definition: absolute ELF-i386: value: 0x0 ELF-hexagon:atoms: ELF-hexagon: - name: global_func ELF-hexagon: scope: global -ELF-hexagon: type: code -ELF-hexagon: section-choice: custom-required -ELF-hexagon: section-name: .text ELF-hexagon: content: [ 00, C0, 9D, A0, 00, 40, 00, 00, 00, C0, 00, 78, ELF-hexagon: 00, C0, 00, 5A, 1E, C0, 1E, 96 ] ELF-hexagon: - name: static_func -ELF-hexagon: type: code -ELF-hexagon: section-choice: custom-required -ELF-hexagon: section-name: .text ELF-hexagon: content: [ 00, C0, 9D, A0, 00, 40, 00, 00, 00, C0, 00, 78, ELF-hexagon: 00, C0, 00, 5A, 1E, C0, 1E, 96 ] ELF-hexagon: - name: weak_func ELF-hexagon: scope: global -ELF-hexagon: merge: asWeak -ELF-hexagon: type: code -ELF-hexagon: section-choice: custom-required -ELF-hexagon: section-name: .text ELF-hexagon: content: [ 00, C0, 9D, A0, 00, 40, 00, 00, 00, C0, 00, 78, ELF-hexagon: 00, C0, 00, 5A, 1E, C0, 1E, 96 ] +ELF-hexagon: merge: as-weak ELF-hexagon: - name: hidden_func ELF-hexagon: scope: hidden -ELF-hexagon: type: code -ELF-hexagon: section-choice: custom-required -ELF-hexagon: section-name: .text ELF-hexagon: content: [ 00, C0, 9D, A0, 00, 40, 00, 00, 00, C0, 00, 78, ELF-hexagon: 00, C0, 00, 5A, 1E, C0, 1E, 96 ] ELF-hexagon: - name: no_dead_strip ELF-hexagon: scope: global -ELF-hexagon: type: code -ELF-hexagon: section-choice: custom-required -ELF-hexagon: section-name: .text ELF-hexagon: content: [ 00, C0, 9D, A0, 1E, C0, 1E, 96 ] ELF-hexagon: - name: no_special_section_func ELF-hexagon: scope: global -ELF-hexagon: type: code -ELF-hexagon: section-choice: custom-required -ELF-hexagon: section-name: .text ELF-hexagon: content: [ 00, C0, 9D, A0, 1E, C0, 1E, 96 ] ELF-hexagon: - name: special_section_func ELF-hexagon: scope: global -ELF-hexagon: type: code +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: content: [ 00, C0, 9D, A0, 1E, C0, 1E, 96 ] ELF-hexagon: - name: tentative ELF-hexagon: scope: global -ELF-hexagon: merge: asTentative ELF-hexagon: type: zero-fill +ELF-hexagon: merge: as-tentative ELF-hexagon: - name: common_symbol ELF-hexagon: scope: global -ELF-hexagon: merge: asTentative ELF-hexagon: type: zero-fill +ELF-hexagon: merge: as-tentative +ELF-hexagon: undefined-atoms: ELF-hexagon: - name: puts -ELF-hexagon: definition: undefined +ELF-hexagon: absolute-atoms: ELF-hexagon: - name: sample.c -ELF-hexagon: definition: absolute ELF-hexagon: value: 0x0 diff --git a/lld/test/elf/reloc.objtxt b/lld/test/elf/reloc.objtxt index 5c8b5ff85c1..aedb06d85b8 100644 --- a/lld/test/elf/reloc.objtxt +++ b/lld/test/elf/reloc.objtxt @@ -1,9 +1,8 @@ RUN: lld-core -reader ELF %p/Inputs/reloc-test.elf-i386 | FileCheck %s -check-prefix ELF-i386 ELF-i386:--- -ELF-i386:atoms: +ELF-i386:defined-atoms: ELF-i386: - name: .text -ELF-i386: type: code ELF-i386: section-choice: custom-required ELF-i386: section-name: .text @@ -18,61 +17,57 @@ ELF-i386: section-name: .bss ELF-i386: - name: .rodata.str1.1 ELF-i386: type: constant +ELF-i386: content: [ 68, 65, 6C, 6C, 6F, 20, 77, 6F, 72, 6C, 64, 00 ] ELF-i386: section-choice: custom-required ELF-i386: section-name: .rodata.str1.1 -ELF-i386: content: [ 68, 65, 6C, 6C, 6F, 20, 77, 6F, 72, 6C, 64, 00 ] ELF-i386: - name: .text.startup -ELF-i386: type: code ELF-i386: section-choice: custom-required ELF-i386: section-name: .text.startup ELF-i386: - name: main ELF-i386: scope: global -ELF-i386: type: code -ELF-i386: section-choice: custom-required -ELF-i386: section-name: .text.startup ELF-i386: content: [ 55, 89, E5, 83, E4, F0, 83, EC, 10, C7, 04, 24, ELF-i386: 00, 00, 00, 00, E8, FC, FF, FF, FF, 31, C0, C9, ELF-i386: C3 ] +ELF-i386: section-choice: custom-required +ELF-i386: section-name: .text.startup ELF-i386: fixups: -ELF-i386: - offset: 12 -ELF-i386: kind: ??? +ELF-i386: - kind: ??? +ELF-i386: offset: 12 ELF-i386: target: .rodata.str1.1 -ELF-i386: - offset: 17 -ELF-i386: kind: call32 +ELF-i386: - kind: call32 +ELF-i386: offset: 17 ELF-i386: target: puts ELF-i386: - name: .comment ELF-i386: type: constant -ELF-i386: section-choice: custom-required -ELF-i386: section-name: .comment ELF-i386: content: [ 00, 47, 43, 43, 3A, 20, 28, 47, 4E, 55, 29, 20, ELF-i386: 34, 2E, 37, 2E, 30, 00 ] +ELF-i386: section-choice: custom-required +ELF-i386: section-name: .comment ELF-i386: - name: .note.GNU-stack -ELF-i386: type: code ELF-i386: section-choice: custom-required ELF-i386: section-name: .note.GNU-stack ELF-i386: - name: .eh_frame -ELF-i386: type: code -ELF-i386: section-choice: custom-required -ELF-i386: section-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: section-choice: custom-required +ELF-i386: section-name: .eh_frame ELF-i386: fixups: -ELF-i386: - offset: 32 -ELF-i386: kind: call32 +ELF-i386: - kind: call32 +ELF-i386: offset: 32 ELF-i386: target: .text.startup +ELF-i386:undefined-atoms: ELF-i386: - name: puts -ELF-i386: definition: undefined +ELF-i386:absolute-atoms: ELF-i386: - name: test.c -ELF-i386: definition: absolute ELF-i386: value: 0x0 ELF-i386:... diff --git a/lld/test/elf/x86.objtxt b/lld/test/elf/x86.objtxt index bad6c255aec..750a0a77515 100644 --- a/lld/test/elf/x86.objtxt +++ b/lld/test/elf/x86.objtxt @@ -22,21 +22,17 @@ RUN: lld-core -reader ELF -arch=i386 %p/Inputs/reloc-xb.x86 %p/Inputs/reloc-xt.x x86-yaml: - name: back x86-yaml: scope: global -x86-yaml: type: code -x86-yaml: section-name: .text x86-yaml: content: [ E8, FC, FF, FF, FF ] x86-yaml: fixups: -x86-yaml: - offset: 1 -x86-yaml: kind: call32 +x86-yaml: - kind: call32 +x86-yaml: offset: 1 x86-yaml: target: target x86-yaml: - name: target x86-yaml: scope: global -x86-yaml: type: code -x86-yaml: section-name: .text x86-yaml: content: [ E8, FC, FF, FF, FF ] x86-yaml: fixups: -x86-yaml: - offset: 1 -x86-yaml: kind: call32 +x86-yaml: - kind: call32 +x86-yaml: offset: 1 x86-yaml: target: back diff --git a/lld/test/error-atom-attribute.objtxt b/lld/test/error-atom-attribute.objtxt index 5be6287bbbd..9355a18d045 100644 --- a/lld/test/error-atom-attribute.objtxt +++ b/lld/test/error-atom-attribute.objtxt @@ -6,7 +6,7 @@ # --- -atoms: +defined-atoms: - name: entry scope: hidden foobar: true @@ -15,5 +15,5 @@ atoms: ... -# CHECK: error: Unknown atom attribute +# CHECK: error: unknown key 'foobar' # CHECK: foobar diff --git a/lld/test/error-atom-content-byte-value.objtxt b/lld/test/error-atom-content-byte-value.objtxt index 4113cad5e2b..42fe53376b0 100644 --- a/lld/test/error-atom-content-byte-value.objtxt +++ b/lld/test/error-atom-content-byte-value.objtxt @@ -6,7 +6,7 @@ # --- -atoms: +defined-atoms: - name: entry scope: hidden content: [ A5, 00, 4G, 1F ] @@ -14,5 +14,5 @@ atoms: ... -# CHECK: error: Invalid content hex byte +# CHECK: error: invalid two-digit-hex number # CHECK: 4G diff --git a/lld/test/error-atom-content-bytes.objtxt b/lld/test/error-atom-content-bytes.objtxt index 40e9d6e4b6a..f887da56953 100644 --- a/lld/test/error-atom-content-bytes.objtxt +++ b/lld/test/error-atom-content-bytes.objtxt @@ -6,7 +6,7 @@ # --- -atoms: +defined-atoms: - name: entry scope: hidden content: [ A5, 1234, 00, 4F ] @@ -14,6 +14,6 @@ atoms: ... -# CHECK: error: Content hex byte out of range +# CHECK: error: out of range two-digit-hex number # CHECK: 1234 diff --git a/lld/test/error-atom-type.objtxt b/lld/test/error-atom-type.objtxt index 85a568e6503..aae1ffff862 100644 --- a/lld/test/error-atom-type.objtxt +++ b/lld/test/error-atom-type.objtxt @@ -6,7 +6,7 @@ # --- -atoms: +defined-atoms: - name: entry scope: hidden type: superluminal @@ -15,5 +15,5 @@ atoms: ... -# CHECK: error: Invalid value for 'type:' +# CHECK: error: unknown enumerated scalar # CHECK: superluminal diff --git a/lld/test/error-atom-undefined-wrong-attribue.objtxt b/lld/test/error-atom-undefined-wrong-attribue.objtxt index 342adfb3208..b5a117fac7f 100644 --- a/lld/test/error-atom-undefined-wrong-attribue.objtxt +++ b/lld/test/error-atom-undefined-wrong-attribue.objtxt @@ -6,13 +6,12 @@ # --- -atoms: +undefined-atoms: - name: foo type: code - definition: undefined ... -# CHECK: error: Undefined atom 'foo' has attributes only allowed on defined atoms +# CHECK: error: unknown key 'type' diff --git a/lld/test/error-file-attribute.objtxt b/lld/test/error-file-attribute.objtxt index 4806e4c8562..3a3997f0d63 100644 --- a/lld/test/error-file-attribute.objtxt +++ b/lld/test/error-file-attribute.objtxt @@ -7,12 +7,11 @@ --- aardvark: true -atoms: +defined-atoms: - name: entry scope: hidden ... -# CHECK: error: Unknown file attribute -# CHECK: aardvark +# CHECK: error: unknown key 'aardvark' diff --git a/lld/test/error-fixup-attribute.objtxt b/lld/test/error-fixup-attribute.objtxt index 6a2fd2a94e1..1942e086d52 100644 --- a/lld/test/error-fixup-attribute.objtxt +++ b/lld/test/error-fixup-attribute.objtxt @@ -6,7 +6,7 @@ # --- -atoms: +defined-atoms: - name: entry scope: hidden fixups: @@ -18,5 +18,4 @@ atoms: ... -# CHECK: error: Unknown fixup attribute -# CHECK: weasel +# CHECK: error: unknown key 'weasel' diff --git a/lld/test/error-fixup-target.objtxt b/lld/test/error-fixup-target.objtxt index 664d0904692..3d4220c1b5f 100644 --- a/lld/test/error-fixup-target.objtxt +++ b/lld/test/error-fixup-target.objtxt @@ -6,7 +6,7 @@ # --- -atoms: +defined-atoms: - name: entry scope: hidden fixups: @@ -17,11 +17,10 @@ atoms: kind: 3 target: baz +undefined-atoms: - name: bar - definition: undefined ... -# CHECK: error: Fixup has target 'baz' which does not exist -# CHECK: baz +# CHECK: error: no such atom name: baz diff --git a/lld/test/fixups-addend.objtxt b/lld/test/fixups-addend.objtxt index 70bf92fd429..2ccea16633f 100644 --- a/lld/test/fixups-addend.objtxt +++ b/lld/test/fixups-addend.objtxt @@ -5,7 +5,7 @@ # --- -atoms: +defined-atoms: - name: foo type: code content: [ 48, 8D, 3D, 00, 00, 00, 00, @@ -34,8 +34,8 @@ atoms: target: bar addend: -50 +undefined-atoms: - name: bar - definition: undefined ... diff --git a/lld/test/fixups-dup-named.objtxt b/lld/test/fixups-dup-named.objtxt index d1b1284e8f3..7e78687d5d5 100644 --- a/lld/test/fixups-dup-named.objtxt +++ b/lld/test/fixups-dup-named.objtxt @@ -5,7 +5,7 @@ # --- -atoms: +defined-atoms: - name: foo type: code content: [ E8, 00, 00, 00, 00, E8, 00, 00, 00, 00 ] diff --git a/lld/test/fixups-named.objtxt b/lld/test/fixups-named.objtxt index 1bf38c06e56..1cb5b31b0b0 100644 --- a/lld/test/fixups-named.objtxt +++ b/lld/test/fixups-named.objtxt @@ -5,10 +5,11 @@ # --- -atoms: +defined-atoms: - name: foo type: code - content: [ E8, 00, 00, 00, 00, E8, 00, 00, 00, 00 ] + content: [ E8, 00, 00, 00, 00, + E8, 00, 00, 00, 00 ] fixups: - offset: 1 kind: 3 @@ -21,8 +22,8 @@ atoms: scope: static type: code +undefined-atoms: - name: bar - definition: undefined ... diff --git a/lld/test/fixups-unnamed.objtxt b/lld/test/fixups-unnamed.objtxt index 9dbab812445..340e1487847 100644 --- a/lld/test/fixups-unnamed.objtxt +++ b/lld/test/fixups-unnamed.objtxt @@ -5,7 +5,7 @@ # --- -atoms: +defined-atoms: - name: foo type: code content: [ 48, 8D, 3D, 00, 00, 00, 00, diff --git a/lld/test/inline-coalesce.objtxt b/lld/test/inline-coalesce.objtxt index edd7f471f42..218967e7d08 100644 --- a/lld/test/inline-coalesce.objtxt +++ b/lld/test/inline-coalesce.objtxt @@ -5,30 +5,27 @@ # --- -atoms: +defined-atoms: - name: _inlineFunc scope: global - definition: regular type: code - merge: asWeak + merge: as-weak --- -atoms: +defined-atoms: - name: _inlineFunc scope: global - definition: regular type: code - merge: asWeak + merge: as-weak --- -atoms: +defined-atoms: - name: _inlineFunc scope: global - definition: regular type: code - merge: asWeak + merge: as-weak ... # CHECK: name: _inlineFunc -# CHECK: merge: asWeak +# CHECK: merge: as-weak # CHECK-NOT: name: _inlineFunc # CHECK: ... diff --git a/lld/test/multiple-def-error.objtxt b/lld/test/multiple-def-error.objtxt index 3017ad64945..62281e889d1 100644 --- a/lld/test/multiple-def-error.objtxt +++ b/lld/test/multiple-def-error.objtxt @@ -7,15 +7,13 @@ # CHECK: duplicate symbol --- -atoms: +defined-atoms: - name: _foo - definition: regular scope: global type: data --- -atoms: +defined-atoms: - name: _foo - definition: regular scope: global type: data ... diff --git a/lld/test/pass-got-basic.objtxt b/lld/test/pass-got-basic.objtxt index bce1d8331d0..d1f04f6dc1c 100644 --- a/lld/test/pass-got-basic.objtxt +++ b/lld/test/pass-got-basic.objtxt @@ -5,7 +5,7 @@ # --- -atoms: +defined-atoms: - name: foo type: code content: [ 48, 8B, 0D, 00, 00, 00, 00, @@ -43,32 +43,33 @@ atoms: scope: global interposable: yes +shared-library-atoms: - name: malloc - definition: shared-library load-name: libc.so ... +# CHECK: defined-atoms: # CHECK: name: foo # CHECK: fixups: -# CHECK: offset: 3 -# CHECK: kind: pcrel32 -# CHECK: target: L -# CHECK: offset: 10 -# CHECK: kind: lea32wasGot -# CHECK: target: myPrivate -# CHECK: offset: 17 -# CHECK: kind: pcrel32 -# CHECK: target: L -# CHECK: offset: 24 -# CHECK: kind: pcrel32 -# CHECK: target: L -# CHECK: offset: 32 -# CHECK: kind: pcrel32 -# CHECK: target: L -# CHECK: offset: 40 -# CHECK: kind: pcrel32 -# CHECK: target: L +# CHECK: kind: pcrel32 +# CHECK: offset: 3 +# CHECK: target: L +# CHECK: kind: lea32wasGot +# CHECK: offset: 10 +# CHECK: target: myPrivate +# CHECK: kind: pcrel32 +# CHECK: offset: 17 +# CHECK: target: L +# CHECK: kind: pcrel32 +# CHECK: offset: 24 +# CHECK: target: L +# CHECK: kind: pcrel32 +# CHECK: offset: 32 +# CHECK: target: L +# CHECK: kind: pcrel32 +# CHECK: offset: 40 +# CHECK: target: L # CHECK: name: myPrivate # CHECK: name: myInterposable # CHECK: interposable: yes @@ -76,6 +77,6 @@ atoms: # CHECK: type: got # CHECK: type: got # CHECK: type: got +# CHECK: shared-library-atoms: # CHECK: name: malloc -# CHECK: definition: shared-library # CHECK: ... diff --git a/lld/test/pass-stubs-basic.objtxt b/lld/test/pass-stubs-basic.objtxt index 317372b0400..d05ba139c24 100644 --- a/lld/test/pass-stubs-basic.objtxt +++ b/lld/test/pass-stubs-basic.objtxt @@ -5,7 +5,7 @@ # --- -atoms: +defined-atoms: - name: foo type: code content: [ E8, 00, 00, 00, 00, E8, 00, 00, 00, @@ -21,12 +21,11 @@ atoms: kind: gotLoad32 target: malloc +shared-library-atoms: - name: malloc - definition: shared-library load-name: libc.so - name: free - definition: shared-library load-name: libc.so ... @@ -44,7 +43,5 @@ atoms: # CHECK: name: L # CHECK: type: stub # CHECK: name: malloc -# CHECK: definition: shared-library # CHECK: name: free -# CHECK: definition: shared-library # CHECK: ... diff --git a/lld/test/shared-library-basic.objtxt b/lld/test/shared-library-basic.objtxt index 553af50b621..bcdf04d3176 100644 --- a/lld/test/shared-library-basic.objtxt +++ b/lld/test/shared-library-basic.objtxt @@ -5,30 +5,25 @@ # --- -atoms: +shared-library-atoms: - name: malloc - definition: shared-library load-name: libc.so - name: free - definition: shared-library load-name: libc.so - name: fast_malloc - definition: shared-library load-name: libc.so can-be-null: at-runtime ... +# CHECK: shared-library-atoms: # CHECK: name: malloc -# CHECK: definition: shared-library # CHECK: load-name: libc.so # CHECK: name: free -# CHECK: definition: shared-library # CHECK: load-name: libc.so # CHECK: name: fast_malloc -# CHECK: definition: shared-library # CHECK: load-name: libc.so # CHECK: can-be-null: at-runtime # CHECK: ... diff --git a/lld/test/shared-library-coalesce.objtxt b/lld/test/shared-library-coalesce.objtxt index d3c548d9e89..04102487919 100644 --- a/lld/test/shared-library-coalesce.objtxt +++ b/lld/test/shared-library-coalesce.objtxt @@ -5,106 +5,80 @@ # --- -atoms: +shared-library-atoms: - name: foo1 - definition: shared-library load-name: libc.so - name: foo2 - definition: shared-library load-name: libc.so - name: bar1 - definition: shared-library load-name: libc.so can-be-null: at-runtime - name: bar2 - definition: shared-library load-name: libc.so can-be-null: at-runtime - name: mismatchNull1 - definition: shared-library load-name: libc.so can-be-null: at-runtime - name: mismatchNull2 - definition: shared-library load-name: libc.so - name: mismatchload1 - definition: shared-library load-name: liba.so - name: mismatchload2 - definition: shared-library load-name: libb.so --- -atoms: +shared-library-atoms: - name: foo2 - definition: shared-library load-name: libc.so - name: foo3 - definition: shared-library load-name: libc.so - name: bar2 - definition: shared-library load-name: libc.so can-be-null: at-runtime - name: bar3 - definition: shared-library load-name: libc.so can-be-null: at-runtime - name: mismatchNull1 - definition: shared-library load-name: libc.so - name: mismatchNull2 - definition: shared-library load-name: libc.so can-be-null: at-runtime - name: mismatchload1 - definition: shared-library load-name: libb.so - name: mismatchload2 - definition: shared-library load-name: liba.so ... # CHECK: name: foo1 -# CHECK: definition: shared-library # CHECK: name: foo2 -# CHECK: definition: shared-library # CHECK: name: bar1 -# CHECK: definition: shared-library # CHECK: can-be-null: at-runtime # CHECK: name: bar2 -# CHECK: definition: shared-library # CHECK: can-be-null: at-runtime # CHECK: name: mismatchNull1 -# CHECK: definition: shared-library # CHECK: can-be-null: at-runtime # CHECK: name: mismatchNull2 -# CHECK: definition: shared-library # CHECK-NOT: can-be-null: at-runtime # CHECK: name: mismatchload1 -# CHECK: definition: shared-library # CHECK: load-name: liba.so # CHECK: name: mismatchload2 -# CHECK: definition: shared-library # CHECK: load-name: libb.so # CHECK: name: foo3 -# CHECK: definition: shared-library # CHECK: name: bar3 -# CHECK: definition: shared-library # CHECK: can-be-null: at-runtime # CHECK: ... diff --git a/lld/test/tent-merge.objtxt b/lld/test/tent-merge.objtxt index 4872b163ee6..18d6f56662a 100644 --- a/lld/test/tent-merge.objtxt +++ b/lld/test/tent-merge.objtxt @@ -6,17 +6,15 @@ # --- -atoms: +defined-atoms: - name: _foo - definition: regular - merge: asTentative + merge: as-tentative scope: global type: zero-fill size: 4 --- -atoms: +defined-atoms: - name: _foo - definition: regular scope: global type: data content: [ 00, 00, 00, 00 ] @@ -24,4 +22,4 @@ atoms: # CHECK: name: _foo -# CHECK-NOT: merge: asTentative +# CHECK-NOT: merge: as-tentative diff --git a/lld/test/undef-coalesce-error.objtxt b/lld/test/undef-coalesce-error.objtxt index ab2092fb952..bbf6d1db765 100644 --- a/lld/test/undef-coalesce-error.objtxt +++ b/lld/test/undef-coalesce-error.objtxt @@ -8,44 +8,40 @@ # --- -atoms: +defined-atoms: - name: foo type: code +undefined-atoms: - name: malloc - definition: undefined - - name: free - definition: undefined --- -atoms: +defined-atoms: - name: bar type: code +undefined-atoms: - name: malloc - definition: undefined - - name: myfunc - definition: undefined --- -atoms: +defined-atoms: - name: myfunc scope: global type: code +undefined-atoms: - name: free - definition: undefined ... # CHECKERR: free # CHECKERR: malloc # CHECKERR: symbol(s) not found +# CHECK: defined-atoms: # CHECK: name: foo # CHECK: name: bar # CHECK: name: myfunc +# CHECK: undefined-atoms: # CHECK: name: malloc -# CHECK: definition: undefined # CHECK: name: free -# CHECK: definition: undefined # CHECK: ... diff --git a/lld/test/undef-coalesce.objtxt b/lld/test/undef-coalesce.objtxt index 0ae8f78d18d..08e1cf80a53 100644 --- a/lld/test/undef-coalesce.objtxt +++ b/lld/test/undef-coalesce.objtxt @@ -6,41 +6,37 @@ # --- -atoms: +defined-atoms: - name: foo type: code +undefined-atoms: - name: malloc - definition: undefined - - name: free - definition: undefined --- -atoms: +defined-atoms: - name: bar type: code +undefined-atoms: - name: malloc - definition: undefined - - name: myfunc - definition: undefined --- -atoms: +defined-atoms: - name: myfunc scope: global type: code +undefined-atoms: - name: free - definition: undefined ... +# CHECK: defined-atoms: # CHECK: name: foo # CHECK: name: bar # CHECK: name: myfunc # CHECK: scope: global +# CHECK: undefined-atoms: # CHECK: name: malloc -# CHECK: definition: undefined # CHECK: name: free -# CHECK: definition: undefined # CHECK: ... diff --git a/lld/test/undef-weak-coalesce.objtxt b/lld/test/undef-weak-coalesce.objtxt index f3ba7039b52..7a324e0166d 100644 --- a/lld/test/undef-weak-coalesce.objtxt +++ b/lld/test/undef-weak-coalesce.objtxt @@ -5,101 +5,77 @@ # --- -atoms: +undefined-atoms: - name: regular_func - definition: undefined can-be-null: never - name: weak_import_func - definition: undefined can-be-null: at-runtime - name: weak_func - definition: undefined can-be-null: at-buildtime - name: bar1 - definition: undefined can-be-null: never - name: bar2 - definition: undefined can-be-null: at-runtime - name: bar3 - definition: undefined can-be-null: at-buildtime - name: bar4 - definition: undefined can-be-null: never - name: bar5 - definition: undefined can-be-null: at-runtime - name: bar6 - definition: undefined can-be-null: at-buildtime - name: bar7 - definition: undefined can-be-null: never - name: bar8 - definition: undefined can-be-null: at-runtime - name: bar9 - definition: undefined can-be-null: at-buildtime --- -atoms: +undefined-atoms: - name: bar1 - definition: undefined can-be-null: never - name: bar2 - definition: undefined can-be-null: at-runtime - name: bar3 - definition: undefined can-be-null: at-buildtime - name: bar4 - definition: undefined can-be-null: at-runtime - name: bar5 - definition: undefined can-be-null: at-buildtime - name: bar6 - definition: undefined can-be-null: never - name: bar7 - definition: undefined can-be-null: at-buildtime - name: bar8 - definition: undefined can-be-null: never - name: bar9 - definition: undefined can-be-null: at-runtime ... # CHECK: name: regular_func -# CHECK: definition: undefined # CHECK: name: weak_import_func -# CHECK: definition: undefined # CHECK: can-be-null: at-runtime # CHECK: name: weak_func -# CHECK: definition: undefined # CHECK: can-be-null: at-buildtime # CHECK: name: bar1 # CHECK: name: bar2 diff --git a/lld/test/weak-coalesce.objtxt b/lld/test/weak-coalesce.objtxt index 48f088c2670..fdeae89a386 100644 --- a/lld/test/weak-coalesce.objtxt +++ b/lld/test/weak-coalesce.objtxt @@ -5,29 +5,26 @@ # --- -atoms: +defined-atoms: - name: _foo - definition: regular - merge: asWeak + merge: as-weak scope: global type: data --- -atoms: +defined-atoms: - name: _foo - definition: regular scope: global type: data --- -atoms: +defined-atoms: - name: _foo - definition: regular - merge: asWeak + merge: as-weak scope: global type: data ... # CHECK: name: _foo -# CHECK-NOT: merge: asWeak +# CHECK-NOT: merge: as-weak # CHECK-NOT: name: _foo # CHECK: ... |

