llvm-project/llvm/tools/llvm-objdump
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
..
CMakeLists.txt Fix lld macho standalone build by including llvm/Config/llvm-config.h instead of llvm/Config/config.h 2021-05-19 11:15:07 -04:00
COFFDump.cpp [llvm-objdump] -p: Dump PE header for PE/COFF 2021-11-09 10:08:41 -08:00
COFFDump.h [llvm-objdump] -p: Dump PE header for PE/COFF 2021-11-09 10:08:41 -08:00
ELFDump.cpp [llvm] Replace report_fatal_error(std::string) uses with report_fatal_error(Twine) 2021-10-06 12:04:30 +01:00
ELFDump.h [llvm-objdump][ELF][NFC] Create ELFDump.h 2020-04-23 21:24:37 -04:00
MachODump.cpp Move TargetRegistry.(h|cpp) from Support to MC 2021-10-08 14:51:48 -07:00
MachODump.h llvm-objdump: add --rpaths to macho support 2021-04-22 16:01:10 -07:00
ObjdumpOptID.h [llvm-objdump] Add an llvm-otool tool 2021-04-20 08:24:58 -04:00
ObjdumpOpts.td [llvm-objdump][docs] Add details to the help output and command guide 2021-10-07 16:30:12 +01:00
OtoolOpts.td [llvm-objdump] Add an llvm-otool tool 2021-04-20 08:24:58 -04:00
SourcePrinter.cpp llvm-objdump: refactor SourcePrinter into separate file. NFC. 2021-04-23 10:21:52 +01:00
SourcePrinter.h llvm-objdump: refactor SourcePrinter into separate file. NFC. 2021-04-23 10:21:52 +01:00
WasmDump.cpp [llvm-objdump][Wasm][NFC] Create WasmDump.h 2020-04-14 18:26:24 -04:00
WasmDump.h [llvm-objdump][Wasm][NFC] Create WasmDump.h 2020-04-14 18:26:24 -04:00
XCOFFDump.cpp [AIX]implement the --syms and using "symbol index and qualname" for --sym --symbol--description for llvm-objdump for xcoff 2021-10-01 12:37:51 -04:00
XCOFFDump.h [AIX]implement the --syms and using "symbol index and qualname" for --sym --symbol--description for llvm-objdump for xcoff 2021-10-01 12:37:51 -04:00
llvm-objdump.cpp [llvm-objdump] -p: Dump PE header for PE/COFF 2021-11-09 10:08:41 -08:00
llvm-objdump.h [llvm-objdump] Fix the Assertion failure when providing invalid --debug-vars or --dwarf values 2021-11-04 11:01:32 +00:00