Files
clang-p2996/llvm/test/tools/llvm-objdump/COFF/private-headers-old.test
Fangrui Song 5f1e509579 [llvm-objdump] -p: Dump PE header for PE/COFF
For a trivial DLL built with `clang --target=x86_64-windows -O2 -c a.c; lld-link -subsystem:console -dll a.o -out:a.dll`,
`objdump -p` vs `llvm-objdump -p`:

```
-a.dll:     file format pei-x86-64
-
+a.dll: file format coff-x86-64
 Characteristics 0x2022
        executable
        large address aware
@@ -57,4 +56,4 @@
 Entry d 0000000000000000 00000000 Delay Import Directory
 Entry e 0000000000000000 00000000 CLR Runtime Header
 Entry f 0000000000000000 00000000 Reserved
-
+Export Table:
```

For a Linux image (`vmlinuz-5.10.76-gentoo-r1`) built with `CONFIG_EFI_STUB=y`

```
-vmlinuz-5.10.76-gentoo-r1:     file format pei-x86-64
-
-Characteristics 0x20e
+vmlinuz-5.10.76-gentoo-r1:     file format coff-x86-64
+Characteristics 0x206
        executable
        line numbers stripped
-       symbols stripped
        debugging information removed

 Time/Date              Wed Dec 31 16:00:00 1969
@@ -55,10 +53,4 @@
 Entry d 0000000000000000 00000000 Delay Import Directory
 Entry e 0000000000000000 00000000 CLR Runtime Header
 Entry f 0000000000000000 00000000 Reserved
-
-
-PE File Base Relocations (interpreted .reloc section contents)
-
-Virtual Address: 000037ca Chunk size 10 (0xa) Number of fixups 1
-       reloc    0 offset    0 [37ca] ABSOLUTE
-
+Export Table:
```

`symbols stripped` looks like a GNU objdump problem.

Reviewed By: jhenderson, alexander-shaposhnikov

Differential Revision: https://reviews.llvm.org/D113356
2021-11-09 10:08:41 -08:00

80 lines
2.9 KiB
Plaintext

// RUN: llvm-objdump -p %p/Inputs/nop.exe.coff-i386 | \
// RUN: FileCheck -check-prefix=IMPORT %s
IMPORT: The Import Tables:
IMPORT: lookup 000021e4 time 00000000 fwd 00000000 name 0000234a addr 00002024
IMPORT: DLL Name: MSVCR110.dll
IMPORT-NEXT: Hint/Ord Name
IMPORT-NEXT: 767 _initterm_e
IMPORT-NEXT: 766 _initterm
IMPORT-NEXT: 437 __initenv
IMPORT-NEXT: 660 _fmode
IMPORT-NEXT: 571 _commode
IMPORT-NEXT: 315 ?terminate@@YAXXZ
IMPORT-NEXT: 424 __crtSetUnhandledExceptionFilter
IMPORT-NEXT: 892 _lock
IMPORT-NEXT: 1254 _unlock
IMPORT-NEXT: 498 __setusermatherr
IMPORT-NEXT: 428 __dllonexit
IMPORT-NEXT: 1058 _onexit
IMPORT-NEXT: 774 _invoke_watson
IMPORT-NEXT: 575 _controlfp_s
IMPORT-NEXT: 624 _except_handler4_common
IMPORT-NEXT: 587 _crt_debugger_hook
IMPORT-NEXT: 426 __crtUnhandledException
IMPORT-NEXT: 425 __crtTerminateProcess
IMPORT-NEXT: 572 _configthreadlocale
IMPORT-NEXT: 556 _cexit
IMPORT-NEXT: 633 _exit
IMPORT-NEXT: 1484 exit
IMPORT-NEXT: 496 __set_app_type
IMPORT-NEXT: 436 __getmainargs
IMPORT-NEXT: 533 _amsg_exit
IMPORT-NEXT: 555 _calloc_crt
IMPORT-NEXT: 367 _XcptFilter
// RUN: llvm-objdump -p %p/Inputs/export.dll.coff-i386 | \
// RUN: FileCheck -check-prefix=EXPORT %s
EXPORT: Export Table:
EXPORT-NEXT: DLL name: export.test.tmp3.dll
EXPORT-NEXT: Ordinal base: 5
EXPORT-NEXT: Ordinal RVA Name
EXPORT-NEXT: 5 0x2008
EXPORT-NEXT: 6 0x2010 exportfn2
// RUN: llvm-objdump -p %p/Inputs/tls.exe.coff-x86_64 | \
// RUN: FileCheck -check-prefix=TLS %s
TLS: TLS directory:
TLS-NEXT: StartAddressOfRawData: 0x00000000000000
TLS-NEXT: EndAddressOfRawData: 0x00000000000000
TLS-NEXT: AddressOfIndex: 0x00000000000000
TLS-NEXT: AddressOfCallBacks: 0x00000000000000
TLS-NEXT: SizeOfZeroFill: 0
TLS-NEXT: Characteristics: 0
TLS-NEXT: Alignment: 0
// RUN: llvm-objdump -p %p/Inputs/nop.exe.coff-i386 | \
// RUN: FileCheck -check-prefix=LOADCFG %s
LOADCFG: Load configuration:
LOADCFG-NEXT: Timestamp: 0
LOADCFG-NEXT: Major Version: 0
LOADCFG-NEXT: Minor Version: 0
LOADCFG-NEXT: GlobalFlags Clear: 0
LOADCFG-NEXT: GlobalFlags Set: 0
LOADCFG-NEXT: Critical Section Default Timeout: 0
LOADCFG-NEXT: Decommit Free Block Threshold: 0
LOADCFG-NEXT: Decommit Total Free Threshold: 0
LOADCFG-NEXT: Lock Prefix Table: 0
LOADCFG-NEXT: Maximum Allocation Size: 0
LOADCFG-NEXT: Virtual Memory Threshold: 0
LOADCFG-NEXT: Process Affinity Mask: 0
LOADCFG-NEXT: Process Heap Flags: 0
LOADCFG-NEXT: CSD Version: 0
LOADCFG-NEXT: Security Cookie: 4206616
LOADCFG-NEXT: SEH Table: 4202768
LOADCFG-NEXT: SEH Count: 1
LOADCFG: SEH Table: 0x401689