aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-objdump/llvm-objdump.cpp
diff options
context:
space:
mode:
authorNico Weber <thakis@chromium.org>2022-08-15 09:06:57 -0400
committerNico Weber <thakis@chromium.org>2022-08-15 10:58:52 -0400
commit940e178c0018b32af2f1478d331fc41a92a7dac7 (patch)
treead7d2d9517d7d679444f196caffead76385c6955 /llvm/tools/llvm-objdump/llvm-objdump.cpp
parente114ecc5feafe849cbaf1a1df49dc7b3650f06ba (diff)
downloadllvm-940e178c0018b32af2f1478d331fc41a92a7dac7.zip
llvm-940e178c0018b32af2f1478d331fc41a92a7dac7.tar.gz
llvm-940e178c0018b32af2f1478d331fc41a92a7dac7.tar.bz2
[llvm-objdump] Start on -chained_fixups for llvm-otool
And --chained-fixups for llvm-objdump. For now, this only prints the dyld_chained_fixups_header and adds plumbing for the flag. This will be expanded in future commits. When Apple's effort to upstream their chained fixups code continues, we'll replace this code with the then-upstreamed code. But we need something in the meantime for testing ld64.lld's chained fixups code. Update chained-fixups.yaml with a file that actually contains the chained fixup data (`LinkEditData` doesn't encode it yet, so use `__LINKEDIT` via `--raw-segment=data`). Differential Revision: https://reviews.llvm.org/D131890
Diffstat (limited to 'llvm/tools/llvm-objdump/llvm-objdump.cpp')
-rw-r--r--llvm/tools/llvm-objdump/llvm-objdump.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/llvm/tools/llvm-objdump/llvm-objdump.cpp b/llvm/tools/llvm-objdump/llvm-objdump.cpp
index efac3a8..f7b4814 100644
--- a/llvm/tools/llvm-objdump/llvm-objdump.cpp
+++ b/llvm/tools/llvm-objdump/llvm-objdump.cpp
@@ -2787,6 +2787,8 @@ static void parseOtoolOptions(const llvm::opt::InputArgList &InputArgs) {
FilterSections.push_back(",__text");
LeadingAddr = LeadingHeaders = !InputArgs.hasArg(OTOOL_X);
+ ChainedFixups = InputArgs.hasArg(OTOOL_chained_fixups);
+
InputFilenames = InputArgs.getAllArgValues(OTOOL_INPUT);
if (InputFilenames.empty())
reportCmdLineError("no input file");
@@ -2990,11 +2992,12 @@ int main(int argc, char **argv) {
!DynamicRelocations && !FileHeaders && !PrivateHeaders && !RawClangAST &&
!Relocations && !SectionHeaders && !SectionContents && !SymbolTable &&
!DynamicSymbolTable && !UnwindInfo && !FaultMapSection && !Offloading &&
- !(MachOOpt && (Bind || DataInCode || DyldInfo || DylibId || DylibsUsed ||
- ExportsTrie || FirstPrivateHeader || FunctionStarts ||
- IndirectSymbols || InfoPlist || LazyBind || LinkOptHints ||
- ObjcMetaData || Rebase || Rpaths || UniversalHeaders ||
- WeakBind || !FilterSections.empty()))) {
+ !(MachOOpt &&
+ (Bind || DataInCode || ChainedFixups || DyldInfo || DylibId ||
+ DylibsUsed || ExportsTrie || FirstPrivateHeader || FunctionStarts ||
+ IndirectSymbols || InfoPlist || LazyBind || LinkOptHints ||
+ ObjcMetaData || Rebase || Rpaths || UniversalHeaders || WeakBind ||
+ !FilterSections.empty()))) {
T->printHelp(ToolName);
return 2;
}