llvm-project/llvm/tools/llvm-objdump
Fangrui Song 11a8fc6856 [llvm-objdump] --private-headers: change errors to warnings for dynamic section dumping
Fix #54456: `objcopy --only-keep-debug` produces a linked image with invalid
empty dynamic section. llvm-objdump -p currently reports an error which seems
excessive.

```
% llvm-readelf -l a.out
llvm-readelf: warning: 'a.out': no valid dynamic table was found
...
```

Follow the spirit of llvm-readelf -l (D64472) and report a warning instead.
This allows later files to be dumped despite warnings for an input file, and
improves objdump compatibility in that the exit code is now 0 instead of 1.

```
% llvm-objdump -p a.out  # new behavior
...
Program Header:
llvm-objdump: warning: 'a.out': invalid empty dynamic section
% objdump -p a.out
...
Dynamic Section:

```

Reviewed By: jhenderson, raj.khem

Differential Revision: https://reviews.llvm.org/D122505
2022-03-28 01:00:43 -07:00
..
CMakeLists.txt Install symlink "otool" if LLVM_INSTALL_CCTOOLS_SYMLINKS is set 2022-03-23 16:22:24 -04:00
COFFDump.cpp Revert "Rename llvm::array_lengthof into llvm::size to match std::size from C++17" 2022-01-26 16:55:53 +01:00
COFFDump.h [llvm] Remove unused forward declarations (NFC) 2022-01-07 20:00:34 -08:00
ELFDump.cpp [llvm-objdump] --private-headers: change errors to warnings for dynamic section dumping 2022-03-28 01:00:43 -07:00
ELFDump.h
MachODump.cpp [NFC] Remove dead code (try 2) 2022-02-22 16:15:01 -08:00
MachODump.h Add a (nonfunctional) -dyld_info flag to llvm-objdump. 2022-02-22 11:06:27 -08:00
ObjdumpOptID.h [llvm-objdump] Add an llvm-otool tool 2021-04-20 08:24:58 -04:00
ObjdumpOpts.td Add a (nonfunctional) -dyld_info flag to llvm-objdump. 2022-02-22 11:06:27 -08:00
OtoolOpts.td Add a (nonfunctional) -dyld_info flag to llvm-objdump. 2022-02-22 11:06:27 -08:00
SourcePrinter.cpp Cleanup include: DebugInfo/Symbolize 2022-02-24 13:25:11 +01:00
SourcePrinter.h Cleanup LLVMObject headers 2022-02-10 21:13:44 +01:00
WasmDump.cpp [llvm-objdump] Use cast<> instead of dyn_cast<> to avoid dereference of nullptr 2022-01-23 12:50:12 +00:00
WasmDump.h
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 [CSKY] Enhance asm parser and relocation fixup for some special symbol address instruction 2022-03-24 14:14:04 +08:00
llvm-objdump.h [llvm] Remove unused forward declarations (NFC) 2022-01-07 20:00:34 -08:00