diff options
author | Jonas Devlieghere <jonas@devlieghere.com> | 2019-10-07 20:31:28 +0000 |
---|---|---|
committer | Jonas Devlieghere <jonas@devlieghere.com> | 2019-10-07 20:31:28 +0000 |
commit | 4db091754b401832b8748b6aa431015771bf0908 (patch) | |
tree | d048689fda5916ea07c4c15fc1801989c3fcb24e /lldb/lit/ObjectFile | |
parent | 369407fc52238ba2d11628975e345d766ce24fee (diff) | |
download | bcm5719-llvm-4db091754b401832b8748b6aa431015771bf0908.tar.gz bcm5719-llvm-4db091754b401832b8748b6aa431015771bf0908.zip |
[test] Rename `Modules` to `ObjectFile` (NFC)
llvm-svn: 373955
Diffstat (limited to 'lldb/lit/ObjectFile')
62 files changed, 3154 insertions, 0 deletions
diff --git a/lldb/lit/ObjectFile/Breakpad/Inputs/bad-module-id-1.syms b/lldb/lit/ObjectFile/Breakpad/Inputs/bad-module-id-1.syms new file mode 100644 index 00000000000..0241d512862 --- /dev/null +++ b/lldb/lit/ObjectFile/Breakpad/Inputs/bad-module-id-1.syms @@ -0,0 +1,2 @@ +MODULE Linux x86_64 E5894855+C35D+CCCCCCCCCCCCCCCCCCCC0 linux.out +PUBLIC 1000 0 _start diff --git a/lldb/lit/ObjectFile/Breakpad/Inputs/bad-module-id-2.syms b/lldb/lit/ObjectFile/Breakpad/Inputs/bad-module-id-2.syms new file mode 100644 index 00000000000..4ae10438f30 --- /dev/null +++ b/lldb/lit/ObjectFile/Breakpad/Inputs/bad-module-id-2.syms @@ -0,0 +1,2 @@ +MODULE Linux x86_64 E5894855C35DCCCCCCCCCCCCCCCCC linux.out +PUBLIC 1000 0 _start diff --git a/lldb/lit/ObjectFile/Breakpad/Inputs/bad-module-id-3.syms b/lldb/lit/ObjectFile/Breakpad/Inputs/bad-module-id-3.syms new file mode 100644 index 00000000000..2e6d72a37d5 --- /dev/null +++ b/lldb/lit/ObjectFile/Breakpad/Inputs/bad-module-id-3.syms @@ -0,0 +1,2 @@ +MODULE Linux x86_64 E58X4855C35DCCCCCCCCXCCCCCCCCCCC0 linux.out +PUBLIC 1000 0 _start diff --git a/lldb/lit/ObjectFile/Breakpad/Inputs/discontiguous-sections.syms b/lldb/lit/ObjectFile/Breakpad/Inputs/discontiguous-sections.syms new file mode 100644 index 00000000000..40c94574215 --- /dev/null +++ b/lldb/lit/ObjectFile/Breakpad/Inputs/discontiguous-sections.syms @@ -0,0 +1,7 @@ +MODULE Linux x86_64 0000000024B5D199F0F766FFFFFF5DC30 linux.out +INFO CODE_ID 00000000B52499D1F0F766FFFFFF5DC3 +FILE 0 /tmp/a.c +PUBLIC 1010 0 _start +FILE 1 /tmp/b.c +STACK bogus +FILE 2 /tmp/c.c diff --git a/lldb/lit/ObjectFile/Breakpad/Inputs/identification-linux.syms b/lldb/lit/ObjectFile/Breakpad/Inputs/identification-linux.syms new file mode 100644 index 00000000000..d82e30c4a05 --- /dev/null +++ b/lldb/lit/ObjectFile/Breakpad/Inputs/identification-linux.syms @@ -0,0 +1,6 @@ +MODULE Linux x86_64 E5894855C35DCCCCCCCCCCCCCCCCCCCC0 linux.out +INFO CODE_ID 554889E55DC3CCCCCCCCCCCCCCCCCCCC +PUBLIC 1000 0 _start +STACK CFI INIT 1000 6 .cfa: $rsp 8 + .ra: .cfa -8 + ^ +STACK CFI 1001 $rbp: .cfa -16 + ^ .cfa: $rsp 16 + +STACK CFI 1004 .cfa: $rbp 16 + diff --git a/lldb/lit/ObjectFile/Breakpad/Inputs/identification-macosx-arm64e.syms b/lldb/lit/ObjectFile/Breakpad/Inputs/identification-macosx-arm64e.syms new file mode 100644 index 00000000000..18090d7a0d5 --- /dev/null +++ b/lldb/lit/ObjectFile/Breakpad/Inputs/identification-macosx-arm64e.syms @@ -0,0 +1,3 @@ +MODULE mac arm64e 4E11896957B3334EB03456BFCEB573760 mac.out +PUBLIC 0 0 _mh_execute_header +PUBLIC f30 0 start diff --git a/lldb/lit/ObjectFile/Breakpad/Inputs/identification-macosx.syms b/lldb/lit/ObjectFile/Breakpad/Inputs/identification-macosx.syms new file mode 100644 index 00000000000..56e0635e5f6 --- /dev/null +++ b/lldb/lit/ObjectFile/Breakpad/Inputs/identification-macosx.syms @@ -0,0 +1,6 @@ +MODULE mac x86_64 D98C0E682089AA1BEACD6A8C1F16707B0 mac.out +PUBLIC 0 0 _mh_execute_header +PUBLIC f30 0 start +STACK CFI INIT f30 6 .cfa: $rsp 8 + .ra: .cfa -8 + ^ +STACK CFI f31 $rbp: .cfa -16 + ^ .cfa: $rsp 16 + +STACK CFI f34 .cfa: $rbp 16 + diff --git a/lldb/lit/ObjectFile/Breakpad/Inputs/identification-windows.syms b/lldb/lit/ObjectFile/Breakpad/Inputs/identification-windows.syms new file mode 100644 index 00000000000..8fa5f305209 --- /dev/null +++ b/lldb/lit/ObjectFile/Breakpad/Inputs/identification-windows.syms @@ -0,0 +1,4 @@ +MODULE windows x86 A0C9165780B5490981A1925EA62165C01 a.pdb
+INFO CODE_ID 5C01672A4000 a.exe
+FILE 1 c:\tmp\a.cpp
+PUBLIC 1000 0 main
diff --git a/lldb/lit/ObjectFile/Breakpad/Inputs/sections-trailing-func.syms b/lldb/lit/ObjectFile/Breakpad/Inputs/sections-trailing-func.syms new file mode 100644 index 00000000000..6176d35143c --- /dev/null +++ b/lldb/lit/ObjectFile/Breakpad/Inputs/sections-trailing-func.syms @@ -0,0 +1,8 @@ +MODULE Linux x86_64 0000000024B5D199F0F766FFFFFF5DC30 linux.out +INFO CODE_ID 00000000B52499D1F0F766FFFFFF5DC3 +FILE 0 /tmp/a.c +FUNC 1010 10 0 _start +1010 4 4 0 +1014 5 5 0 +1019 5 6 0 +101e 2 7 0 diff --git a/lldb/lit/ObjectFile/Breakpad/Inputs/sections.syms b/lldb/lit/ObjectFile/Breakpad/Inputs/sections.syms new file mode 100644 index 00000000000..121cca439b0 --- /dev/null +++ b/lldb/lit/ObjectFile/Breakpad/Inputs/sections.syms @@ -0,0 +1,12 @@ +MODULE Linux x86_64 0000000024B5D199F0F766FFFFFF5DC30 linux.out +INFO CODE_ID 00000000B52499D1F0F766FFFFFF5DC3 +FILE 0 /tmp/a.c +FUNC 1010 10 0 _start +1010 4 4 0 +1014 5 5 0 +1019 5 6 0 +101e 2 7 0 +PUBLIC 1010 0 _start +STACK CFI INIT 1010 10 .cfa: $rsp 8 + .ra: .cfa -8 + ^ +STACK CFI 1011 $rbp: .cfa -16 + ^ .cfa: $rsp 16 + +STACK CFI 1014 .cfa: $rbp 16 + diff --git a/lldb/lit/ObjectFile/Breakpad/Inputs/uuid-matching-mac.syms b/lldb/lit/ObjectFile/Breakpad/Inputs/uuid-matching-mac.syms new file mode 100644 index 00000000000..7da9264de98 --- /dev/null +++ b/lldb/lit/ObjectFile/Breakpad/Inputs/uuid-matching-mac.syms @@ -0,0 +1,2 @@ +MODULE mac x86_64 A0AB76409C3B3A279E521045D84FA2DC0 a.out +FUNC f90 1b 0 main diff --git a/lldb/lit/ObjectFile/Breakpad/Inputs/uuid-matching-mac.yaml b/lldb/lit/ObjectFile/Breakpad/Inputs/uuid-matching-mac.yaml new file mode 100644 index 00000000000..9e1af9c6e90 --- /dev/null +++ b/lldb/lit/ObjectFile/Breakpad/Inputs/uuid-matching-mac.yaml @@ -0,0 +1,59 @@ +--- !mach-o +FileHeader: + magic: 0xFEEDFACF + cputype: 0x01000007 + cpusubtype: 0x80000003 + filetype: 0x00000002 + ncmds: 14 + sizeofcmds: 744 + flags: 0x00200085 + reserved: 0x00000000 +LoadCommands: + - cmd: LC_SEGMENT_64 + cmdsize: 72 + segname: __PAGEZERO + vmaddr: 0 + vmsize: 4294967296 + fileoff: 0 + filesize: 0 + maxprot: 0 + initprot: 0 + nsects: 0 + flags: 0 + - cmd: LC_SEGMENT_64 + cmdsize: 232 + segname: __TEXT + vmaddr: 4294967296 + vmsize: 4096 + fileoff: 0 + filesize: 4096 + maxprot: 7 + initprot: 5 + nsects: 2 + flags: 0 + Sections: + - sectname: __text + segname: __TEXT + addr: 0x0000000100000F90 + size: 27 + offset: 0x00000F90 + align: 4 + reloff: 0x00000000 + nreloc: 0 + flags: 0x80000400 + reserved1: 0x00000000 + reserved2: 0x00000000 + reserved3: 0x00000000 + - cmd: LC_UUID + cmdsize: 24 + uuid: A0AB7640-9C3B-3A27-9E52-1045D84FA2DC + - cmd: LC_BUILD_VERSION + cmdsize: 32 + platform: 1 + minos: 658944 + sdk: 658944 + ntools: 1 + Tools: + - tool: 3 + version: 29491968 +... diff --git a/lldb/lit/ObjectFile/Breakpad/breakpad-identification.test b/lldb/lit/ObjectFile/Breakpad/breakpad-identification.test new file mode 100644 index 00000000000..312eb148023 --- /dev/null +++ b/lldb/lit/ObjectFile/Breakpad/breakpad-identification.test @@ -0,0 +1,35 @@ +RUN: lldb-test object-file %p/Inputs/identification-linux.syms | FileCheck %s --check-prefix=LINUX +RUN: lldb-test object-file %p/Inputs/identification-macosx.syms | FileCheck %s --check-prefix=MAC +RUN: lldb-test object-file %p/Inputs/identification-macosx-arm64e.syms | FileCheck %s --check-prefix=ARM64E +RUN: lldb-test object-file %p/Inputs/identification-windows.syms | FileCheck %s --check-prefix=WINDOWS +RUN: not lldb-test object-file %p/Inputs/bad-module-id-1.syms 2>&1 | FileCheck %s --check-prefix=ERROR +RUN: not lldb-test object-file %p/Inputs/bad-module-id-2.syms 2>&1 | FileCheck %s --check-prefix=ERROR +RUN: not lldb-test object-file %p/Inputs/bad-module-id-3.syms 2>&1 | FileCheck %s --check-prefix=ERROR + +LINUX: Plugin name: breakpad +LINUX: Architecture: x86_64--linux +LINUX: UUID: 554889E5-5DC3-CCCC-CCCC-CCCCCCCCCCCC +LINUX: Executable: false +LINUX: Stripped: false +LINUX: Type: debug info +LINUX: Strata: user + +MAC: Plugin name: breakpad +MAC: Architecture: x86_64--macosx +MAC: UUID: D98C0E68-2089-AA1B-EACD-6A8C1F16707B +MAC: Executable: false +MAC: Stripped: false +MAC: Type: debug info +MAC: Strata: user + +ARM64E: Architecture: aarch64--macosx + +WINDOWS: Plugin name: breakpad +WINDOWS: Architecture: i386--windows +WINDOWS: UUID: A0C91657-80B5-4909-81A1-925EA62165C0-00000001 +WINDOWS: Executable: false +WINDOWS: Stripped: false +WINDOWS: Type: debug info +WINDOWS: Strata: user + +ERROR: not recognised as an object file diff --git a/lldb/lit/ObjectFile/Breakpad/discontiguous-sections.test b/lldb/lit/ObjectFile/Breakpad/discontiguous-sections.test new file mode 100644 index 00000000000..6b765e0c40e --- /dev/null +++ b/lldb/lit/ObjectFile/Breakpad/discontiguous-sections.test @@ -0,0 +1,34 @@ +# Test handling discontiguous sections. +RUN: lldb-test object-file %p/Inputs/discontiguous-sections.syms -contents | FileCheck %s + +CHECK: Showing 6 sections + +CHECK: ID: 0x1 +CHECK-NEXT: Name: MODULE + +CHECK: ID: 0x2 +CHECK-NEXT: Name: INFO + +CHECK: ID: 0x3 +CHECK-NEXT: Name: FILE +CHECK: File size: 16 +CHECK-NEXT: Data: ( +CHECK-NEXT: 0000: 46494C45 2030202F 746D702F 612E630A |FILE 0 /tmp/a.c.| +CHECK-NEXT: ) + +CHECK: ID: 0x4 +CHECK-NEXT: Name: PUBLIC + +CHECK: ID: 0x5 +CHECK-NEXT: Name: FILE +CHECK: File size: 16 +CHECK-NEXT: Data: ( +CHECK-NEXT: 0000: 46494C45 2031202F 746D702F 622E630A |FILE 1 /tmp/b.c.| +CHECK-NEXT: ) + +CHECK: ID: 0x6 +CHECK-NEXT: Name: FILE +CHECK: File size: 16 +CHECK-NEXT: Data: ( +CHECK-NEXT: 0000: 46494C45 2032202F 746D702F 632E630A |FILE 2 /tmp/c.c.| +CHECK-NEXT: ) diff --git a/lldb/lit/ObjectFile/Breakpad/lit.local.cfg b/lldb/lit/ObjectFile/Breakpad/lit.local.cfg new file mode 100644 index 00000000000..df9b335dd13 --- /dev/null +++ b/lldb/lit/ObjectFile/Breakpad/lit.local.cfg @@ -0,0 +1 @@ +config.suffixes = ['.test'] diff --git a/lldb/lit/ObjectFile/Breakpad/sections-trailing-func.test b/lldb/lit/ObjectFile/Breakpad/sections-trailing-func.test new file mode 100644 index 00000000000..9ea5c9da781 --- /dev/null +++ b/lldb/lit/ObjectFile/Breakpad/sections-trailing-func.test @@ -0,0 +1,15 @@ +# Test handling of a (valid) breakpad file, which ends with a line without a +# recognised keyword. + +RUN: lldb-test object-file %p/Inputs/sections-trailing-func.syms -contents | FileCheck %s + +CHECK: Showing 4 sections + +CHECK: ID: 0x4 +CHECK-NEXT: Name: FUNC +CHECK: File size: 66 +CHECK-NEXT: Data: ( +CHECK-NEXT: 0000: 46554E43 20313031 30203130 2030205F 73746172 740A3130 31302034 20342030 |FUNC 1010 10 0 _start.1010 4 4 0| +CHECK-NEXT: 0020: 0A313031 34203520 3520300A 31303139 20352036 20300A31 30316520 32203720 |.1014 5 5 0.1019 5 6 0.101e 2 7 | +CHECK-NEXT: 0040: 300A |0.| +CHECK-NEXT: ) diff --git a/lldb/lit/ObjectFile/Breakpad/sections.test b/lldb/lit/ObjectFile/Breakpad/sections.test new file mode 100644 index 00000000000..90f3d92643a --- /dev/null +++ b/lldb/lit/ObjectFile/Breakpad/sections.test @@ -0,0 +1,89 @@ +RUN: lldb-test object-file %p/Inputs/sections.syms -contents | FileCheck %s + +CHECK: Showing 6 sections + +CHECK: Index: 0 +CHECK-NEXT: ID: 0x1 +CHECK-NEXT: Name: MODULE +CHECK-NEXT: Type: regular +CHECK-NEXT: Permissions: --- +CHECK-NEXT: Thread specific: no +CHECK-NEXT: VM address: 0 +CHECK-NEXT: VM size: 0 +CHECK-NEXT: File size: 64 +CHECK-NEXT: Data: ( +CHECK-NEXT: 0000: 4D4F4455 4C45204C 696E7578 20783836 5F363420 30303030 30303030 32344235 |MODULE Linux x86_64 0000000024B5| +CHECK-NEXT: 0020: 44313939 46304637 36364646 46464646 35444333 30206C69 6E75782E 6F75740A |D199F0F766FFFFFF5DC30 linux.out.| +CHECK-NEXT: ) + +CHECK: Index: 1 +CHECK-NEXT: ID: 0x2 +CHECK-NEXT: Name: INFO +CHECK-NEXT: Type: regular +CHECK-NEXT: Permissions: --- +CHECK-NEXT: Thread specific: no +CHECK-NEXT: VM address: 0 +CHECK-NEXT: VM size: 0 +CHECK-NEXT: File size: 46 +CHECK-NEXT: Data: ( +CHECK-NEXT: 0000: 494E464F 20434F44 455F4944 20303030 30303030 30423532 34393944 31463046 |INFO CODE_ID 00000000B52499D1F0F| +CHECK-NEXT: 0020: 37363646 46464646 46354443 330A |766FFFFFF5DC3.| +CHECK-NEXT: ) + +CHECK: Index: 2 +CHECK-NEXT: ID: 0x3 +CHECK-NEXT: Name: FILE +CHECK-NEXT: Type: regular +CHECK-NEXT: Permissions: --- +CHECK-NEXT: Thread specific: no +CHECK-NEXT: VM address: 0 +CHECK-NEXT: VM size: 0 +CHECK-NEXT: File size: 16 +CHECK-NEXT: Data: ( +CHECK-NEXT: 0000: 46494C45 2030202F 746D702F 612E630A |FILE 0 /tmp/a.c.| +CHECK-NEXT: ) + +CHECK: Index: 3 +CHECK-NEXT: ID: 0x4 +CHECK-NEXT: Name: FUNC +CHECK-NEXT: Type: regular +CHECK-NEXT: Permissions: --- +CHECK-NEXT: Thread specific: no +CHECK-NEXT: VM address: 0 +CHECK-NEXT: VM size: 0 +CHECK-NEXT: File size: 66 +CHECK-NEXT: Data: ( +CHECK-NEXT: 0000: 46554E43 20313031 30203130 2030205F 73746172 740A3130 31302034 20342030 |FUNC 1010 10 0 _start.1010 4 4 0| +CHECK-NEXT: 0020: 0A313031 34203520 3520300A 31303139 20352036 20300A31 30316520 32203720 |.1014 5 5 0.1019 5 6 0.101e 2 7 | +CHECK-NEXT: 0040: 300A |0.| +CHECK-NEXT: ) + +CHECK: Index: 4 +CHECK-NEXT: ID: 0x5 +CHECK-NEXT: Name: PUBLIC +CHECK-NEXT: Type: regular +CHECK-NEXT: Permissions: --- +CHECK-NEXT: Thread specific: no +CHECK-NEXT: VM address: 0 +CHECK-NEXT: VM size: 0 +CHECK-NEXT: File size: 21 +CHECK-NEXT: Data: ( +CHECK-NEXT: 0000: 5055424C 49432031 30313020 30205F73 74617274 0A |PUBLIC 1010 0 _start.| +CHECK-NEXT: ) + +CHECK: Index: 5 +CHECK-NEXT: ID: 0x6 +CHECK-NEXT: Name: STACK CFI +CHECK-NEXT: Type: regular +CHECK-NEXT: Permissions: --- +CHECK-NEXT: Thread specific: no +CHECK-NEXT: VM address: 0 +CHECK-NEXT: VM size: 0 +CHECK-NEXT: File size: 136 +CHECK-NEXT: Data: ( +CHECK-NEXT: 0000: 53544143 4B204346 4920494E 49542031 30313020 3130202E 6366613A 20247273 |STACK CFI INIT 1010 10 .cfa: $rs| +CHECK-NEXT: 0020: 70203820 2B202E72 613A202E 63666120 2D38202B 205E0A53 5441434B 20434649 |p 8 + .ra: .cfa -8 + ^.STACK CFI| +CHECK-NEXT: 0040: 20313031 31202472 62703A20 2E636661 202D3136 202B205E 202E6366 613A2024 | 1011 $rbp: .cfa -16 + ^ .cfa: $| +CHECK-NEXT: 0060: 72737020 3136202B 0A535441 434B2043 46492031 30313420 2E636661 3A202472 |rsp 16 +.STACK CFI 1014 .cfa: $r| +CHECK-NEXT: 0080: 62702031 36202B0A |bp 16 +.| +CHECK-NEXT: ) diff --git a/lldb/lit/ObjectFile/Breakpad/uuid-matching-mac.test b/lldb/lit/ObjectFile/Breakpad/uuid-matching-mac.test new file mode 100644 index 00000000000..f2dd2e56312 --- /dev/null +++ b/lldb/lit/ObjectFile/Breakpad/uuid-matching-mac.test @@ -0,0 +1,13 @@ +# RUN: yaml2obj %S/Inputs/uuid-matching-mac.yaml -o %T/uuid-matching-mac.out +# RUN: cd %S +# RUN: %lldb %T/uuid-matching-mac.out -s %s -o exit | FileCheck %s + +target symbols add Inputs/uuid-matching-mac.syms +# CHECK-LABEL: target symbols add +# CHECK: symbol file '{{.*}}uuid-matching-mac.syms' has been added to '{{.*}}uuid-matching-mac.out' + +image lookup -n main +# CHECK-LABEL: image lookup +# CHECK: Address: uuid-matching-mac.out[0x0000000100000f90] + + diff --git a/lldb/lit/ObjectFile/ELF/Inputs/PT_LOAD-overlap-section.elf b/lldb/lit/ObjectFile/ELF/Inputs/PT_LOAD-overlap-section.elf Binary files differnew file mode 100644 index 00000000000..d5fd2d1fa91 --- /dev/null +++ b/lldb/lit/ObjectFile/ELF/Inputs/PT_LOAD-overlap-section.elf diff --git a/lldb/lit/ObjectFile/ELF/Inputs/minidebuginfo-main.c b/lldb/lit/ObjectFile/ELF/Inputs/minidebuginfo-main.c new file mode 100644 index 00000000000..8f11dafece6 --- /dev/null +++ b/lldb/lit/ObjectFile/ELF/Inputs/minidebuginfo-main.c @@ -0,0 +1,12 @@ +// This function will be embedded within the .symtab section of the +// .gnu_debugdata section. +int multiplyByFour(int num) { return num * 4; } + +// This function will be embedded within the .dynsym section of the main binary. +int multiplyByThree(int num) { return num * 3; } + +int main(int argc, char *argv[]) { + int x = multiplyByThree(argc); + int y = multiplyByFour(x); + return y; +} diff --git a/lldb/lit/ObjectFile/ELF/Inputs/netbsd-amd64.core b/lldb/lit/ObjectFile/ELF/Inputs/netbsd-amd64.core Binary files differnew file mode 100644 index 00000000000..bf647fdd792 --- /dev/null +++ b/lldb/lit/ObjectFile/ELF/Inputs/netbsd-amd64.core diff --git a/lldb/lit/ObjectFile/ELF/PT_LOAD-empty.yaml b/lldb/lit/ObjectFile/ELF/PT_LOAD-empty.yaml new file mode 100644 index 00000000000..9f1cb074572 --- /dev/null +++ b/lldb/lit/ObjectFile/ELF/PT_LOAD-empty.yaml @@ -0,0 +1,26 @@ +# Test behavior on unusual (and probably corrupt) files. Test that we drop an +# empty PT_LOAD segment. + +# RUN: yaml2obj %s > %t +# RUN: lldb-test object-file %t | FileCheck %s +# +# CHECK-NOT: container + +!ELF +FileHeader: + Class: ELFCLASS32 + Data: ELFDATA2LSB + Type: ET_EXEC + Machine: EM_ARM +Sections: + - Name: .text + Type: SHT_PROGBITS + Flags: [ SHF_ALLOC, SHF_EXECINSTR ] + Address: 0x1000 + AddressAlign: 0x4 + Content: DEADBEEFBAADF00D +ProgramHeaders: + - Type: PT_LOAD + Flags: [ PF_X, PF_R ] + VAddr: 0x1000 + Align: 0x4 diff --git a/lldb/lit/ObjectFile/ELF/PT_LOAD-overlap-PT_INTERP.yaml b/lldb/lit/ObjectFile/ELF/PT_LOAD-overlap-PT_INTERP.yaml new file mode 100644 index 00000000000..e97afe9070c --- /dev/null +++ b/lldb/lit/ObjectFile/ELF/PT_LOAD-overlap-PT_INTERP.yaml @@ -0,0 +1,50 @@ +# Test that an overlapping PT_INTERP segment does not cause us to drop the +# subsequent PT_LOAD segment. + +# RUN: yaml2obj %s > %t +# RUN: lldb-test object-file %t | FileCheck %s + +# CHECK: Index: 0 +# CHECK-NEXT: ID: 0xfffffffffffffffe +# CHECK-NEXT: Name: PT_LOAD[0] +# CHECK-NEXT: Type: container +# CHECK-NEXT: Permissions: rwx +# CHECK-NEXT: Thread specific: no +# CHECK-NEXT: VM address: 0x1000 +# CHECK-NEXT: VM size: 12 +# CHECK-NEXT: File size: 12 +# CHECK-NEXT: Showing 2 subsections + +!ELF +FileHeader: + Class: ELFCLASS32 + Data: ELFDATA2LSB + Type: ET_EXEC + Machine: EM_ARM +Sections: + - Name: .interp + Type: SHT_PROGBITS + Flags: [ SHF_ALLOC ] + Address: 0x1000 + AddressAlign: 0x4 + Content: 3232 + - Name: .text + Type: SHT_PROGBITS + Flags: [ SHF_ALLOC, SHF_EXECINSTR ] + Address: 0x1004 + AddressAlign: 0x4 + Content: DEADBEEFBAADF00D +ProgramHeaders: + - Type: PT_INTERP + Flags: [ PF_R ] + VAddr: 0x1000 + Align: 0x4 + Sections: + - Section: .interp + - Type: PT_LOAD + Flags: [ PF_X, PF_W, PF_R ] + VAddr: 0x1000 + Align: 0x4 + Sections: + - Section: .interp + - Section: .text diff --git a/lldb/lit/ObjectFile/ELF/PT_LOAD-overlap-PT_TLS.yaml b/lldb/lit/ObjectFile/ELF/PT_LOAD-overlap-PT_TLS.yaml new file mode 100644 index 00000000000..d6844666804 --- /dev/null +++ b/lldb/lit/ObjectFile/ELF/PT_LOAD-overlap-PT_TLS.yaml @@ -0,0 +1,63 @@ +# Overlapping PT_LOAD and PT_TLS segments should be able to exist side by side. + +# RUN: yaml2obj %s > %t +# RUN: lldb-test object-file %t | FileCheck %s +# RUN: lldb %t -o "image lookup -a 0x1000" -b | FileCheck --check-prefix=LOOKUP %s + +# CHECK: Index: 0 +# CHECK-NEXT: ID: 0xffffffffffffffff +# CHECK-NEXT: Name: PT_TLS[0] +# CHECK-NEXT: Type: container +# CHECK-NEXT: Permissions: rw- +# CHECK-NEXT: Thread specific: yes +# CHECK-NEXT: VM address: 0x1000 +# CHECK-NEXT: VM size: 16 +# CHECK-NEXT: File size: 0 +# CHECK-NEXT: Showing 1 subsections + +# CHECK: Index: 1 +# CHECK-NEXT: ID: 0xfffffffffffffffe +# CHECK-NEXT: Name: PT_LOAD[0] +# CHECK-NEXT: Type: container +# CHECK-NEXT: Permissions: rw- +# CHECK-NEXT: Thread specific: no +# CHECK-NEXT: VM address: 0x1000 +# CHECK-NEXT: VM size: 16 +# CHECK-NEXT: File size: 16 +# CHECK-NEXT: Showing 1 subsections + +# LOOKUP-LABEL: image lookup -a 0x1000 +# LOOKUP: Address: {{.*}}.PT_LOAD[0]..data + 0) + +!ELF +FileHeader: + Class: ELFCLASS32 + Data: ELFDATA2LSB + Type: ET_EXEC + Machine: EM_ARM +Sections: + - Name: .tbss + Type: SHT_NOBITS + Flags: [ SHF_ALLOC, SHF_WRITE, SHF_TLS ] + Address: 0x1000 + AddressAlign: 0x4 + Size: 0x10 + - Name: .data + Type: SHT_PROGBITS + Flags: [ SHF_ALLOC, SHF_WRITE ] + Address: 0x1000 + AddressAlign: 0x4 + Size: 0x10 +ProgramHeaders: + - Type: PT_TLS + Flags: [ PF_R, PF_W ] + VAddr: 0x1000 + Align: 0x4 + Sections: + - Section: .tbss + - Type: PT_LOAD + Flags: [ PF_W, PF_R ] + VAddr: 0x1000 + Align: 0x4 + Sections: + - Section: .data diff --git a/lldb/lit/ObjectFile/ELF/PT_LOAD-overlap-section.yaml b/lldb/lit/ObjectFile/ELF/PT_LOAD-overlap-section.yaml new file mode 100644 index 00000000000..3b7bde802ce --- /dev/null +++ b/lldb/lit/ObjectFile/ELF/PT_LOAD-overlap-section.yaml @@ -0,0 +1,66 @@ +# Test behavior on strange (invalid?) elf files where the sections cross segment +# boundary. The test input was generated from this yaml file, but the program +# header was modified by hand, so this input is here for reference only. +# +# Right now lldb shortens sections to make sure every section is fully contained +# within a segment, but other behaviors are possible too (including outright +# rejecting such files). + +# RUN: lldb-test object-file %S/Inputs/PT_LOAD-overlap-section.elf | FileCheck %s + +# CHECK: Index: 0 +# CHECK-NEXT: ID: 0xffffffffffffffff +# CHECK-NEXT: Name: PT_LOAD[0] +# CHECK-NEXT: Type: container +# CHECK-NEXT: Permissions: rwx +# CHECK-NEXT: Thread specific: no +# CHECK-NEXT: VM address: 0x1006 +# CHECK-NEXT: VM size: 8 +# CHECK-NEXT: File size: 8 +# CHECK-NEXT: Showing 1 subsections +# CHECK-NEXT: Index: 0 +# CHECK-NEXT: ID: 0x2 +# CHECK-NEXT: Name: .text +# CHECK-NEXT: Type: code +# CHECK-NEXT: Permissions: r-x +# CHECK-NEXT: Thread specific: no +# CHECK-NEXT: VM address: 0x1008 +# CHECK-NEXT: VM size: 6 +# CHECK-NEXT: File size: 8 + +# CHECK: Index: 1 +# CHECK-NEXT: ID: 0x1 +# CHECK-NEXT: Name: .interp +# CHECK-NEXT: Type: regular +# CHECK-NEXT: Permissions: r-- +# CHECK-NEXT: Thread specific: no +# CHECK-NEXT: VM address: 0x1000 +# CHECK-NEXT: VM size: 6 +# CHECK-NEXT: File size: 8 + +!ELF +FileHeader: + Class: ELFCLASS32 + Data: ELFDATA2LSB + Type: ET_EXEC + Machine: EM_ARM +Sections: + - Name: .interp + Type: SHT_PROGBITS + Flags: [ SHF_ALLOC ] + Address: 0x1000 + AddressAlign: 0x4 + Content: DEADBEEFBAADF00D + - Name: .text + Type: SHT_PROGBITS + Flags: [ SHF_ALLOC, SHF_EXECINSTR ] + Address: 0x1008 + AddressAlign: 0x4 + Content: DEADBEEFBAADF00D +ProgramHeaders: + - Type: PT_LOAD + Flags: [ PF_X, PF_W, PF_R ] + VAddr: 0x1008 # Modified by hand to start at 0x1006 + Align: 0x4 + Sections: + - Section: .text diff --git a/lldb/lit/ObjectFile/ELF/PT_LOAD-overlap.yaml b/lldb/lit/ObjectFile/ELF/PT_LOAD-overlap.yaml new file mode 100644 index 00000000000..1315f54e6c0 --- /dev/null +++ b/lldb/lit/ObjectFile/ELF/PT_LOAD-overlap.yaml @@ -0,0 +1,42 @@ +# Test behavior on unusual (and probably corrupt) object files. Check that we +# drop the second PT_LOAD segment which overlaps with the first one. + +# RUN: yaml2obj %s > %t +# RUN: lldb-test object-file %t | FileCheck %s + +# CHECK: Type: container +# CHECK-NOT: Type: container + +!ELF +FileHeader: + Class: ELFCLASS32 + Data: ELFDATA2LSB + Type: ET_EXEC + Machine: EM_ARM +Sections: + - Name: .text + Type: SHT_PROGBITS + Flags: [ SHF_ALLOC, SHF_EXECINSTR ] + Address: 0x1000 + AddressAlign: 0x4 + Content: DEADBEEFBAADF00D + - Name: .data + Type: SHT_PROGBITS + Flags: [ SHF_ALLOC ] + Address: 0x1008 + AddressAlign: 0x4 + Content: 3232 +ProgramHeaders: + - Type: PT_LOAD + Flags: [ PF_X, PF_W, PF_R ] + VAddr: 0x1000 + Align: 0x4 + Sections: + - Section: .text + - Section: .data + - Type: PT_LOAD + Flags: [ PF_R, PF_W ] + VAddr: 0x1008 + Align: 0x4 + Sections: + - Section: .data diff --git a/lldb/lit/ObjectFile/ELF/PT_LOAD.yaml b/lldb/lit/ObjectFile/ELF/PT_LOAD.yaml new file mode 100644 index 00000000000..d673a69c8cd --- /dev/null +++ b/lldb/lit/ObjectFile/ELF/PT_LOAD.yaml @@ -0,0 +1,79 @@ +# Test that sections are made child-sections of the PT_LOAD segments/sections. + +# RUN: yaml2obj %s > %t +# RUN: lldb-test object-file %t | FileCheck %s + +# CHECK: Index: 0 +# CHECK-NEXT: ID: 0xffffffffffffffff +# CHECK-NEXT: Name: PT_LOAD[0] +# CHECK-NEXT: Type: container +# CHECK-NEXT: Permissions: rwx +# CHECK-NEXT: Thread specific: no +# CHECK-NEXT: VM address: 0x1000 +# CHECK-NEXT: VM size: 10 +# CHECK-NEXT: File size: 10 +# CHECK-NEXT: Showing 2 subsections +# CHECK-NEXT: Index: 0 +# CHECK-NEXT: ID: 0x1 +# CHECK-NEXT: Name: .text +# CHECK-NEXT: Type: code +# CHECK-NEXT: Permissions: r-x +# CHECK-NEXT: Thread specific: no +# CHECK-NEXT: VM address: 0x1000 +# CHECK-NEXT: VM size: 8 +# CHECK-NEXT: File size: 8 +# CHECK-EMPTY: +# CHECK-NEXT: Index: 1 +# CHECK-NEXT: ID: 0x2 +# CHECK-NEXT: Name: .data +# CHECK-NEXT: Type: data +# CHECK-NEXT: Permissions: r-- +# CHECK-NEXT: Thread specific: no +# CHECK-NEXT: VM address: 0x1008 +# CHECK-NEXT: VM size: 2 +# CHECK-NEXT: File size: 2 +# CHECK-EMPTY: +# CHECK-EMPTY: +# CHECK-NEXT: Index: 1 +# CHECK-NEXT: ID: 0x3 +# CHECK-NEXT: Name: .data_outside +# CHECK-NEXT: Type: regular +# CHECK-NEXT: Permissions: r-- +# CHECK-NEXT: Thread specific: no +# CHECK-NEXT: VM address: 0x2000 +# CHECK-NEXT: VM size: 2 +# CHECK-NEXT: File size: 2 + +!ELF +FileHeader: + Class: ELFCLASS32 + Data: ELFDATA2LSB + Type: ET_EXEC + Machine: EM_ARM +Sections: + - Name: .text + Type: SHT_PROGBITS + Flags: [ SHF_ALLOC, SHF_EXECINSTR ] + Address: 0x1000 + AddressAlign: 0x4 + Content: DEADBEEFBAADF00D + - Name: .data + Type: SHT_PROGBITS + Flags: [ SHF_ALLOC ] + Address: 0x1008 + AddressAlign: 0x4 + Content: 3232 + - Name: .data_outside + Type: SHT_PROGBITS + Flags: [ SHF_ALLOC ] + Address: 0x2000 + AddressAlign: 0x4 + Content: 3232 +ProgramHeaders: + - Type: PT_LOAD + Flags: [ PF_X, PF_W, PF_R ] + VAddr: 0x1000 + Align: 0x4 + Sections: + - Section: .text + - Section: .data diff --git a/lldb/lit/ObjectFile/ELF/PT_TLS-overlap-PT_LOAD.yaml b/lldb/lit/ObjectFile/ELF/PT_TLS-overlap-PT_LOAD.yaml new file mode 100644 index 00000000000..cd3939e0541 --- /dev/null +++ b/lldb/lit/ObjectFile/ELF/PT_TLS-overlap-PT_LOAD.yaml @@ -0,0 +1,63 @@ +# Overlapping PT_LOAD and PT_TLS segments should be able to exist side by side. + +# RUN: yaml2obj %s > %t +# RUN: lldb-test object-file %t | FileCheck %s +# RUN: lldb %t -o "image lookup -a 0x1000" -b | FileCheck --check-prefix=LOOKUP %s + +# CHECK: Index: 0 +# CHECK-NEXT: ID: 0xffffffffffffffff +# CHECK-NEXT: Name: PT_LOAD[0] +# CHECK-NEXT: Type: container +# CHECK-NEXT: Permissions: rw- +# CHECK-NEXT: Thread specific: no +# CHECK-NEXT: VM address: 0x1000 +# CHECK-NEXT: VM size: 16 +# CHECK-NEXT: File size: 16 +# CHECK-NEXT: Showing 1 subsections + +# CHECK: Index: 1 +# CHECK-NEXT: ID: 0xfffffffffffffffe +# CHECK-NEXT: Name: PT_TLS[0] +# CHECK-NEXT: Type: container +# CHECK-NEXT: Permissions: rw- +# CHECK-NEXT: Thread specific: yes +# CHECK-NEXT: VM address: 0x1000 +# CHECK-NEXT: VM size: 16 +# CHECK-NEXT: File size: 0 +# CHECK-NEXT: Showing 1 subsections + +# LOOKUP-LABEL: image lookup -a 0x1000 +# LOOKUP: Address: {{.*}}.PT_LOAD[0]..data + 0) + +!ELF +FileHeader: + Class: ELFCLASS32 + Data: ELFDATA2LSB + Type: ET_EXEC + Machine: EM_ARM +Sections: + - Name: .data + Type: SHT_PROGBITS + Flags: [ SHF_ALLOC, SHF_WRITE ] + Address: 0x1000 + AddressAlign: 0x4 + Size: 0x10 + - Name: .tbss + Type: SHT_NOBITS + Flags: [ SHF_ALLOC, SHF_WRITE, SHF_TLS ] + Address: 0x1000 + AddressAlign: 0x4 + Size: 0x10 +ProgramHeaders: + - Type: PT_LOAD + Flags: [ PF_W, PF_R ] + VAddr: 0x1000 + Align: 0x4 + Sections: + - Section: .data + - Type: PT_TLS + Flags: [ PF_R, PF_W ] + VAddr: 0x1000 + Align: 0x4 + Sections: + - Section: .tbss diff --git a/lldb/lit/ObjectFile/ELF/aarch64-relocations.yaml b/lldb/lit/ObjectFile/ELF/aarch64-relocations.yaml new file mode 100644 index 00000000000..b9433a0ef5a --- /dev/null +++ b/lldb/lit/ObjectFile/ELF/aarch64-relocations.yaml @@ -0,0 +1,93 @@ +# RUN: yaml2obj %s > %t +# RUN: lldb-test object-file -contents %t | FileCheck %s + +# CHECK: Name: .debug_info +# CHECK: Data: ( +# CHECK-NEXT: 0000: 47000000 04000000 00000801 00000000 0C002D00 00000000 00003700 00000000 +# CHECK-NEXT: 0020: 00000000 00000800 00000200 00000000 00000008 00000001 6F490000 00010243 +# CHECK-NEXT: 0040: 00000003 4B000000 050400 +# CHECK-NEXT: ) + +--- !ELF +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + Type: ET_REL + Machine: EM_AARCH64 +Sections: + - Name: .text + Type: SHT_PROGBITS + Flags: [ SHF_ALLOC, SHF_EXECINSTR ] + AddressAlign: 0x0000000000000004 + Content: E0031B32C0035FD6 + - Name: .debug_str + Type: SHT_PROGBITS + Flags: [ SHF_MERGE, SHF_STRINGS ] + AddressAlign: 0x0000000000000001 + Size: 0x50 + - Name: .debug_abbrev + Type: SHT_PROGBITS + AddressAlign: 0x0000000000000001 + Size: 0x10 + - Name: .debug_info + Type: SHT_PROGBITS + AddressAlign: 0x0000000000000001 + Content: 470000000400000000000801000000000C0000000000000000000000000000000000000000000800000002000000000000000008000000016F000000000102430000000300000000050400 + - Name: .rela.debug_info + Type: SHT_RELA + Link: .symtab + AddressAlign: 0x0000000000000008 + Info: .debug_info + Relocations: + - Offset: 0x0000000000000006 + Symbol: .debug_abbrev + Type: R_AARCH64_ABS32 + - Offset: 0x000000000000000C + Symbol: .debug_str + Type: R_AARCH64_ABS32 + - Offset: 0x0000000000000012 + Symbol: .debug_str + Type: R_AARCH64_ABS32 + Addend: 45 + - Offset: 0x0000000000000016 + Symbol: .debug_line + Type: R_AARCH64_ABS32 + - Offset: 0x000000000000001A + Symbol: .debug_str + Type: R_AARCH64_ABS32 + Addend: 55 + - Offset: 0x000000000000001E + Symbol: .text + Type: R_AARCH64_ABS64 + - Offset: 0x000000000000002B + Symbol: .text + Type: R_AARCH64_ABS64 + - Offset: 0x0000000000000039 + Symbol: .debug_str + Type: R_AARCH64_ABS32 + Addend: 73 + - Offset: 0x0000000000000044 + Symbol: .debug_str + Type: R_AARCH64_ABS32 + Addend: 75 + - Name: .debug_line + Type: SHT_PROGBITS + AddressAlign: 0x0000000000000001 + Size: 0x20 +Symbols: + - Name: .text + Type: STT_SECTION + Section: .text + - Name: .debug_str + Type: STT_SECTION + Section: .debug_str + - Name: .debug_abbrev + Type: STT_SECTION + Section: .debug_abbrev + - Name: .debug_info + Type: STT_SECTION + Section: .debug_info + - Name: .debug_line + Type: STT_SECTION + Section: .debug_line +... diff --git a/lldb/lit/ObjectFile/ELF/base-address.yaml b/lldb/lit/ObjectFile/ELF/base-address.yaml new file mode 100644 index 00000000000..68f11770835 --- /dev/null +++ b/lldb/lit/ObjectFile/ELF/base-address.yaml @@ -0,0 +1,34 @@ +# RUN: yaml2obj %s > %t +# RUN: lldb-test object-file %t | FileCheck %s + +# CHECK: Base VM address: 0x400000 + +--- !ELF +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + Type: ET_EXEC + Machine: EM_X86_64 + Entry: 0x0000000000400078 +Sections: + - Name: .pad + Type: SHT_PROGBITS + Flags: [ SHF_ALLOC ] + Address: 0x0000000000400000 + AddressAlign: 0x0000000000001000 + Size: 0x78 + - Name: .text + Type: SHT_PROGBITS + Flags: [ SHF_ALLOC, SHF_EXECINSTR ] + Address: 0x0000000000400078 + AddressAlign: 0x0000000000000001 + Content: 48C7C0E700000048C7C72F0000000F05CC +ProgramHeaders: + - Type: PT_LOAD + Flags: [ PF_X, PF_R ] + VAddr: 0x400000 + Align: 0x200000 + Sections: + - Section: .pad + - Section: .text +... diff --git a/lldb/lit/ObjectFile/ELF/basic-info.yaml b/lldb/lit/ObjectFile/ELF/basic-info.yaml new file mode 100644 index 00000000000..0e1db67e9d5 --- /dev/null +++ b/lldb/lit/ObjectFile/ELF/basic-info.yaml @@ -0,0 +1,27 @@ +# REQUIRES: lld + +# RUN: yaml2obj %s > %t.o +# RUN: ld.lld %t.o -o %t -image-base 0x47000 +# RUN: lldb-test object-file %t | FileCheck %s + +# CHECK: Plugin name: elf +# CHECK: Architecture: x86_64-- +# CHECK: Executable: true +# CHECK: Stripped: false +# CHECK: Type: executable +# CHECK: Strata: user +# CHECK: Base VM address: 0x47000 + +--- !ELF +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + Type: ET_REL + Machine: EM_X86_64 +Sections: + - Name: .text + Type: SHT_PROGBITS + Flags: [ SHF_ALLOC, SHF_EXECINSTR ] + AddressAlign: 0x0000000000000010 + Content: 554889E55DC3 +... diff --git a/lldb/lit/ObjectFile/ELF/build-id-case.yaml b/lldb/lit/ObjectFile/ELF/build-id-case.yaml new file mode 100644 index 00000000000..f9786b3754f --- /dev/null +++ b/lldb/lit/ObjectFile/ELF/build-id-case.yaml @@ -0,0 +1,40 @@ +# RUN: mkdir -p %t/.build-id/1b +# RUN: yaml2obj %s > %t/.build-id/1b/8a73ac238390e32a7ff4ac8ebe4d6a41ecf5c9.debug +# RUN: cd %t +# RUN: llvm-objcopy --strip-all %t/.build-id/1b/8a73ac238390e32a7ff4ac8ebe4d6a41ecf5c9.debug %t/stripped.out +# RUN: lldb-test object-file %t/stripped.out | FileCheck %s + +# CHECK: Name: .debug_frame +# CHECK-NEXT: Type: dwarf-frame + +--- !ELF +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + Type: ET_EXEC + Machine: EM_X86_64 + Entry: 0x00000000004003D0 +Sections: + - Name: .note.gnu.build-id + Type: SHT_NOTE + Flags: [ SHF_ALLOC ] + Address: 0x0000000000400274 + AddressAlign: 0x0000000000000004 + Content: 040000001400000003000000474E55001B8A73AC238390E32A7FF4AC8EBE4D6A41ECF5C9 + - Name: .text + Type: SHT_PROGBITS + Flags: [ SHF_ALLOC, SHF_EXECINSTR ] + Address: 0x00000000004003D0 + AddressAlign: 0x0000000000000010 + Content: DEADBEEFBAADF00D + - Name: .debug_frame + Type: SHT_PROGBITS + AddressAlign: 0x0000000000000008 + Content: DEADBEEFBAADF00D +Symbols: + - Name: main + Type: STT_FUNC + Section: .text + Value: 0x00000000004003D0 + Size: 0x0000000000000008 +... diff --git a/lldb/lit/ObjectFile/ELF/compressed-sections.yaml b/lldb/lit/ObjectFile/ELF/compressed-sections.yaml new file mode 100644 index 00000000000..f8c31d52bb8 --- /dev/null +++ b/lldb/lit/ObjectFile/ELF/compressed-sections.yaml @@ -0,0 +1,44 @@ +# REQUIRES: zlib +# RUN: yaml2obj %s > %t +# RUN: lldb-test object-file --contents %t | FileCheck %s +--- !ELF +FileHeader: + Class: ELFCLASS32 + Data: ELFDATA2LSB + Type: ET_REL + Machine: EM_386 +Sections: + - Name: .hello_elf + Type: SHT_PROGBITS + Flags: [ SHF_COMPRESSED ] + Content: 010000000800000001000000789c5330700848286898000009c802c1 + - Name: .bogus + Type: SHT_PROGBITS + Flags: [ SHF_COMPRESSED ] + Content: deadbeefbaadf00d + - Name: .zdebug_info + Type: SHT_PROGBITS + Content: 5A4C49420000000000000008789c5330700848286898000009c802c1 + +# CHECK: Name: .hello_elf +# CHECK-NEXT: Type: regular +# CHECK: VM address: 0 +# CHECK-NEXT: VM size: 0 +# CHECK-NEXT: File size: 28 +# CHECK-NEXT: Data: ( +# CHECK-NEXT: 20304050 60708090 +# CHECK-NEXT: ) + +# CHECK: Name: .bogus +# CHECK-NEXT: Type: regular +# CHECK: VM address: 0 +# CHECK-NEXT: VM size: 0 +# CHECK-NEXT: File size: 8 +# CHECK-NEXT: Data: () + +# CHECK: Name: .zdebug_info +# CHECK: dwarf-info +# CHECK: File size: 28 +# CHECK: Data: ( +# CHECK-NEXT: 20304050 60708090 +# CHECK-NEXT: ) diff --git a/lldb/lit/ObjectFile/ELF/duplicate-section.yaml b/lldb/lit/ObjectFile/ELF/duplicate-section.yaml new file mode 100644 index 00000000000..8b280d2449b --- /dev/null +++ b/lldb/lit/ObjectFile/ELF/duplicate-section.yaml @@ -0,0 +1,41 @@ +# RUN: mkdir -p %t/.build-id/1b +# RUN: yaml2obj %s > %t/.build-id/1b/8a73ac238390e32a7ff4ac8ebe4d6a41ecf5c9.debug +# RUN: cd %t +# RUN: llvm-objcopy --strip-all --add-gnu-debuglink=.build-id/1b/8a73ac238390e32a7ff4ac8ebe4d6a41ecf5c9.debug %t/.build-id/1b/8a73ac238390e32a7ff4ac8ebe4d6a41ecf5c9.debug %t/stripped.out +# RUN: lldb-test object-file %t/stripped.out | FileCheck %s + +# Make sure that the debug_frame section is present only once. +# CHECK: Name: .debug_frame +# CHECK-NOT: .debug_frame + +--- !ELF +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + Type: ET_EXEC + Machine: EM_X86_64 + Entry: 0x00000000004003D0 +Sections: + - Name: .note.gnu.build-id + Type: SHT_NOTE + Flags: [ SHF_ALLOC ] + Address: 0x0000000000400274 + AddressAlign: 0x0000000000000004 + Content: 040000001400000003000000474E55001B8A73AC238390E32A7FF4AC8EBE4D6A41ECF5C9 + - Name: .text + Type: SHT_PROGBITS + Flags: [ SHF_ALLOC, SHF_EXECINSTR ] + Address: 0x00000000004003D0 + AddressAlign: 0x0000000000000010 + Content: DEADBEEFBAADF00D + - Name: .debug_frame + Type: SHT_PROGBITS + AddressAlign: 0x0000000000000008 + Content: DEADBEEFBAADF00D +Symbols: + - Name: main + Type: STT_FUNC + Section: .text + Value: 0x00000000004003D0 + Size: 0x0000000000000008 +... diff --git a/lldb/lit/ObjectFile/ELF/gnu-debuglink.yaml b/lldb/lit/ObjectFile/ELF/gnu-debuglink.yaml new file mode 100644 index 00000000000..b39b3187ae9 --- /dev/null +++ b/lldb/lit/ObjectFile/ELF/gnu-debuglink.yaml @@ -0,0 +1,32 @@ +# RUN: yaml2obj %s > %t +# RUN: llvm-objcopy --strip-all --add-gnu-debuglink=%t %t %t.stripped +# RUN: lldb-test object-file %t.stripped | FileCheck %s + +# CHECK: Name: .debug_frame +# CHECK-NEXT: Type: dwarf-frame + +--- !ELF +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + Type: ET_EXEC + Machine: EM_X86_64 + Entry: 0x00000000004003D0 +Sections: + - Name: .text + Type: SHT_PROGBITS + Flags: [ SHF_ALLOC, SHF_EXECINSTR ] + Address: 0x00000000004003D0 + AddressAlign: 0x0000000000000010 + Content: DEADBEEFBAADF00D + - Name: .debug_frame + Type: SHT_PROGBITS + AddressAlign: 0x0000000000000008 + Content: DEADBEEFBAADF00D +Symbols: + - Name: main + Type: STT_FUNC + Section: .text + Value: 0x00000000004003D0 + Size: 0x0000000000000008 +... diff --git a/lldb/lit/ObjectFile/ELF/many-sections.s b/lldb/lit/ObjectFile/ELF/many-sections.s new file mode 100644 index 00000000000..15d7e8fc158 --- /dev/null +++ b/lldb/lit/ObjectFile/ELF/many-sections.s @@ -0,0 +1,72 @@ +# REQUIRES: x86 +# RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux %s -o %t +# RUN: lldb-test object-file %t | FileCheck %s + +## Check that we are able to parse ELF files with more than SHN_LORESERVE +## sections. This generates a file that contains 64k sections from +## aaaaaaaa..dddddddd, plus a couple of standard ones (.strtab, etc.) +## Check the number is correct plus the names of a couple of chosen sections. + +# CHECK: Showing 65540 sections +# CHECK: Name: aaaaaaaa +# CHECK: Name: bbbbbbbb +# CHECK: Name: cccccccc +# CHECK: Name: abcdabcd +# CHECK: Name: dddddddd + +.macro gen_sections4 x + .section a\x + .section b\x + .section c\x + .section d\x +.endm + +.macro gen_sections16 x + gen_sections4 a\x + gen_sections4 b\x + gen_sections4 c\x + gen_sections4 d\x +.endm + +.macro gen_sections64 x + gen_sections16 a\x + gen_sections16 b\x + gen_sections16 c\x + gen_sections16 d\x +.endm + +.macro gen_sections256 x + gen_sections64 a\x + gen_sections64 b\x + gen_sections64 c\x + gen_sections64 d\x +.endm + +.macro gen_sections1024 x + gen_sections256 a\x + gen_sections256 b\x + gen_sections256 c\x + gen_sections256 d\x +.endm + +.macro gen_sections4096 x + gen_sections1024 a\x + gen_sections1024 b\x + gen_sections1024 c\x + gen_sections1024 d\x +.endm + +.macro gen_sections16384 x + gen_sections4096 a\x + gen_sections4096 b\x + gen_sections4096 c\x + gen_sections4096 d\x +.endm + +gen_sections16384 a +gen_sections16384 b +gen_sections16384 c +gen_sections16384 d + +.global _start +_start: diff --git a/lldb/lit/ObjectFile/ELF/minidebuginfo-corrupt-xz.yaml b/lldb/lit/ObjectFile/ELF/minidebuginfo-corrupt-xz.yaml new file mode 100644 index 00000000000..cec34b9c623 --- /dev/null +++ b/lldb/lit/ObjectFile/ELF/minidebuginfo-corrupt-xz.yaml @@ -0,0 +1,29 @@ +# REQUIRES: lzma + +# This test checks that an error occurs when a corrupted +# .gnu_debugdata section is trying to be xz uncompressed. + +# RUN: yaml2obj %s > %t.obj + +# TODO(kwk): once yaml2obj doesn't auto-generate a .symtab section +# when there's none in YAML, remove the following line: + +# RUN: llvm-objcopy --remove-section=.symtab %t.obj + +# RUN: %lldb -b -o 'image dump symtab' %t.obj 2>&1 | FileCheck %s + +# CHECK: warning: (x86_64) {{.*}}.obj An error occurred while decompression the section .gnu_debugdata: lzma_stream_buffer_decode()=lzma error: LZMA_DATA_ERROR + +--- !ELF +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + Type: ET_EXEC + Machine: EM_X86_64 + Entry: 0x00000000004004C0 +Sections: + - Name: .gnu_debugdata + Type: SHT_PROGBITS + AddressAlign: 0x0000000000000001 + Content: FD377A585A000004E6D6B4460200210116000000742FE5A3E0180F05BA5D003F914584683D89A6DA8ACC93E24ED90802EC1FE2A7102958F4A42B6A7134F23922F6F35F529E133A8B5588025CFAC876C68510A157DBBCF8CA75E9854DED10FDD5CE0CDC136F6459B13B9847AEF79E9B1C7CD70EF4F3AF709F5DA0C1F40780154D72120A6A62A3F1A216E20DC597CE55BB23B48785957321A15FEE48808C1428B925DBC8022541CC594BD0AF2B51C6BE2854C81611017704DF6E509D21013B80BEC27D8919ACD3157E89353A08F4C86781ED708E89AB322D010F0F1605DAD9B9CE2B13C387769C83F5F85C647FD9C551E0E9C7D4A5CBE297970E486CB94AC283F98A7C6412A57F9C37952327549EEC4634D2CFA55B0F99923A14992D4293E0D87CEEF7FB6160C45928DE25074EEBF5329B5579AF01DB23DF22CBD48C8037B68FFFBE5CEA6CD26A936DD07D9B2E6006B7C6E5CC751072185EFE995D3F3C8DACF9039D4BEFB1F376B491568F6F00DB50FF477F36B90413E4FA30AE7C561A1249FD45FDFF884F70247FC21E57195A764151D8E341267E724D856C512BD243CDB33AB313758443877B2CB58F7F8F0461DE9766647F333A3531BDC4A26E9537EB314708D31212FCF4C21E9CB139F4DBFD21BB16A126C35E2BB3F7E30BF5A54961CECD4DD4D91A3757356F618754B21533C34F2BD97D70A02B1F338588BDBA9CDF5FC9FBE973E550194F07EC7A1E8E3C005FD60F8853223427628987E82E701CA7E2FDFA1B0ED564C37D115A72C3EC01E29C85C3630D8A385C4AE12F4F75F9F0BC12F2698345DD62A1F546A5953AF5CF3C0F22C7DA510F6739EB8CDB0E8A5A3BC13CFC31C1875C313908EFF23678869B76A6E1C10FE699E43BFFDE8F0752ED994A4A84BC0AD9D7381131D457C4917C4F6656F5C95D3221A79166C802D5F5A7C68554E54C42CA535465D224C7B641CF3417C3EAFD03CE5709BEA33DC7C9155CAC9D3C8033AF7CDA622020606A7C139D77FF85BC19323BF956C9C4662F60079BC7FE5F67B46211716A1A6CE4AB8AAB307D6444310CBC101071703EECC0B4622D91D705F5DA2932DA8BCEDA8E1CB0CDB20AAD652B8F86A521D3421287F1C175AE3BE6458AE6F8F3FB6FB7ED97B616B580D791E5FE0B74973F8604F419039B5B9D9A14397EE509F2B33AE404FF96DD0551472C5302E67910F0794B15CFE837351C6AF89B2FE88488B557BE8ACFFA331FB7AD553D35CAEB7D8BCEFB6CFF4A58E91355FE931408CF4CAFA9B97518B9E5C02078F64CE81279801B090348213DCAA7D12DC098BFF58C5A3202EFC38F64AD894379747B54AB5A9843F82E5FF1F394C8B78344A8F1655DDEF8D5FE09EBB3E703853ABD716743507000696FB6B35216B088E499F53880375521442ED45DCDD1B31AAEBDAD3C7DA958593425206C4B2A0BC6CADE3B0B1598499E08016E84F33E3EB9D7B03B9C9DFA91B8CE5C74DEF2BC97FEE9982B0AEC16C75EEB7AE9A858A9C37F6C12B040C68A49111DCF0F3A4780F3879E93D904676BE908FDC66373D34AA715A39EFBC2795C6C8F058CA24392FB2591AD06ACD6AED8746F926886180C2B007ED58C9884A8BEF6CCA1F549F5C4FB411A3FF78770D1147363AC80B98B5A8FDB3DEC4E61709F66A622BDA835B1FD67B7C7CB166ABB163FB7C5204AE200C71C6A18B532C407647323B8F2FAC7ECB68C250877FC8DD5FE05B2B39E66F687EBB6EEFB7D5209E22F451B76F57D90BB6641DFFDE1A1821C4D783E4756F3CEE7F63B9BA284F8E114B0D9A086D83233BED4A8F5B60933DC16AF4DDE19C9FC59BCC1646343ECE7007B1C4DC65C4A939CDD47F6ED8855913183149BECE66D8FE7793AE607EB8E28513749B9548252764110D3B58D1D8B348DB18F7F24F8CA0C7D9CB515D90F7F1848FF58472B2EF52EBAB123AFC7F87890CE9FC55B31160014294A9B7F81638A27335E29E15A10B1068D5E049B1C239814DBBCC1BB30E11EEBAD5ACF8FB1B986C4F48D73FEA6129D9708A0B5AC435402BEC8C79C71DB94394811B9A604141A125A4669F9A139A0264E93E822117BE8E0D93A1487C51214E9FBF5763A3FBE9DA700B9C9B435472AF9F0B4446B000000003239307DD8B645100001D60B90300000CA1EC9E9B1C467FB020000000004595A +... diff --git a/lldb/lit/ObjectFile/ELF/minidebuginfo-find-symbols.yaml b/lldb/lit/ObjectFile/ELF/minidebuginfo-find-symbols.yaml new file mode 100644 index 00000000000..230ce8bb1c3 --- /dev/null +++ b/lldb/lit/ObjectFile/ELF/minidebuginfo-find-symbols.yaml @@ -0,0 +1,26 @@ +# REQUIRES: lzma + +# RUN: yaml2obj %s > %t.obj + +# TODO(kwk): once yaml2obj doesn't auto-generate a .symtab section +# when there's none in YAML, remove the following line: + +# RUN: llvm-objcopy --remove-section=.symtab %t.obj + +# RUN: %lldb -b -o 'image dump symtab' %t.obj | FileCheck %s + +# CHECK: [ 0] 1 X Code 0x00000000004005b0 0x000000000000000f 0x00000012 multiplyByFour + +--- !ELF +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + Type: ET_EXEC + Machine: EM_X86_64 + Entry: 0x00000000004004C0 +Sections: + - Name: .gnu_debugdata + Type: SHT_PROGBITS + AddressAlign: 0x0000000000000001 + Content: FD377A585A000004E6D6B4460200210116000000742FE5A3E0180F05BA5D003F914584683D89A6DA8ACC93E24ED90802EC1FE2A7102958F4A42B6A7134F23922F6F35F529E133A8B5588025CFAC876C68510A157DBBCF8CA75E9854DED10FDD5CE0CDC136F6459B13B9847AEF79E9B1C7CD70EF4F3AF709F5DA0C1F40780154D72120A6A62A3F1A216E20DC597CE55BB23B48785957321A15FEE48808C1428B925DBC8022541CC594BD0AF2B51C6BE2854C81611017704DF6E509D21013B80BEC27D8919ACD3157E89353A08F4C86781ED708E89AB322D010F0F1605DAD9B9CE2B13C387769C83F5F85C647FD9C551E0E9C7D4A5CBE297970E486CB94AC283F98A7C6412A57F9C37952327549EEC4634D2CFA55B0F99923A14992D4293E0D87CEEF7FB6160C45928DE25074EEBF5329B5579AF01DB23DF22CBD48C8037B68FFFBE5CEA6CD26A936DD07D9B2E6006B7C6E5CC751072185EFE995D3F3C8DACF9039D4BEFB1F376B491568F6F00DB50FF477F36B90413E4FA30AE7C561A1249FD45FDFF884F70247FC21E57195A764151D8E341267E724D856C512BD243CDB33AB313758443877B2CB58F7F8F0461DE9766647F333A3531BDC4A26E9537EB314708D31212FCF4C21E9CB139F4DBFD21BB16A126C35E2BB3F7E30BF5A54961CECD4DD4D91A3757356F618754B21533C34F2BD97D70A02B1F338588BDBA9CDF5FC9FBE973E550194F07EC7A1E8E3C005FD60F8853223427628987E82E701CA7E2FDFA1B0ED564C37D115A72C3EC01E29C85C3630D8A385C4AE12F4F75F9F0BC12F2698345DD62A1F546A5953AF5CF3C0F22C7DA510F6739EB8CDB0E8A5A3BC13CFC31C1875C313908EFF23678869B76A6E1C10FE699E43BFFDE8F0752ED994A4A84BC0AD9D7381131D457C4917C4F6656F5C95D3221A79166C802D5F5A7C68554E54C42CA535465D224C7B641CF3417C3EAFD03CE5709BEA33DC7C9155CAC9D3C8033AF7CDA622020606A7C139D77FF85BC19323BF956C9C4662F60079BC7FE5F67B46211716A1A6CE4AB8AAB307D6444310CBC101071703EECC0B4622D91D705F5DA2932DA8BCEDA8E1CB0CDB20AAD652B8F86A521D3421287F1C175AE3BE6458AE6F8F3FB6FB7ED97B616B580D791E5FE0B74973F8604F419039B5B9D9A14397EE509F2B33AE404FF96DD0551472C5302E67910F0794B15CFE837351C6AF89B2FE88488B557BE8ACFFA331FB7AD553D35CAEB7D8BCEFB6CFF4A58E91355FE931408CF4CAFA9B97518B9E5C02078F64CE81279801B090348213DCAA7D12DC098BFF58C5A3202EFC38F64AD894379747B54AB5A9843F82E5FF1F394C8B783C3A8F1655DDEF8D5FE09EBB3E703853ABD716743507000696FB6B35216B088E499F53880375521442ED45DCDD1B31AAEBDAD3C7DA958593425206C4B2A0BC6CADE3B0B1598499E08016E84F33E3EB9D7B03B9C9DFA91B8CE5C74DEF2BC97FEE9982B0AEC16C75EEB7AE9A858A9C37F6C12B040C68A49111DCF0F3A4780F3879E93D904676BE908FDC66373D34AA715A39EFBC2795C6C8F058CA24392FB2591AD06ACD6AED8746F926886180C2B007ED58C9884A8BEF6CCA1F549F5C4FB411A3FF78770D1147363AC80B98B5A8FDB3DEC4E61709F66A622BDA835B1FD67B7C7CB166ABB163FB7C5204AE200C71C6A18B532C407647323B8F2FAC7ECB68C250877FC8DD5FE05B2B39E66F687EBB6EEFB7D5209E22F451B76F57D90BB6641DFFDE1A1821C4D783E4756F3CEE7F63B9BA284F8E114B0D9A086D83233BED4A8F5B60933DC16AF4DDE19C9FC59BCC1646343ECE7007B1C4DC65C4A939CDD47F6ED8855913183149BECE66D8FE7793AE607EB8E28513749B9548252764110D3B58D1D8B348DB18F7F24F8CA0C7D9CB515D90F7F1848FF58472B2EF52EBAB123AFC7F87890CE9FC55B31160014294A9B7F81638A27335E29E15A10B1068D5E049B1C239814DBBCC1BB30E11EEBAD5ACF8FB1B986C4F48D73FEA6129D9708A0B5AC435402BEC8C79C71DB94394811B9A604141A125A4669F9A139A0264E93E822117BE8E0D93A1487C51214E9FBF5763A3FBE9DA700B9C9B435472AF9F0B4446B000000003239307DD8B645100001D60B90300000CA1EC9E9B1C467FB020000000004595A +... diff --git a/lldb/lit/ObjectFile/ELF/minidebuginfo-no-lzma.yaml b/lldb/lit/ObjectFile/ELF/minidebuginfo-no-lzma.yaml new file mode 100644 index 00000000000..a127109e991 --- /dev/null +++ b/lldb/lit/ObjectFile/ELF/minidebuginfo-no-lzma.yaml @@ -0,0 +1,29 @@ +# REQUIRES: !lzma + +# This test checks that a warning is printed when we're trying +# to decompress a .gnu_debugdata section when no LZMA support was compiled in. + +# RUN: yaml2obj %s > %t.obj + +# TODO(kwk): once yaml2obj doesn't auto-generate a .symtab section +# when there's none in YAML, remove the following line: + +# RUN: llvm-objcopy --remove-section=.symtab %t.obj + +# RUN: %lldb -b -o 'image dump symtab' %t.obj 2>&1 | FileCheck %s + +# CHECK: warning: (x86_64) {{.*}}.obj No LZMA support found for reading .gnu_debugdata section + +--- !ELF +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + Type: ET_EXEC + Machine: EM_X86_64 + Entry: 0x00000000004004C0 +Sections: + - Name: .gnu_debugdata + Type: SHT_PROGBITS + AddressAlign: 0x0000000000000001 + Content: FD377A585A000004E6D6B4460200210116000000742FE5A3E0180F05BA5D003F914584683D89A6DA8ACC93E24ED90802EC1FE2A7102958F4A42B6A7134F23922F6F35F529E133A8B5588025CFAC876C68510A157DBBCF8CA75E9854DED10FDD5CE0CDC136F6459B13B9847AEF79E9B1C7CD70EF4F3AF709F5DA0C1F40780154D72120A6A62A3F1A216E20DC597CE55BB23B48785957321A15FEE48808C1428B925DBC8022541CC594BD0AF2B51C6BE2854C81611017704DF6E509D21013B80BEC27D8919ACD3157E89353A08F4C86781ED708E89AB322D010F0F1605DAD9B9CE2B13C387769C83F5F85C647FD9C551E0E9C7D4A5CBE297970E486CB94AC283F98A7C6412A57F9C37952327549EEC4634D2CFA55B0F99923A14992D4293E0D87CEEF7FB6160C45928DE25074EEBF5329B5579AF01DB23DF22CBD48C8037B68FFFBE5CEA6CD26A936DD07D9B2E6006B7C6E5CC751072185EFE995D3F3C8DACF9039D4BEFB1F376B491568F6F00DB50FF477F36B90413E4FA30AE7C561A1249FD45FDFF884F70247FC21E57195A764151D8E341267E724D856C512BD243CDB33AB313758443877B2CB58F7F8F0461DE9766647F333A3531BDC4A26E9537EB314708D31212FCF4C21E9CB139F4DBFD21BB16A126C35E2BB3F7E30BF5A54961CECD4DD4D91A3757356F618754B21533C34F2BD97D70A02B1F338588BDBA9CDF5FC9FBE973E550194F07EC7A1E8E3C005FD60F8853223427628987E82E701CA7E2FDFA1B0ED564C37D115A72C3EC01E29C85C3630D8A385C4AE12F4F75F9F0BC12F2698345DD62A1F546A5953AF5CF3C0F22C7DA510F6739EB8CDB0E8A5A3BC13CFC31C1875C313908EFF23678869B76A6E1C10FE699E43BFFDE8F0752ED994A4A84BC0AD9D7381131D457C4917C4F6656F5C95D3221A79166C802D5F5A7C68554E54C42CA535465D224C7B641CF3417C3EAFD03CE5709BEA33DC7C9155CAC9D3C8033AF7CDA622020606A7C139D77FF85BC19323BF956C9C4662F60079BC7FE5F67B46211716A1A6CE4AB8AAB307D6444310CBC101071703EECC0B4622D91D705F5DA2932DA8BCEDA8E1CB0CDB20AAD652B8F86A521D3421287F1C175AE3BE6458AE6F8F3FB6FB7ED97B616B580D791E5FE0B74973F8604F419039B5B9D9A14397EE509F2B33AE404FF96DD0551472C5302E67910F0794B15CFE837351C6AF89B2FE88488B557BE8ACFFA331FB7AD553D35CAEB7D8BCEFB6CFF4A58E91355FE931408CF4CAFA9B97518B9E5C02078F64CE81279801B090348213DCAA7D12DC098BFF58C5A3202EFC38F64AD894379747B54AB5A9843F82E5FF1F394C8B783C3A8F1655DDEF8D5FE09EBB3E703853ABD716743507000696FB6B35216B088E499F53880375521442ED45DCDD1B31AAEBDAD3C7DA958593425206C4B2A0BC6CADE3B0B1598499E08016E84F33E3EB9D7B03B9C9DFA91B8CE5C74DEF2BC97FEE9982B0AEC16C75EEB7AE9A858A9C37F6C12B040C68A49111DCF0F3A4780F3879E93D904676BE908FDC66373D34AA715A39EFBC2795C6C8F058CA24392FB2591AD06ACD6AED8746F926886180C2B007ED58C9884A8BEF6CCA1F549F5C4FB411A3FF78770D1147363AC80B98B5A8FDB3DEC4E61709F66A622BDA835B1FD67B7C7CB166ABB163FB7C5204AE200C71C6A18B532C407647323B8F2FAC7ECB68C250877FC8DD5FE05B2B39E66F687EBB6EEFB7D5209E22F451B76F57D90BB6641DFFDE1A1821C4D783E4756F3CEE7F63B9BA284F8E114B0D9A086D83233BED4A8F5B60933DC16AF4DDE19C9FC59BCC1646343ECE7007B1C4DC65C4A939CDD47F6ED8855913183149BECE66D8FE7793AE607EB8E28513749B9548252764110D3B58D1D8B348DB18F7F24F8CA0C7D9CB515D90F7F1848FF58472B2EF52EBAB123AFC7F87890CE9FC55B31160014294A9B7F81638A27335E29E15A10B1068D5E049B1C239814DBBCC1BB30E11EEBAD5ACF8FB1B986C4F48D73FEA6129D9708A0B5AC435402BEC8C79C71DB94394811B9A604141A125A4669F9A139A0264E93E822117BE8E0D93A1487C51214E9FBF5763A3FBE9DA700B9C9B435472AF9F0B4446B000000003239307DD8B645100001D60B90300000CA1EC9E9B1C467FB020000000004595A +... diff --git a/lldb/lit/ObjectFile/ELF/minidebuginfo-set-and-hit-breakpoint.test b/lldb/lit/ObjectFile/ELF/minidebuginfo-set-and-hit-breakpoint.test new file mode 100644 index 00000000000..33188d2b4b7 --- /dev/null +++ b/lldb/lit/ObjectFile/ELF/minidebuginfo-set-and-hit-breakpoint.test @@ -0,0 +1,86 @@ +# REQUIRES: system-linux, lzma, xz + +# We want to keep the symbol "multiplyByThree" in the .dynamic section and not +# have it put the default .symtab section. +# RUN: echo "{multiplyByThree;};" > %T/dynmic-symbols.txt +# RUN: %clang -Wl,--dynamic-list=%T/dynmic-symbols.txt -g -o %t.binary %p/Inputs/minidebuginfo-main.c + +# The following section is adapted from GDB's official documentation: +# http://sourceware.org/gdb/current/onlinedocs/gdb/MiniDebugInfo.html#MiniDebugInfo + +# Extract the dynamic symbols from the main binary, there is no need +# to also have these in the normal symbol table. + +# IGNORE: llvm-nm -D %t.binary --format=posix --defined-only | awk '{ print $1 }' | sort > %t.dynsyms + +# Extract all the text (i.e. function) symbols from the debuginfo. +# (Note that we actually also accept "D" symbols, for the benefit +# of platforms like PowerPC64 that use function descriptors.) + +# IGNORE: llvm-nm %t.binary --format=posix --defined-only | awk '{ if ($2 == "T" || $2 == "t" || $2 == "D") print $1 }' | sort > %t.funcsyms + +# Keep all the function symbols not already in the dynamic symbol +# table. + +# IGNORE: comm -13 %t.dynsyms %t.funcsyms > %t.keep_symbols +# The result of the preceeding command can be preprocessed in %p/Inputs/minidebuginfo.keep_symbols +# because we know what symbol to keep. +# RUN: echo "multiplyByFour" > %p/Inputs/minidebuginfo.keep_symbols + +# Separate full debug info into debug binary. + +# RUN: llvm-objcopy --only-keep-debug %t.binary %t.debug + +# Copy the full debuginfo, keeping only a minimal set of symbols and +# removing some unnecessary sections. + +# RUN: llvm-objcopy -S --remove-section .gdb_index --remove-section .comment --keep-symbols=%p/Inputs/minidebuginfo.keep_symbols %t.debug %t.mini_debuginfo + +# This command is not from the GDB manual but it slims down embedded minidebug +# info. On top if that, it ensures that we only have the multiplyByThree symbol +# in the .dynsym section of the main binary. +# RUN: llvm-objcopy --remove-section=.rela.dyn --remove-section=.gnu.version --remove-section=.gnu.hash --remove-section=.dynsym %t.mini_debuginfo + +# Drop the full debug info from the original binary. + +# RUN: llvm-strip --strip-all -R .comment %t.binary + +# Inject the compressed data into the .gnu_debugdata section of the +# original binary. + +# RUN: xz --force --keep %t.mini_debuginfo + +# RUN: llvm-objcopy --add-section .gnu_debugdata=%t.mini_debuginfo.xz %t.binary + +# Now run the binary and see that we can set and hit a breakpoint +# from within the .dynsym section (multiplyByThree) and one from +# the .symtab section embedded in the .gnu_debugdata section (multiplyByFour). + +# RUN: %lldb -b -o 'b multiplyByThree' -o 'b multiplyByFour' -o 'run' -o 'continue' -o 'breakpoint list -v' %t.binary | FileCheck %s + +# CHECK: (lldb) b multiplyByThree +# CHECK-NEXT: Breakpoint 1: where = minidebuginfo-set-and-hit-breakpoint.test.tmp.binary`multiplyByThree, address = 0x{{.*}} + +# CHECK: (lldb) b multiplyByFour +# CHECK-NEXT: Breakpoint 2: where = minidebuginfo-set-and-hit-breakpoint.test.tmp.binary`multiplyByFour, address = 0x{{.*}} + +# CHECK: * thread #1, name = 'minidebuginfo-s', stop reason = breakpoint 1.1 +# CHECK: * thread #1, name = 'minidebuginfo-s', stop reason = breakpoint 2.1 + +# CHECK: (lldb) breakpoint list -v +# CHECK-NEXT: Current breakpoints: +# CHECK-NEXT: 1: name = 'multiplyByThree' +# CHECK-NEXT: 1.1: +# CHECK-NEXT: module = {{.*}}/minidebuginfo-set-and-hit-breakpoint.test.tmp.binary +# CHECK-NEXT: symbol = multiplyByThree +# CHECK-NEXT: address = 0x{{.*}} +# CHECK-NEXT: resolved = true +# CHECK-NEXT: hit count = 1 + +# CHECK: 2: name = 'multiplyByFour' +# CHECK-NEXT: 2.1: +# CHECK-NEXT: module = {{.*}}/minidebuginfo-set-and-hit-breakpoint.test.tmp.binary +# CHECK-NEXT: symbol = multiplyByFour +# CHECK-NEXT: address = 0x{{.*}} +# CHECK-NEXT: resolved = true +# CHECK-NEXT: hit count = 1 diff --git a/lldb/lit/ObjectFile/ELF/netbsd-core-amd64.test b/lldb/lit/ObjectFile/ELF/netbsd-core-amd64.test new file mode 100644 index 00000000000..7140b4f8998 --- /dev/null +++ b/lldb/lit/ObjectFile/ELF/netbsd-core-amd64.test @@ -0,0 +1,12 @@ +# Test whether NetBSD core dumps are recognized correctly. + +# Core dump generated by the following program: +# int main() { +# void* v = 0; +# *v = 1; +# return 0; +# } + +# RUN: lldb-test object-file %S/Inputs/netbsd-amd64.core | FileCheck %s +# CHECK: Architecture: x86_64-unknown-netbsd +# CHECK: Type: core file diff --git a/lldb/lit/ObjectFile/ELF/netbsd-exec-8.99.30-amd64.yaml b/lldb/lit/ObjectFile/ELF/netbsd-exec-8.99.30-amd64.yaml new file mode 100644 index 00000000000..d8e68e9085a --- /dev/null +++ b/lldb/lit/ObjectFile/ELF/netbsd-exec-8.99.30-amd64.yaml @@ -0,0 +1,22 @@ +# Test whether NetBSD executables are recognized correctly. + +# RUN: yaml2obj %s > %t +# RUN: lldb-test object-file %t | FileCheck %s +# CHECK: Architecture: x86_64--netbsd8.99.30 +# CHECK: Type: executable + +--- !ELF +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + Type: ET_EXEC + Machine: EM_X86_64 + Entry: 0x00000000002006F0 +Sections: + - Name: .note.netbsd.ident + Type: SHT_NOTE + Flags: [ SHF_ALLOC ] + Address: 0x00000000002005A8 + AddressAlign: 0x0000000000000004 + Content: 0700000004000000010000004E6574425344000078B29535 +... diff --git a/lldb/lit/ObjectFile/ELF/section-addresses.yaml b/lldb/lit/ObjectFile/ELF/section-addresses.yaml new file mode 100644 index 00000000000..012abbf1f6d --- /dev/null +++ b/lldb/lit/ObjectFile/ELF/section-addresses.yaml @@ -0,0 +1,58 @@ +# RUN: yaml2obj %s > %t +# RUN: lldb-test object-file %t | FileCheck %s + +# CHECK-LABEL: Name: .one +# CHECK: VM address: 0x0 + +# CHECK-LABEL: Name: .nonalloc +# CHECK: VM address: 0x0 + +# CHECK-LABEL: Name: .two +# CHECK: VM address: 0x8 + +# CHECK-LABEL: Name: .three +# CHECK: VM address: 0xc + +# CHECK-LABEL: Name: .four +# CHECK: VM address: 0xc + +# CHECK-LABEL: Name: .five +# CHECK: VM address: 0x1000 + +--- !ELF +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + Type: ET_REL + Machine: EM_X86_64 + Entry: 0x00000000000007A0 +Sections: + - Name: .one + Type: SHT_PROGBITS + Flags: [ SHF_ALLOC ] + AddressAlign: 0x0000000000000004 + Content: DEADBEEFBAADF00D + - Name: .nonalloc + Type: SHT_PROGBITS + AddressAlign: 0x0000000000000004 + Content: DEADBEEFBAADF00D + - Name: .two + Type: SHT_PROGBITS + Flags: [ SHF_ALLOC ] + AddressAlign: 0x0000000000000004 + Content: DE + - Name: .three + Type: SHT_PROGBITS + Flags: [ SHF_ALLOC ] + AddressAlign: 0x0000000000000004 + - Name: .four + Type: SHT_PROGBITS + Flags: [ SHF_ALLOC ] + AddressAlign: 0x0000000000000004 + Content: DEADBEEFBAADF00D + - Name: .five + Type: SHT_PROGBITS + Flags: [ SHF_ALLOC ] + AddressAlign: 0x0000000000001000 + Content: DEADBEEFBAADF00D +... diff --git a/lldb/lit/ObjectFile/ELF/section-overlap.yaml b/lldb/lit/ObjectFile/ELF/section-overlap.yaml new file mode 100644 index 00000000000..bfbd873be41 --- /dev/null +++ b/lldb/lit/ObjectFile/ELF/section-overlap.yaml @@ -0,0 +1,51 @@ +# Test handling of (corrupt?) object files, which have sections with overlapping +# virtual addresses. +# +# Right now the overlapping sections get dropped, but other behaviors +# (including outright rejecting such files) are possible too. + +# RUN: yaml2obj %s > %t +# RUN: lldb-test object-file %t | FileCheck %s + +# CHECK-NOT: .overlap1 +# CHECK-NOT: .overlap2 + +!ELF +FileHeader: + Class: ELFCLASS32 + Data: ELFDATA2LSB + Type: ET_EXEC + Machine: EM_ARM +Sections: + - Name: .sect1 + Type: SHT_PROGBITS + Flags: [ SHF_ALLOC ] + Address: 0x1000 + AddressAlign: 0x4 + Content: DEADBEEFBAADF00D + - Name: .overlap1 + Type: SHT_PROGBITS + Flags: [ SHF_ALLOC ] + Address: 0x1004 + AddressAlign: 0x4 + Content: DEADBEEFBAADF00D + - Name: .sect2 + Type: SHT_PROGBITS + Flags: [ SHF_ALLOC ] + Address: 0x2000 + AddressAlign: 0x4 + Content: DEADBEEFBAADF00D + - Name: .overlap2 + Type: SHT_PROGBITS + Flags: [ SHF_ALLOC ] + Address: 0x2004 + AddressAlign: 0x4 + Content: DEADBEEFBAADF00D +ProgramHeaders: + - Type: PT_LOAD + Flags: [ PF_X, PF_W, PF_R ] + VAddr: 0x1000 + Align: 0x4 + Sections: + - Section: .sect1 + - Section: .overlap1 diff --git a/lldb/lit/ObjectFile/ELF/section-permissions.yaml b/lldb/lit/ObjectFile/ELF/section-permissions.yaml new file mode 100644 index 00000000000..99c2773c81b --- /dev/null +++ b/lldb/lit/ObjectFile/ELF/section-permissions.yaml @@ -0,0 +1,34 @@ +# RUN: yaml2obj %s > %t +# RUN: lldb-test object-file %t | FileCheck %s + +# CHECK-LABEL: Name: .r-x +# CHECK: Permissions: r-x +# +# CHECK-LABEL: Name: .rw- +# CHECK: Permissions: rw- + +# CHECK-LABEL: Name: .--- +# CHECK: Permissions: --- + +--- !ELF +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + Type: ET_REL + Machine: EM_X86_64 + Entry: 0x00000000000007A0 +Sections: + - Name: .r-x + Type: SHT_PROGBITS + Flags: [ SHF_ALLOC, SHF_EXECINSTR ] + Content: DEADBEEFBAADF00D + - Name: .rw- + Type: SHT_PROGBITS + Flags: [ SHF_WRITE, SHF_ALLOC ] + AddressAlign: 0x0000000000000004 + Content: DEADBEEFBAADF00D + - Name: .--- + Type: SHT_PROGBITS + AddressAlign: 0x0000000000000001 + Content: DEADBEEFBAADF00D +... diff --git a/lldb/lit/ObjectFile/ELF/section-types-edgecases.yaml b/lldb/lit/ObjectFile/ELF/section-types-edgecases.yaml new file mode 100644 index 00000000000..ad1fa2d9097 --- /dev/null +++ b/lldb/lit/ObjectFile/ELF/section-types-edgecases.yaml @@ -0,0 +1,35 @@ +# This test doesn't attempt to mandate a specific section classification. It is +# here to document the existing behavior and to make sure we don't do something +# completely crazy (like crashing). + +# RUN: yaml2obj %s > %t +# RUN: lldb-test object-file %t | FileCheck %s + +# The section is called .data, but it has the SHF_EXECINSTR flag set. Have +# the flag take precedence over the name. +# CHECK-LABEL: Name: .data +# CHECK-NEXT: Type: code + +# Section type (SHT_SYMTAB) takes precedence over name-based deduction. +# CHECK-LABEL: Name: .text +# CHECK-NEXT: Type: elf-symbol-table + +--- !ELF +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + Type: ET_DYN + Machine: EM_X86_64 + Entry: 0x00000000000007A0 +Sections: + - Name: .data + Type: SHT_PROGBITS + Flags: [ SHF_EXECINSTR, SHF_ALLOC ] + AddressAlign: 0x0000000000000004 + Content: DEADBEEFBAADF00D + - Name: .text + Type: SHT_SYMTAB + Flags: [ ] + AddressAlign: 0x0000000000000004 + Content: DEADBEEFBAADF00D +... diff --git a/lldb/lit/ObjectFile/ELF/section-types.yaml b/lldb/lit/ObjectFile/ELF/section-types.yaml new file mode 100644 index 00000000000..9f6b4c0533b --- /dev/null +++ b/lldb/lit/ObjectFile/ELF/section-types.yaml @@ -0,0 +1,88 @@ +# RUN: yaml2obj %s > %t +# RUN: lldb-test object-file %t | FileCheck %s + +# CHECK-LABEL: Name: .text +# CHECK-NEXT: Type: code + +# CHECK-LABEL: Name: .debug_info +# CHECK-NEXT: Type: dwarf-info + +# CHECK-LABEL: Name: .debug_types +# CHECK-NEXT: Type: dwarf-types + +# CHECK-LABEL: Name: .debug_types.dwo +# CHECK-NEXT: Type: dwarf-types-dwo + +# CHECK-LABEL: Name: .debug_names +# CHECK-NEXT: Type: dwarf-names + +# CHECK-LABEL: Name: .gnu_debugaltlink +# CHECK-NEXT: Type: dwarf-gnu-debugaltlink + +# CHECK-LABEL: Name: __codesection +# CHECK-NEXT: Type: code + +# CHECK-LABEL: Name: .data +# CHECK-NEXT: Type: data +# CHECK: Thread specific: no + +# CHECK-LABEL: Name: .tdata +# CHECK-NEXT: Type: data +# CHECK: Thread specific: yes + +# CHECK-LABEL: Name: .tbss +# CHECK-NEXT: Type: zero-fill +# CHECK: Thread specific: yes + +--- !ELF +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + Type: ET_REL + Machine: EM_X86_64 + Entry: 0x00000000000007A0 +Sections: + - Name: .text + Type: SHT_PROGBITS + Flags: [ SHF_ALLOC, SHF_EXECINSTR ] + Content: DEADBEEFBAADF00D + - Name: .debug_info + Type: SHT_PROGBITS + AddressAlign: 0x0000000000000001 + Content: DEADBEEFBAADF00D + - Name: .debug_types + Type: SHT_PROGBITS + AddressAlign: 0x0000000000000001 + Content: DEADBEEFBAADF00D + - Name: .debug_types.dwo + Type: SHT_PROGBITS + AddressAlign: 0x0000000000000001 + Content: DEADBEEFBAADF00D + - Name: .debug_names + Type: SHT_PROGBITS + AddressAlign: 0x0000000000000001 + Content: DEADBEEFBAADF00D + - Name: .gnu_debugaltlink + Type: SHT_PROGBITS + AddressAlign: 0x0000000000000001 + Content: DEADBEEFBAADF00D + - Name: __codesection + Type: SHT_PROGBITS + Flags: [ SHF_ALLOC, SHF_EXECINSTR ] + Content: DEADBEEFBAADF00D + - Name: .data + Type: SHT_PROGBITS + Flags: [ SHF_WRITE, SHF_ALLOC ] + AddressAlign: 0x0000000000000004 + Content: 2F000000 + - Name: .tdata + Type: SHT_PROGBITS + Flags: [ SHF_WRITE, SHF_ALLOC, SHF_TLS ] + AddressAlign: 0x0000000000000004 + Content: 2F000000 + - Name: .tbss + Type: SHT_NOBITS + Flags: [ SHF_WRITE, SHF_ALLOC, SHF_TLS ] + AddressAlign: 0x0000000000000004 + Size: 0x0000000000000004 +... diff --git a/lldb/lit/ObjectFile/ELF/short-build-id.yaml b/lldb/lit/ObjectFile/ELF/short-build-id.yaml new file mode 100644 index 00000000000..90781347392 --- /dev/null +++ b/lldb/lit/ObjectFile/ELF/short-build-id.yaml @@ -0,0 +1,26 @@ +# RUN: yaml2obj %s >%t +# RUN: lldb-test object-file %t | FileCheck %s + +# CHECK: UUID: 333059A4-3CC3-D5F9 + +--- !ELF +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + Type: ET_EXEC + Machine: EM_X86_64 + Entry: 0x0000000000201000 +Sections: + - Name: .note.gnu.build-id + Type: SHT_NOTE + Flags: [ SHF_ALLOC ] + Address: 0x0000000000200190 + AddressAlign: 0x0000000000000004 + Content: 040000000800000003000000474E5500333059A43CC3D5F9 + - Name: .text + Type: SHT_PROGBITS + Flags: [ SHF_ALLOC, SHF_EXECINSTR ] + Address: 0x0000000000201000 + AddressAlign: 0x0000000000000004 + Content: '' +... diff --git a/lldb/lit/ObjectFile/MachO/lc_build_version.yaml b/lldb/lit/ObjectFile/MachO/lc_build_version.yaml new file mode 100644 index 00000000000..763525c6e5b --- /dev/null +++ b/lldb/lit/ObjectFile/MachO/lc_build_version.yaml @@ -0,0 +1,219 @@ +# RUN: yaml2obj %s > %t.out +# RUN: lldb-test symbols %t.out | FileCheck %s +# Test that the deployment target is parsed from the load commands. +# CHECK: x86_64-apple-macosx10.14.0 +# CHECK: x86_64-apple-ios12.0.0-macabi +--- !mach-o +FileHeader: + magic: 0xFEEDFACF + cputype: 0x01000007 + cpusubtype: 0x80000003 + filetype: 0x00000002 + ncmds: 15 + sizeofcmds: 776 + flags: 0x00200085 + reserved: 0x00000000 +LoadCommands: + - cmd: LC_SEGMENT_64 + cmdsize: 72 + segname: __PAGEZERO + vmaddr: 0 + vmsize: 4294967296 + fileoff: 0 + filesize: 0 + maxprot: 0 + initprot: 0 + nsects: 0 + flags: 0 + - cmd: LC_SEGMENT_64 + cmdsize: 232 + segname: __TEXT + vmaddr: 4294967296 + vmsize: 4096 + fileoff: 0 + filesize: 4096 + maxprot: 7 + initprot: 5 + nsects: 2 + flags: 0 + Sections: + - sectname: __text + segname: __TEXT + addr: 0x0000000100000FB0 + size: 8 + offset: 0x00000FB0 + align: 4 + reloff: 0x00000000 + nreloc: 0 + flags: 0x80000400 + reserved1: 0x00000000 + reserved2: 0x00000000 + reserved3: 0x00000000 + - sectname: __unwind_info + segname: __TEXT + addr: 0x0000000100000FB8 + size: 72 + offset: 0x00000FB8 + align: 2 + reloff: 0x00000000 + nreloc: 0 + flags: 0x00000000 + reserved1: 0x00000000 + reserved2: 0x00000000 + reserved3: 0x00000000 + - cmd: LC_SEGMENT_64 + cmdsize: 72 + segname: __LINKEDIT + vmaddr: 4294971392 + vmsize: 4096 + fileoff: 4096 + filesize: 152 + maxprot: 7 + initprot: 1 + nsects: 0 + flags: 0 + - cmd: LC_DYLD_INFO_ONLY + cmdsize: 48 + rebase_off: 0 + rebase_size: 0 + bind_off: 0 + bind_size: 0 + weak_bind_off: 0 + weak_bind_size: 0 + lazy_bind_off: 0 + lazy_bind_size: 0 + export_off: 4096 + export_size: 48 + - cmd: LC_SYMTAB + cmdsize: 24 + symoff: 4152 + nsyms: 3 + stroff: 4200 + strsize: 48 + - cmd: LC_DYSYMTAB + cmdsize: 80 + ilocalsym: 0 + nlocalsym: 0 + iextdefsym: 0 + nextdefsym: 2 + iundefsym: 2 + nundefsym: 1 + tocoff: 0 + ntoc: 0 + modtaboff: 0 + nmodtab: 0 + extrefsymoff: 0 + nextrefsyms: 0 + indirectsymoff: 0 + nindirectsyms: 0 + extreloff: 0 + nextrel: 0 + locreloff: 0 + nlocrel: 0 + - cmd: LC_LOAD_DYLINKER + cmdsize: 32 + name: 12 + PayloadString: /usr/lib/dyld + ZeroPadBytes: 7 + - cmd: LC_UUID + cmdsize: 24 + uuid: 8F41E140-23B9-3720-AC28-4E7AF9D159BA + - cmd: LC_BUILD_VERSION + cmdsize: 32 + platform: 1 + minos: 658944 + sdk: 658944 + ntools: 1 + Tools: + - tool: 3 + version: 26738944 + - cmd: LC_SOURCE_VERSION + cmdsize: 16 + version: 0 + - cmd: LC_MAIN + cmdsize: 24 + entryoff: 4016 + stacksize: 0 + - cmd: LC_LOAD_DYLIB + cmdsize: 56 + dylib: + name: 24 + timestamp: 2 + current_version: 82102276 + compatibility_version: 65536 + PayloadString: /usr/lib/libSystem.B.dylib + ZeroPadBytes: 6 + - cmd: LC_FUNCTION_STARTS + cmdsize: 16 + dataoff: 4144 + datasize: 8 + - cmd: LC_DATA_IN_CODE + cmdsize: 16 + dataoff: 4152 + datasize: 0 + - cmd: LC_BUILD_VERSION + cmdsize: 32 + platform: 6 + minos: 786432 + sdk: 786432 + ntools: 1 + Tools: + - tool: 3 + version: 26738944 +LinkEditData: + ExportTrie: + TerminalSize: 0 + NodeOffset: 0 + Name: '' + Flags: 0x0000000000000000 + Address: 0x0000000000000000 + Other: 0x0000000000000000 + ImportName: '' + Children: + - TerminalSize: 0 + NodeOffset: 5 + Name: _ + Flags: 0x0000000000000000 + Address: 0x0000000000000000 + Other: 0x0000000000000000 + ImportName: '' + Children: + - TerminalSize: 2 + NodeOffset: 33 + Name: _mh_execute_header + Flags: 0x0000000000000000 + Address: 0x0000000000000000 + Other: 0x0000000000000000 + ImportName: '' + - TerminalSize: 3 + NodeOffset: 37 + Name: main + Flags: 0x0000000000000000 + Address: 0x0000000000000FB0 + Other: 0x0000000000000000 + ImportName: '' + NameList: + - n_strx: 2 + n_type: 0x0F + n_sect: 1 + n_desc: 16 + n_value: 4294967296 + - n_strx: 22 + n_type: 0x0F + n_sect: 1 + n_desc: 0 + n_value: 4294971312 + - n_strx: 28 + n_type: 0x01 + n_sect: 0 + n_desc: 256 + n_value: 0 + StringTable: + - ' ' + - __mh_execute_header + - _main + - dyld_stub_binder + - '' + - '' + - '' +... diff --git a/lldb/lit/ObjectFile/MachO/lc_build_version_notools.yaml b/lldb/lit/ObjectFile/MachO/lc_build_version_notools.yaml new file mode 100644 index 00000000000..f84c71aff6a --- /dev/null +++ b/lldb/lit/ObjectFile/MachO/lc_build_version_notools.yaml @@ -0,0 +1,206 @@ +# RUN: yaml2obj %s > %t.out +# RUN: lldb-test symbols %t.out | FileCheck %s +# Test that the deployment target is parsed from the load commands. +# CHECK: x86_64-apple-macosx10.14.0 +--- !mach-o +FileHeader: + magic: 0xFEEDFACF + cputype: 0x01000007 + cpusubtype: 0x80000003 + filetype: 0x00000002 + ncmds: 14 + sizeofcmds: 738 + flags: 0x00200085 + reserved: 0x00000000 +LoadCommands: + - cmd: LC_SEGMENT_64 + cmdsize: 72 + segname: __PAGEZERO + vmaddr: 0 + vmsize: 4294967296 + fileoff: 0 + filesize: 0 + maxprot: 0 + initprot: 0 + nsects: 0 + flags: 0 + - cmd: LC_SEGMENT_64 + cmdsize: 232 + segname: __TEXT + vmaddr: 4294967296 + vmsize: 4096 + fileoff: 0 + filesize: 4096 + maxprot: 7 + initprot: 5 + nsects: 2 + flags: 0 + Sections: + - sectname: __text + segname: __TEXT + addr: 0x0000000100000FB0 + size: 8 + offset: 0x00000FB0 + align: 4 + reloff: 0x00000000 + nreloc: 0 + flags: 0x80000400 + reserved1: 0x00000000 + reserved2: 0x00000000 + reserved3: 0x00000000 + - sectname: __unwind_info + segname: __TEXT + addr: 0x0000000100000FB8 + size: 72 + offset: 0x00000FB8 + align: 2 + reloff: 0x00000000 + nreloc: 0 + flags: 0x00000000 + reserved1: 0x00000000 + reserved2: 0x00000000 + reserved3: 0x00000000 + - cmd: LC_SEGMENT_64 + cmdsize: 72 + segname: __LINKEDIT + vmaddr: 4294971392 + vmsize: 4096 + fileoff: 4096 + filesize: 152 + maxprot: 7 + initprot: 1 + nsects: 0 + flags: 0 + - cmd: LC_DYLD_INFO_ONLY + cmdsize: 48 + rebase_off: 0 + rebase_size: 0 + bind_off: 0 + bind_size: 0 + weak_bind_off: 0 + weak_bind_size: 0 + lazy_bind_off: 0 + lazy_bind_size: 0 + export_off: 4096 + export_size: 48 + - cmd: LC_SYMTAB + cmdsize: 24 + symoff: 4152 + nsyms: 3 + stroff: 4200 + strsize: 48 + - cmd: LC_DYSYMTAB + cmdsize: 80 + ilocalsym: 0 + nlocalsym: 0 + iextdefsym: 0 + nextdefsym: 2 + iundefsym: 2 + nundefsym: 1 + tocoff: 0 + ntoc: 0 + modtaboff: 0 + nmodtab: 0 + extrefsymoff: 0 + nextrefsyms: 0 + indirectsymoff: 0 + nindirectsyms: 0 + extreloff: 0 + nextrel: 0 + locreloff: 0 + nlocrel: 0 + - cmd: LC_LOAD_DYLINKER + cmdsize: 32 + name: 12 + PayloadString: /usr/lib/dyld + ZeroPadBytes: 7 + - cmd: LC_UUID + cmdsize: 24 + uuid: 8F41E140-23B9-3720-AC28-4E7AF9D159BA + - cmd: LC_BUILD_VERSION + cmdsize: 24 + platform: 1 + minos: 658944 + sdk: 658944 + ntools: 0 + - cmd: LC_SOURCE_VERSION + cmdsize: 16 + version: 0 + - cmd: LC_MAIN + cmdsize: 24 + entryoff: 4016 + stacksize: 0 + - cmd: LC_LOAD_DYLIB + cmdsize: 56 + dylib: + name: 24 + timestamp: 2 + current_version: 82102276 + compatibility_version: 65536 + PayloadString: /usr/lib/libSystem.B.dylib + ZeroPadBytes: 6 + - cmd: LC_FUNCTION_STARTS + cmdsize: 16 + dataoff: 4144 + datasize: 8 + - cmd: LC_DATA_IN_CODE + cmdsize: 16 + dataoff: 4152 + datasize: 0 +LinkEditData: + ExportTrie: + TerminalSize: 0 + NodeOffset: 0 + Name: '' + Flags: 0x0000000000000000 + Address: 0x0000000000000000 + Other: 0x0000000000000000 + ImportName: '' + Children: + - TerminalSize: 0 + NodeOffset: 5 + Name: _ + Flags: 0x0000000000000000 + Address: 0x0000000000000000 + Other: 0x0000000000000000 + ImportName: '' + Children: + - TerminalSize: 2 + NodeOffset: 33 + Name: _mh_execute_header + Flags: 0x0000000000000000 + Address: 0x0000000000000000 + Other: 0x0000000000000000 + ImportName: '' + - TerminalSize: 3 + NodeOffset: 37 + Name: main + Flags: 0x0000000000000000 + Address: 0x0000000000000FB0 + Other: 0x0000000000000000 + ImportName: '' + NameList: + - n_strx: 2 + n_type: 0x0F + n_sect: 1 + n_desc: 16 + n_value: 4294967296 + - n_strx: 22 + n_type: 0x0F + n_sect: 1 + n_desc: 0 + n_value: 4294971312 + - n_strx: 28 + n_type: 0x01 + n_sect: 0 + n_desc: 256 + n_value: 0 + StringTable: + - ' ' + - __mh_execute_header + - _main + - dyld_stub_binder + - '' + - '' + - '' +... diff --git a/lldb/lit/ObjectFile/MachO/lc_version_min.yaml b/lldb/lit/ObjectFile/MachO/lc_version_min.yaml new file mode 100644 index 00000000000..e79107069f3 --- /dev/null +++ b/lldb/lit/ObjectFile/MachO/lc_version_min.yaml @@ -0,0 +1,205 @@ +# RUN: yaml2obj %s > %t.out +# RUN: lldb-test object-file %t.out | FileCheck %s + +# Test that the deployment target is parsed from the load commands. +# CHECK: Architecture: x86_64-apple-macosx10.9.0 +--- !mach-o +FileHeader: + magic: 0xFEEDFACF + cputype: 0x01000007 + cpusubtype: 0x80000003 + filetype: 0x00000002 + ncmds: 14 + sizeofcmds: 728 + flags: 0x00200085 + reserved: 0x00000000 +LoadCommands: + - cmd: LC_SEGMENT_64 + cmdsize: 72 + segname: __PAGEZERO + vmaddr: 0 + vmsize: 4294967296 + fileoff: 0 + filesize: 0 + maxprot: 0 + initprot: 0 + nsects: 0 + flags: 0 + - cmd: LC_SEGMENT_64 + cmdsize: 232 + segname: __TEXT + vmaddr: 4294967296 + vmsize: 4096 + fileoff: 0 + filesize: 4096 + maxprot: 7 + initprot: 5 + nsects: 2 + flags: 0 + Sections: + - sectname: __text + segname: __TEXT + addr: 0x0000000100000FB0 + size: 8 + offset: 0x00000FB0 + align: 0 + reloff: 0x00000000 + nreloc: 0 + flags: 0x80000400 + reserved1: 0x00000000 + reserved2: 0x00000000 + reserved3: 0x00000000 + - sectname: __unwind_info + segname: __TEXT + addr: 0x0000000100000FB8 + size: 72 + offset: 0x00000FB8 + align: 2 + reloff: 0x00000000 + nreloc: 0 + flags: 0x00000000 + reserved1: 0x00000000 + reserved2: 0x00000000 + reserved3: 0x00000000 + - cmd: LC_SEGMENT_64 + cmdsize: 72 + segname: __LINKEDIT + vmaddr: 4294971392 + vmsize: 4096 + fileoff: 4096 + filesize: 152 + maxprot: 7 + initprot: 1 + nsects: 0 + flags: 0 + - cmd: LC_DYLD_INFO_ONLY + cmdsize: 48 + rebase_off: 0 + rebase_size: 0 + bind_off: 0 + bind_size: 0 + weak_bind_off: 0 + weak_bind_size: 0 + lazy_bind_off: 0 + lazy_bind_size: 0 + export_off: 4096 + export_size: 48 + - cmd: LC_SYMTAB + cmdsize: 24 + symoff: 4152 + nsyms: 3 + stroff: 4200 + strsize: 48 + - cmd: LC_DYSYMTAB + cmdsize: 80 + ilocalsym: 0 + nlocalsym: 0 + iextdefsym: 0 + nextdefsym: 2 + iundefsym: 2 + nundefsym: 1 + tocoff: 0 + ntoc: 0 + modtaboff: 0 + nmodtab: 0 + extrefsymoff: 0 + nextrefsyms: 0 + indirectsymoff: 0 + nindirectsyms: 0 + extreloff: 0 + nextrel: 0 + locreloff: 0 + nlocrel: 0 + - cmd: LC_LOAD_DYLINKER + cmdsize: 32 + name: 12 + PayloadString: /usr/lib/dyld + ZeroPadBytes: 7 + - cmd: LC_UUID + cmdsize: 24 + uuid: E75E737C-4FB3-312D-9B17-10987F48F957 + - cmd: LC_VERSION_MIN_MACOSX + cmdsize: 16 + version: 657664 + sdk: 658944 + - cmd: LC_SOURCE_VERSION + cmdsize: 16 + version: 0 + - cmd: LC_MAIN + cmdsize: 24 + entryoff: 4016 + stacksize: 0 + - cmd: LC_LOAD_DYLIB + cmdsize: 56 + dylib: + name: 24 + timestamp: 2 + current_version: 82102276 + compatibility_version: 65536 + PayloadString: /usr/lib/libSystem.B.dylib + ZeroPadBytes: 6 + - cmd: LC_FUNCTION_STARTS + cmdsize: 16 + dataoff: 4144 + datasize: 8 + - cmd: LC_DATA_IN_CODE + cmdsize: 16 + dataoff: 4152 + datasize: 0 +LinkEditData: + ExportTrie: + TerminalSize: 0 + NodeOffset: 0 + Name: '' + Flags: 0x0000000000000000 + Address: 0x0000000000000000 + Other: 0x0000000000000000 + ImportName: '' + Children: + - TerminalSize: 0 + NodeOffset: 5 + Name: _ + Flags: 0x0000000000000000 + Address: 0x0000000000000000 + Other: 0x0000000000000000 + ImportName: '' + Children: + - TerminalSize: 2 + NodeOffset: 33 + Name: _mh_execute_header + Flags: 0x0000000000000000 + Address: 0x0000000000000000 + Other: 0x0000000000000000 + ImportName: '' + - TerminalSize: 3 + NodeOffset: 37 + Name: main + Flags: 0x0000000000000000 + Address: 0x0000000000000FB0 + Other: 0x0000000000000000 + ImportName: '' + NameList: + - n_strx: 2 + n_type: 0x0F + n_sect: 1 + n_desc: 16 + n_value: 4294967296 + - n_strx: 22 + n_type: 0x0F + n_sect: 1 + n_desc: 0 + n_value: 4294971312 + - n_strx: 28 + n_type: 0x01 + n_sect: 0 + n_desc: 256 + n_value: 0 + StringTable: + - ' ' + - __mh_execute_header + - _main + - dyld_stub_binder + - '' + - '' + - '' +... diff --git a/lldb/lit/ObjectFile/MachO/subsections.yaml b/lldb/lit/ObjectFile/MachO/subsections.yaml new file mode 100644 index 00000000000..a92ef41d79f --- /dev/null +++ b/lldb/lit/ObjectFile/MachO/subsections.yaml @@ -0,0 +1,126 @@ +# RUN: yaml2obj %s > %t +# RUN: lldb-test object-file %t | FileCheck %s + +#CHECK: Showing 2 sections +#CHECK-NEXT: Index: 0 +#CHECK-NEXT: ID: 0x100 +#CHECK-NEXT: Name: __PAGEZERO +#CHECK-NEXT: Type: container +#CHECK-NEXT: Permissions: --- +#CHECK-NEXT: Thread specific: no +#CHECK-NEXT: VM address: 0x0 +#CHECK-NEXT: VM size: 4294967296 +#CHECK-NEXT: File size: 0 +#CHECK-NEXT: There are no subsections +#CHECK-EMPTY: +#CHECK-NEXT: Index: 1 +#CHECK-NEXT: ID: 0x200 +#CHECK-NEXT: Name: __TEXT +#CHECK-NEXT: Type: container +#CHECK-NEXT: Permissions: r-x +#CHECK-NEXT: Thread specific: no +#CHECK-NEXT: VM address: 0x100000000 +#CHECK-NEXT: VM size: 4096 +#CHECK-NEXT: File size: 4096 +#CHECK-NEXT: Showing 3 subsections +#CHECK-NEXT: Index: 0 +#CHECK-NEXT: ID: 0x1 +#CHECK-NEXT: Name: __text +#CHECK-NEXT: Type: code +#CHECK-NEXT: Permissions: r-x +#CHECK-NEXT: Thread specific: no +#CHECK-NEXT: VM address: 0x100000f30 +#CHECK-NEXT: VM size: 22 +#CHECK-NEXT: File size: 22 +#CHECK-EMPTY: +#CHECK-NEXT: Index: 1 +#CHECK-NEXT: ID: 0x2 +#CHECK-NEXT: Name: __unwind_info +#CHECK-NEXT: Type: compact-unwind +#CHECK-NEXT: Permissions: r-x +#CHECK-NEXT: Thread specific: no +#CHECK-NEXT: VM address: 0x100000f48 +#CHECK-NEXT: VM size: 76 +#CHECK-NEXT: File size: 76 +#CHECK-EMPTY: +#CHECK-NEXT: Index: 2 +#CHECK-NEXT: ID: 0x3 +#CHECK-NEXT: Name: __eh_frame +#CHECK-NEXT: Type: eh-frame +#CHECK-NEXT: Permissions: r-x +#CHECK-NEXT: Thread specific: no +#CHECK-NEXT: VM address: 0x100000f98 +#CHECK-NEXT: VM size: 104 +#CHECK-NEXT: File size: 104 + +--- !mach-o +FileHeader: + magic: 0xFEEDFACF + cputype: 0x01000007 + cpusubtype: 0x00000003 + filetype: 0x00000002 + ncmds: 12 + sizeofcmds: 728 + flags: 0x00000085 + reserved: 0x00000000 +LoadCommands: + - cmd: LC_SEGMENT_64 + cmdsize: 72 + segname: __PAGEZERO + vmaddr: 0 + vmsize: 4294967296 + fileoff: 0 + filesize: 0 + maxprot: 0 + initprot: 0 + nsects: 0 + flags: 0 + - cmd: LC_SEGMENT_64 + cmdsize: 312 + segname: __TEXT + vmaddr: 4294967296 + vmsize: 4096 + fileoff: 0 + filesize: 4096 + maxprot: 7 + initprot: 5 + nsects: 3 + flags: 0 + Sections: + - sectname: __text + segname: __TEXT + addr: 0x0000000100000F30 + size: 22 + offset: 0x00000F30 + align: 4 + reloff: 0x00000000 + nreloc: 0 + flags: 0x80000400 + reserved1: 0x00000000 + reserved2: 0x00000000 + reserved3: 0x00000000 + - sectname: __unwind_info + segname: __TEXT + addr: 0x0000000100000F48 + size: 76 + offset: 0x00000F48 + align: 2 + reloff: 0x00000000 + nreloc: 0 + flags: 0x00000000 + reserved1: 0x00000000 + reserved2: 0x00000000 + reserved3: 0x00000000 + - sectname: __eh_frame + segname: __TEXT + addr: 0x0000000100000F98 + size: 104 + offset: 0x00000F98 + align: 3 + reloff: 0x00000000 + nreloc: 0 + flags: 0x0000000B + reserved1: 0x00000000 + reserved2: 0x00000000 + reserved3: 0x00000000 +... diff --git a/lldb/lit/ObjectFile/PECOFF/basic-info-arm.yaml b/lldb/lit/ObjectFile/PECOFF/basic-info-arm.yaml new file mode 100644 index 00000000000..39ef9476857 --- /dev/null +++ b/lldb/lit/ObjectFile/PECOFF/basic-info-arm.yaml @@ -0,0 +1,86 @@ +# RUN: yaml2obj %s > %t +# RUN: lldb-test object-file %t | FileCheck %s + +# CHECK: Plugin name: pe-coff +# CHECK: Architecture: armv7-pc-windows-msvc +# CHECK: UUID: +# CHECK: Executable: true +# CHECK: Stripped: false +# CHECK: Type: executable +# CHECK: Strata: user +# CHECK: Base VM address: 0x40000 + +--- !COFF +OptionalHeader: + AddressOfEntryPoint: 4097 + ImageBase: 4194304 + SectionAlignment: 4096 + FileAlignment: 512 + MajorOperatingSystemVersion: 6 + MinorOperatingSystemVersion: 0 + MajorImageVersion: 0 + MinorImageVersion: 0 + MajorSubsystemVersion: 6 + MinorSubsystemVersion: 0 + Subsystem: IMAGE_SUBSYSTEM_WINDOWS_CUI + DLLCharacteristics: [ IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE, IMAGE_DLL_CHARACTERISTICS_NX_COMPAT, IMAGE_DLL_CHARACTERISTICS_TERMINAL_SERVER_AWARE ] + SizeOfStackReserve: 1048576 + SizeOfStackCommit: 4096 + SizeOfHeapReserve: 1048576 + SizeOfHeapCommit: 4096 + ExportTable: + RelativeVirtualAddress: 0 + Size: 0 + ImportTable: + RelativeVirtualAddress: 0 + Size: 0 + ResourceTable: + RelativeVirtualAddress: 0 + Size: 0 + ExceptionTable: + RelativeVirtualAddress: 0 + Size: 0 + CertificateTable: + RelativeVirtualAddress: 0 + Size: 0 + BaseRelocationTable: + RelativeVirtualAddress: 0 + Size: 0 + Debug: + RelativeVirtualAddress: 0 + Size: 0 + Architecture: + RelativeVirtualAddress: 0 + Size: 0 + GlobalPtr: + RelativeVirtualAddress: 0 + Size: 0 + TlsTable: + RelativeVirtualAddress: 0 + Size: 0 + LoadConfigTable: + RelativeVirtualAddress: 0 + Size: 0 + BoundImport: + RelativeVirtualAddress: 0 + Size: 0 + IAT: + RelativeVirtualAddress: 0 + Size: 0 + DelayImportDescriptor: + RelativeVirtualAddress: 0 + Size: 0 + ClrRuntimeHeader: + RelativeVirtualAddress: 0 + Size: 0 +header: + Machine: IMAGE_FILE_MACHINE_ARMNT + Characteristics: [ IMAGE_FILE_EXECUTABLE_IMAGE, IMAGE_FILE_32BIT_MACHINE ] +sections: + - Name: .text + Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ] + VirtualAddress: 4096 + VirtualSize: 2 + SectionData: '7047' +symbols: [] +... diff --git a/lldb/lit/ObjectFile/PECOFF/basic-info-arm64.yaml b/lldb/lit/ObjectFile/PECOFF/basic-info-arm64.yaml new file mode 100644 index 00000000000..1fcf3b35a8d --- /dev/null +++ b/lldb/lit/ObjectFile/PECOFF/basic-info-arm64.yaml @@ -0,0 +1,86 @@ +# RUN: yaml2obj %s > %t +# RUN: lldb-test object-file %t | FileCheck %s + +# CHECK: Plugin name: pe-coff +# CHECK: Architecture: aarch64-unknown-windows-msvc +# CHECK: UUID: +# CHECK: Executable: true +# CHECK: Stripped: false +# CHECK: Type: executable +# CHECK: Strata: user +# CHECK: Base VM address: 0x40000000 + +--- !COFF +OptionalHeader: + AddressOfEntryPoint: 4096 + ImageBase: 1073741824 + SectionAlignment: 4096 + FileAlignment: 512 + MajorOperatingSystemVersion: 6 + MinorOperatingSystemVersion: 0 + MajorImageVersion: 0 + MinorImageVersion: 0 + MajorSubsystemVersion: 6 + MinorSubsystemVersion: 0 + Subsystem: IMAGE_SUBSYSTEM_WINDOWS_CUI + DLLCharacteristics: [ IMAGE_DLL_CHARACTERISTICS_HIGH_ENTROPY_VA, IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE, IMAGE_DLL_CHARACTERISTICS_NX_COMPAT, IMAGE_DLL_CHARACTERISTICS_TERMINAL_SERVER_AWARE ] + SizeOfStackReserve: 1048576 + SizeOfStackCommit: 4096 + SizeOfHeapReserve: 1048576 + SizeOfHeapCommit: 4096 + ExportTable: + RelativeVirtualAddress: 0 + Size: 0 + ImportTable: + RelativeVirtualAddress: 0 + Size: 0 + ResourceTable: + RelativeVirtualAddress: 0 + Size: 0 + ExceptionTable: + RelativeVirtualAddress: 0 + Size: 0 + CertificateTable: + RelativeVirtualAddress: 0 + Size: 0 + BaseRelocationTable: + RelativeVirtualAddress: 0 + Size: 0 + Debug: + RelativeVirtualAddress: 0 + Size: 0 + Architecture: + RelativeVirtualAddress: 0 + Size: 0 + GlobalPtr: + RelativeVirtualAddress: 0 + Size: 0 + TlsTable: + RelativeVirtualAddress: 0 + Size: 0 + LoadConfigTable: + RelativeVirtualAddress: 0 + Size: 0 + BoundImport: + RelativeVirtualAddress: 0 + Size: 0 + IAT: + RelativeVirtualAddress: 0 + Size: 0 + DelayImportDescriptor: + RelativeVirtualAddress: 0 + Size: 0 + ClrRuntimeHeader: + RelativeVirtualAddress: 0 + Size: 0 +header: + Machine: IMAGE_FILE_MACHINE_ARM64 + Characteristics: [ IMAGE_FILE_EXECUTABLE_IMAGE, IMAGE_FILE_LARGE_ADDRESS_AWARE ] +sections: + - Name: .text + Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ] + VirtualAddress: 4096 + VirtualSize: 4 + SectionData: C0035FD6 +symbols: [] +... diff --git a/lldb/lit/ObjectFile/PECOFF/basic-info.yaml b/lldb/lit/ObjectFile/PECOFF/basic-info.yaml new file mode 100644 index 00000000000..6b08788fb75 --- /dev/null +++ b/lldb/lit/ObjectFile/PECOFF/basic-info.yaml @@ -0,0 +1,86 @@ +# RUN: yaml2obj %s > %t +# RUN: lldb-test object-file %t | FileCheck %s + +# CHECK: Plugin name: pe-coff +# CHECK: Architecture: x86_64-pc-windows-msvc +# CHECK: UUID: +# CHECK: Executable: true +# CHECK: Stripped: false +# CHECK: Type: executable +# CHECK: Strata: user +# CHECK: Base VM address: 0x47000 + +--- !COFF +OptionalHeader: + AddressOfEntryPoint: 4096 + ImageBase: 290816 + SectionAlignment: 4096 + FileAlignment: 512 + MajorOperatingSystemVersion: 6 + MinorOperatingSystemVersion: 0 + MajorImageVersion: 0 + MinorImageVersion: 0 + MajorSubsystemVersion: 6 + MinorSubsystemVersion: 0 + Subsystem: IMAGE_SUBSYSTEM_WINDOWS_CUI + DLLCharacteristics: [ IMAGE_DLL_CHARACTERISTICS_HIGH_ENTROPY_VA, IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE, IMAGE_DLL_CHARACTERISTICS_NX_COMPAT, IMAGE_DLL_CHARACTERISTICS_TERMINAL_SERVER_AWARE ] + SizeOfStackReserve: 1048576 + SizeOfStackCommit: 4096 + SizeOfHeapReserve: 1048576 + SizeOfHeapCommit: 4096 + ExportTable: + RelativeVirtualAddress: 0 + Size: 0 + ImportTable: + RelativeVirtualAddress: 0 + Size: 0 + ResourceTable: + RelativeVirtualAddress: 0 + Size: 0 + ExceptionTable: + RelativeVirtualAddress: 0 + Size: 0 + CertificateTable: + RelativeVirtualAddress: 0 + Size: 0 + BaseRelocationTable: + RelativeVirtualAddress: 0 + Size: 0 + Debug: + RelativeVirtualAddress: 0 + Size: 0 + Architecture: + RelativeVirtualAddress: 0 + Size: 0 + GlobalPtr: + RelativeVirtualAddress: 0 + Size: 0 + TlsTable: + RelativeVirtualAddress: 0 + Size: 0 + LoadConfigTable: + RelativeVirtualAddress: 0 + Size: 0 + BoundImport: + RelativeVirtualAddress: 0 + Size: 0 + IAT: + RelativeVirtualAddress: 0 + Size: 0 + DelayImportDescriptor: + RelativeVirtualAddress: 0 + Size: 0 + ClrRuntimeHeader: + RelativeVirtualAddress: 0 + Size: 0 +header: + Machine: IMAGE_FILE_MACHINE_AMD64 + Characteristics: [ IMAGE_FILE_EXECUTABLE_IMAGE, IMAGE_FILE_LARGE_ADDRESS_AWARE ] +sections: + - Name: .text + Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ] + VirtualAddress: 4096 + VirtualSize: 1 + SectionData: C3 +symbols: [] +... diff --git a/lldb/lit/ObjectFile/PECOFF/dep-modules.yaml b/lldb/lit/ObjectFile/PECOFF/dep-modules.yaml new file mode 100644 index 00000000000..12249439d8f --- /dev/null +++ b/lldb/lit/ObjectFile/PECOFF/dep-modules.yaml @@ -0,0 +1,170 @@ +# REQUIRES: lld +# RUN: yaml2obj < %p/export-dllfunc.yaml > %t.export-dllfunc.obj +# RUN: yaml2obj < %s > %t.obj +# +# RUN: lld-link /machine:x64 /out:%t.export-dllfunc.dll /noentry /nodefaultlib /dll %t.export-dllfunc.obj /export:DllFunc +# RUN: lld-link /out:%t.exe %t.obj %t.export-dllfunc.lib /nodefaultlib /entry:main /include:DllFunc +# +# RUN: lldb-test object-file -dep-modules %t.exe | FileCheck -check-prefix=DEPS %s + + +# DEPS: Showing 1 dependent module(s) + +# Ignore checking the directory and any tentative string in the path. +# DEPS: Name: {{.*}}dep-modules.yaml.{{.*}}export-dllfunc.dll + + +--- !COFF +header: + Machine: IMAGE_FILE_MACHINE_AMD64 + Characteristics: [ ] +sections: + - Name: .text + Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ] + Alignment: 16 + SectionData: 4883EC48C7442444000000004889542438894C2434B904000000E80000000089442430B908000000E8000000008944242C8B4424300344242C4883C448C3 + Relocations: + - VirtualAddress: 27 + SymbolName: 'DllFunc' + Type: IMAGE_REL_AMD64_REL32 + - VirtualAddress: 41 + SymbolName: 'DllFunc' + Type: IMAGE_REL_AMD64_REL32 + - Name: .data + Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ] + Alignment: 4 + SectionData: '' + - Name: .bss + Characteristics: [ IMAGE_SCN_CNT_UNINITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ] + Alignment: 4 + SectionData: '' + - Name: .xdata + Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ] + Alignment: 4 + SectionData: '0104010004820000' + - Name: .drectve + Characteristics: [ IMAGE_SCN_LNK_INFO, IMAGE_SCN_LNK_REMOVE ] + Alignment: 1 + SectionData: 202F44454641554C544C49423A6C6962636D742E6C6962202F44454641554C544C49423A6F6C646E616D65732E6C6962 + - Name: .pdata + Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ] + Alignment: 4 + SectionData: '000000003E00000000000000' + Relocations: + - VirtualAddress: 0 + SymbolName: main + Type: IMAGE_REL_AMD64_ADDR32NB + - VirtualAddress: 4 + SymbolName: main + Type: IMAGE_REL_AMD64_ADDR32NB + - VirtualAddress: 8 + SymbolName: .xdata + Type: IMAGE_REL_AMD64_ADDR32NB + - Name: .llvm_addrsig + Characteristics: [ IMAGE_SCN_LNK_REMOVE ] + Alignment: 1 + SectionData: '10' +symbols: + - Name: .text + Value: 0 + SectionNumber: 1 + SimpleType: IMAGE_SYM_TYPE_NULL + ComplexType: IMAGE_SYM_DTYPE_NULL + StorageClass: IMAGE_SYM_CLASS_STATIC + SectionDefinition: + Length: 62 + NumberOfRelocations: 2 + NumberOfLinenumbers: 0 + CheckSum: 373303044 + Number: 1 + - Name: .data + Value: 0 + SectionNumber: 2 + SimpleType: IMAGE_SYM_TYPE_NULL + ComplexType: IMAGE_SYM_DTYPE_NULL + StorageClass: IMAGE_SYM_CLASS_STATIC + SectionDefinition: + Length: 0 + NumberOfRelocations: 0 + NumberOfLinenumbers: 0 + CheckSum: 0 + Number: 2 + - Name: .bss + Value: 0 + SectionNumber: 3 + SimpleType: IMAGE_SYM_TYPE_NULL + ComplexType: IMAGE_SYM_DTYPE_NULL + StorageClass: IMAGE_SYM_CLASS_STATIC + SectionDefinition: + Length: 0 + NumberOfRelocations: 0 + NumberOfLinenumbers: 0 + CheckSum: 0 + Number: 3 + - Name: .xdata + Value: 0 + SectionNumber: 4 + SimpleType: IMAGE_SYM_TYPE_NULL + ComplexType: IMAGE_SYM_DTYPE_NULL + StorageClass: IMAGE_SYM_CLASS_STATIC + SectionDefinition: + Length: 8 + NumberOfRelocations: 0 + NumberOfLinenumbers: 0 + CheckSum: 2657791889 + Number: 4 + - Name: .drectve + Value: 0 + SectionNumber: 5 + SimpleType: IMAGE_SYM_TYPE_NULL + ComplexType: IMAGE_SYM_DTYPE_NULL + StorageClass: IMAGE_SYM_CLASS_STATIC + SectionDefinition: + Length: 48 + NumberOfRelocations: 0 + NumberOfLinenumbers: 0 + CheckSum: 149686238 + Number: 5 + - Name: .pdata + Value: 0 + SectionNumber: 6 + SimpleType: IMAGE_SYM_TYPE_NULL + ComplexType: IMAGE_SYM_DTYPE_NULL + StorageClass: IMAGE_SYM_CLASS_STATIC + SectionDefinition: + Length: 12 + NumberOfRelocations: 3 + NumberOfLinenumbers: 0 + CheckSum: 2420588879 + Number: 6 + - Name: .llvm_addrsig + Value: 0 + SectionNumber: 7 + SimpleType: IMAGE_SYM_TYPE_NULL + ComplexType: IMAGE_SYM_DTYPE_NULL + StorageClass: IMAGE_SYM_CLASS_STATIC + SectionDefinition: + Length: 1 + NumberOfRelocations: 0 + NumberOfLinenumbers: 0 + CheckSum: 498536548 + Number: 7 + - Name: '@feat.00' + Value: 0 + SectionNumber: -1 + SimpleType: IMAGE_SYM_TYPE_NULL + ComplexType: IMAGE_SYM_DTYPE_NULL + StorageClass: IMAGE_SYM_CLASS_STATIC + - Name: main + Value: 0 + SectionNumber: 1 + SimpleType: IMAGE_SYM_TYPE_NULL + ComplexType: IMAGE_SYM_DTYPE_FUNCTION + StorageClass: IMAGE_SYM_CLASS_EXTERNAL + - Name: 'DllFunc' + Value: 0 + SectionNumber: 0 + SimpleType: IMAGE_SYM_TYPE_NULL + ComplexType: IMAGE_SYM_DTYPE_NULL + StorageClass: IMAGE_SYM_CLASS_EXTERNAL +... diff --git a/lldb/lit/ObjectFile/PECOFF/export-dllfunc.yaml b/lldb/lit/ObjectFile/PECOFF/export-dllfunc.yaml new file mode 100644 index 00000000000..1f858d735ec --- /dev/null +++ b/lldb/lit/ObjectFile/PECOFF/export-dllfunc.yaml @@ -0,0 +1,176 @@ +# REQUIRES: lld +# RUN: yaml2obj < %s > %t.obj +# +# RUN: lld-link /machine:x64 /out:%t.dll /noentry /nodefaultlib /debug /dll %t.obj /export:DllFunc +# +# RUN: lldb-test object-file %t.dll | FileCheck -check-prefix=BASIC-CHECK %s +# RUN: lldb-test object-file -dep-modules %t.dll | FileCheck -check-prefix=DEPS %s + +# BASIC-CHECK: Plugin name: pe-coff + +# UUID should not be empty if the module is built with debug info. +# BASIC-CHECK-DAG: UUID: {{[0-9A-F]{7,}[0-9A-F]}}-{{.*}} + +# BASIC-CHECK: Showing 3 subsections +# BASIC-CHECK: Index: 0 +# BASIC-CHECK: Name: .text +# BASIC-CHECK: Type: code +# BASIC-CHECK: VM size: 22 +# BASIC-CHECK: File size: 512 +# +# BASIC-CHECK: Index: 1 +# BASIC-CHECK: Name: .rdata +# BASIC-CHECK: Type: data +# BASIC-CHECK: VM size: {{.}} +# BASIC-CHECK: File size: 512 +# +# BASIC-CHECK: Index: 2 +# BASIC-CHECK: Name: .pdata +# BASIC-CHECK: Type: data +# BASIC-CHECK: VM size: 12 +# BASIC-CHECK: File size: 512 +# +# DEPS: Showing 0 dependent module(s) + + +--- !COFF +header: + Machine: IMAGE_FILE_MACHINE_AMD64 + Characteristics: [ ] +sections: + - Name: .text + Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ] + Alignment: 16 + SectionData: 50894C24048B4C24040FAF4C2404890C248B042459C3 + - Name: .data + Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ] + Alignment: 4 + SectionData: '' + - Name: .bss + Characteristics: [ IMAGE_SCN_CNT_UNINITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ] + Alignment: 4 + SectionData: '' + - Name: .xdata + Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ] + Alignment: 4 + SectionData: '0101010001020000' + - Name: .drectve + Characteristics: [ IMAGE_SCN_LNK_INFO, IMAGE_SCN_LNK_REMOVE ] + Alignment: 1 + SectionData: 202F44454641554C544C49423A6C6962636D742E6C6962202F44454641554C544C49423A6F6C646E616D65732E6C6962 + - Name: .pdata + Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ] + Alignment: 4 + SectionData: '000000001600000000000000' + Relocations: + - VirtualAddress: 0 + SymbolName: 'DllFunc' + Type: IMAGE_REL_AMD64_ADDR32NB + - VirtualAddress: 4 + SymbolName: 'DllFunc' + Type: IMAGE_REL_AMD64_ADDR32NB + - VirtualAddress: 8 + SymbolName: .xdata + Type: IMAGE_REL_AMD64_ADDR32NB + - Name: .llvm_addrsig + Characteristics: [ IMAGE_SCN_LNK_REMOVE ] + Alignment: 1 + SectionData: '' +symbols: + - Name: .text + Value: 0 + SectionNumber: 1 + SimpleType: IMAGE_SYM_TYPE_NULL + ComplexType: IMAGE_SYM_DTYPE_NULL + StorageClass: IMAGE_SYM_CLASS_STATIC + SectionDefinition: + Length: 22 + NumberOfRelocations: 0 + NumberOfLinenumbers: 0 + CheckSum: 3054557294 + Number: 1 + - Name: .data + Value: 0 + SectionNumber: 2 + SimpleType: IMAGE_SYM_TYPE_NULL + ComplexType: IMAGE_SYM_DTYPE_NULL + StorageClass: IMAGE_SYM_CLASS_STATIC + SectionDefinition: + Length: 0 + NumberOfRelocations: 0 + NumberOfLinenumbers: 0 + CheckSum: 0 + Number: 2 + - Name: .bss + Value: 0 + SectionNumber: 3 + SimpleType: IMAGE_SYM_TYPE_NULL + ComplexType: IMAGE_SYM_DTYPE_NULL + StorageClass: IMAGE_SYM_CLASS_STATIC + SectionDefinition: + Length: 0 + NumberOfRelocations: 0 + NumberOfLinenumbers: 0 + CheckSum: 0 + Number: 3 + - Name: .xdata + Value: 0 + SectionNumber: 4 + SimpleType: IMAGE_SYM_TYPE_NULL + ComplexType: IMAGE_SYM_DTYPE_NULL + StorageClass: IMAGE_SYM_CLASS_STATIC + SectionDefinition: + Length: 8 + NumberOfRelocations: 0 + NumberOfLinenumbers: 0 + CheckSum: 448359300 + Number: 4 + - Name: .drectve + Value: 0 + SectionNumber: 5 + SimpleType: IMAGE_SYM_TYPE_NULL + ComplexType: IMAGE_SYM_DTYPE_NULL + StorageClass: IMAGE_SYM_CLASS_STATIC + SectionDefinition: + Length: 48 + NumberOfRelocations: 0 + NumberOfLinenumbers: 0 + CheckSum: 149686238 + Number: 5 + - Name: .pdata + Value: 0 + SectionNumber: 6 + SimpleType: IMAGE_SYM_TYPE_NULL + ComplexType: IMAGE_SYM_DTYPE_NULL + StorageClass: IMAGE_SYM_CLASS_STATIC + SectionDefinition: + Length: 12 + NumberOfRelocations: 3 + NumberOfLinenumbers: 0 + CheckSum: 3134470316 + Number: 6 + - Name: .llvm_addrsig + Value: 0 + SectionNumber: 7 + SimpleType: IMAGE_SYM_TYPE_NULL + ComplexType: IMAGE_SYM_DTYPE_NULL + StorageClass: IMAGE_SYM_CLASS_STATIC + SectionDefinition: + Length: 0 + NumberOfRelocations: 0 + NumberOfLinenumbers: 0 + CheckSum: 0 + Number: 7 + - Name: '@feat.00' + Value: 0 + SectionNumber: -1 + SimpleType: IMAGE_SYM_TYPE_NULL + ComplexType: IMAGE_SYM_DTYPE_NULL + StorageClass: IMAGE_SYM_CLASS_STATIC + - Name: 'DllFunc' + Value: 0 + SectionNumber: 1 + SimpleType: IMAGE_SYM_TYPE_NULL + ComplexType: IMAGE_SYM_DTYPE_FUNCTION + StorageClass: IMAGE_SYM_CLASS_EXTERNAL +... diff --git a/lldb/lit/ObjectFile/PECOFF/lit.local.cfg b/lldb/lit/ObjectFile/PECOFF/lit.local.cfg new file mode 100644 index 00000000000..9ef350be1de --- /dev/null +++ b/lldb/lit/ObjectFile/PECOFF/lit.local.cfg @@ -0,0 +1 @@ +config.suffixes = ['.yaml', '.test'] diff --git a/lldb/lit/ObjectFile/PECOFF/sections-names.yaml b/lldb/lit/ObjectFile/PECOFF/sections-names.yaml new file mode 100644 index 00000000000..b62c0bc0426 --- /dev/null +++ b/lldb/lit/ObjectFile/PECOFF/sections-names.yaml @@ -0,0 +1,52 @@ +# RUN: yaml2obj %s > %t +# RUN: lldb-test object-file %t | FileCheck %s + +# CHECK: Name: .text{{$}} +# CHECK: Name: 1234567{{$}} +# CHECK: Name: 12345678{{$}} +# CHECK: Name: 123456789{{$}} + +--- !COFF +OptionalHeader: + AddressOfEntryPoint: 4616 + ImageBase: 1073741824 + SectionAlignment: 4096 + FileAlignment: 512 + MajorOperatingSystemVersion: 6 + MinorOperatingSystemVersion: 0 + MajorImageVersion: 0 + MinorImageVersion: 0 + MajorSubsystemVersion: 6 + MinorSubsystemVersion: 0 + Subsystem: IMAGE_SUBSYSTEM_WINDOWS_CUI + DLLCharacteristics: [ IMAGE_DLL_CHARACTERISTICS_HIGH_ENTROPY_VA, IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE, IMAGE_DLL_CHARACTERISTICS_NX_COMPAT, IMAGE_DLL_CHARACTERISTICS_TERMINAL_SERVER_AWARE ] + SizeOfStackReserve: 1048576 + SizeOfStackCommit: 4096 + SizeOfHeapReserve: 1048576 + SizeOfHeapCommit: 4096 +header: + Machine: IMAGE_FILE_MACHINE_AMD64 + Characteristics: [ IMAGE_FILE_EXECUTABLE_IMAGE, IMAGE_FILE_LARGE_ADDRESS_AWARE ] +sections: + - Name: .text + Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ] + VirtualAddress: 4096 + VirtualSize: 64 # '@', if it makes its way into the name field + SectionData: DEADBEEFBAADF00D + - Name: 1234567 + Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ] + VirtualAddress: 442368 + VirtualSize: 64 + SectionData: DEADBEEFBAADF00D + - Name: 12345678 + Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ] + VirtualAddress: 446464 + VirtualSize: 64 + SectionData: DEADBEEFBAADF00D + - Name: 123456789 + Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ] + VirtualAddress: 450560 + VirtualSize: 64 + SectionData: DEADBEEFBAADF00D +symbols: [] +... diff --git a/lldb/lit/ObjectFile/PECOFF/subsections.yaml b/lldb/lit/ObjectFile/PECOFF/subsections.yaml new file mode 100644 index 00000000000..d7ecf68e84a --- /dev/null +++ b/lldb/lit/ObjectFile/PECOFF/subsections.yaml @@ -0,0 +1,70 @@ +# RUN: yaml2obj %s > %t +# RUN: lldb-test object-file %t | FileCheck %s + + +# CHECK: Showing 1 sections +# CHECK-NEXT: Index: 0 +# CHECK-NEXT: ID: 0xffffffffffffffff +# CHECK-NEXT: Name: +# CHECK-NEXT: Type: container +# CHECK-NEXT: Permissions: --- +# CHECK-NEXT: Thread specific: no +# CHECK-NEXT: VM address: 0x40000000 +# CHECK-NEXT: VM size: 12288 +# CHECK-NEXT: File size: 0 +# CHECK-NEXT: Showing 2 subsections +# CHECK-NEXT: Index: 0 +# CHECK-NEXT: ID: 0x1 +# CHECK-NEXT: Name: .text +# CHECK-NEXT: Type: code +# CHECK-NEXT: Permissions: --- +# CHECK-NEXT: Thread specific: no +# CHECK-NEXT: VM address: 0x40001000 +# CHECK-NEXT: VM size: 64 +# CHECK-NEXT: File size: 512 +# CHECK-EMPTY: +# CHECK-NEXT: Index: 1 +# CHECK-NEXT: ID: 0x2 +# CHECK-NEXT: Name: .data +# CHECK-NEXT: Type: data +# CHECK-NEXT: Permissions: --- +# CHECK-NEXT: Thread specific: no +# CHECK-NEXT: VM address: 0x40002000 +# CHECK-NEXT: VM size: 64 +# CHECK-NEXT: File size: 512 + + +--- !COFF +OptionalHeader: + AddressOfEntryPoint: 4616 + ImageBase: 1073741824 + SectionAlignment: 4096 + FileAlignment: 512 + MajorOperatingSystemVersion: 6 + MinorOperatingSystemVersion: 0 + MajorImageVersion: 0 + MinorImageVersion: 0 + MajorSubsystemVersion: 6 + MinorSubsystemVersion: 0 + Subsystem: IMAGE_SUBSYSTEM_WINDOWS_CUI + DLLCharacteristics: [ IMAGE_DLL_CHARACTERISTICS_HIGH_ENTROPY_VA, IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE, IMAGE_DLL_CHARACTERISTICS_NX_COMPAT, IMAGE_DLL_CHARACTERISTICS_TERMINAL_SERVER_AWARE ] + SizeOfStackReserve: 1048576 + SizeOfStackCommit: 4096 + SizeOfHeapReserve: 1048576 + SizeOfHeapCommit: 4096 +header: + Machine: IMAGE_FILE_MACHINE_AMD64 + Characteristics: [ IMAGE_FILE_EXECUTABLE_IMAGE, IMAGE_FILE_LARGE_ADDRESS_AWARE ] +sections: + - Name: .text + Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ] + VirtualAddress: 4096 + VirtualSize: 64 + SectionData: DEADBEEFBAADF00D + - Name: .data + Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ] + VirtualAddress: 8192 + VirtualSize: 64 + SectionData: DEADBEEFBAADF00D +symbols: [] +... diff --git a/lldb/lit/ObjectFile/PECOFF/uuid.yaml b/lldb/lit/ObjectFile/PECOFF/uuid.yaml new file mode 100644 index 00000000000..4f371089167 --- /dev/null +++ b/lldb/lit/ObjectFile/PECOFF/uuid.yaml @@ -0,0 +1,90 @@ +# REQUIRES: lld +# RUN: yaml2obj %s > %t.obj +# RUN: lldb-test object-file %t.obj | FileCheck %s + +# CHECK-DAG: UUID: 14B292E0-D81A-B4F1-4C4C-44205044422E-00000001 + +--- !COFF +OptionalHeader: + AddressOfEntryPoint: 0 + ImageBase: 2147483648 + SectionAlignment: 4096 + FileAlignment: 512 + MajorOperatingSystemVersion: 6 + MinorOperatingSystemVersion: 0 + MajorImageVersion: 0 + MinorImageVersion: 0 + MajorSubsystemVersion: 6 + MinorSubsystemVersion: 0 + Subsystem: IMAGE_SUBSYSTEM_WINDOWS_GUI + DLLCharacteristics: [ IMAGE_DLL_CHARACTERISTICS_HIGH_ENTROPY_VA, IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE, IMAGE_DLL_CHARACTERISTICS_NX_COMPAT ] + SizeOfStackReserve: 1048576 + SizeOfStackCommit: 4096 + SizeOfHeapReserve: 1048576 + SizeOfHeapCommit: 4096 + ExportTable: + RelativeVirtualAddress: 8327 + Size: 90 + ImportTable: + RelativeVirtualAddress: 0 + Size: 0 + ResourceTable: + RelativeVirtualAddress: 0 + Size: 0 + ExceptionTable: + RelativeVirtualAddress: 12288 + Size: 12 + CertificateTable: + RelativeVirtualAddress: 0 + Size: 0 + BaseRelocationTable: + RelativeVirtualAddress: 0 + Size: 0 + Debug: + RelativeVirtualAddress: 8192 + Size: 28 + Architecture: + RelativeVirtualAddress: 0 + Size: 0 + GlobalPtr: + RelativeVirtualAddress: 0 + Size: 0 + TlsTable: + RelativeVirtualAddress: 0 + Size: 0 + LoadConfigTable: + RelativeVirtualAddress: 0 + Size: 0 + BoundImport: + RelativeVirtualAddress: 0 + Size: 0 + IAT: + RelativeVirtualAddress: 0 + Size: 0 + DelayImportDescriptor: + RelativeVirtualAddress: 0 + Size: 0 + ClrRuntimeHeader: + RelativeVirtualAddress: 0 + Size: 0 +header: + Machine: IMAGE_FILE_MACHINE_AMD64 + Characteristics: [ IMAGE_FILE_EXECUTABLE_IMAGE, IMAGE_FILE_LARGE_ADDRESS_AWARE, IMAGE_FILE_DLL ] +sections: + - Name: .text + Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ] + VirtualAddress: 4096 + VirtualSize: 22 + SectionData: 50894C24048B4C24040FAF4C2404890C248B042459C3 + - Name: .rdata + Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ] + VirtualAddress: 8192 + VirtualSize: 236 + SectionData: 00000000A565B65C00000000020000006B0000001C2000001C06000052534453E092B2141AD8F1B44C4C44205044422E01000000443A5C757073747265616D5C6275696C645C746F6F6C735C6C6C64625C6C69745C4D6F64756C65735C5045434F46465C4F75747075745C6578706F72742D646C6C66756E632E79616D6C2E746D702E70646200000000000000000000000000AF200000000000000200000001000000CB200000D3200000D72000006578706F72742D646C6C66756E632E79616D6C2E746D702E646C6C000000000000100000D92000000100446C6C46756E63000000000101010001020000 + - Name: .pdata + Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ] + VirtualAddress: 12288 + VirtualSize: 12 + SectionData: '0010000016100000E4200000' +symbols: [] +... diff --git a/lldb/lit/ObjectFile/lit.local.cfg b/lldb/lit/ObjectFile/lit.local.cfg new file mode 100644 index 00000000000..60e87e4624e --- /dev/null +++ b/lldb/lit/ObjectFile/lit.local.cfg @@ -0,0 +1 @@ +config.suffixes = ['.s', '.test', '.yaml'] |