summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-objcopy/llvm-objcopy.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools/llvm-objcopy/llvm-objcopy.cpp')
-rw-r--r--llvm/tools/llvm-objcopy/llvm-objcopy.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/tools/llvm-objcopy/llvm-objcopy.cpp b/llvm/tools/llvm-objcopy/llvm-objcopy.cpp
index eb1d0de90d5..0b09184497d 100644
--- a/llvm/tools/llvm-objcopy/llvm-objcopy.cpp
+++ b/llvm/tools/llvm-objcopy/llvm-objcopy.cpp
@@ -121,6 +121,10 @@ static cl::opt<bool> LocalizeHidden(
"localize-hidden",
cl::desc(
"Mark all symbols that have hidden or internal visibility as local"));
+static cl::opt<std::string>
+ AddGnuDebugLink("add-gnu-debuglink",
+ cl::desc("adds a .gnu_debuglink for <debug-file>"),
+ cl::value_desc("debug-file"));
using SectionPred = std::function<bool(const SectionBase &Sec)>;
@@ -318,6 +322,10 @@ template <class ELFT> void CopyBinary(const ELFObjectFile<ELFT> &ObjFile) {
}
}
+ if (!AddGnuDebugLink.empty()) {
+ Obj->addGnuDebugLink(AddGnuDebugLink);
+ }
+
Obj->finalize();
WriteObjectFile(*Obj, OutputFilename.getValue());
}
OpenPOWER on IntegriCloud