[PATCH] D33461: ELF: The later of --build-id and --build-id= wins.
Peter Collingbourne via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue May 23 14:17:03 PDT 2017
This revision was automatically updated to reflect the committed changes.
Closed by commit rL303689: ELF: The later of --build-id and --build-id= wins. (authored by pcc).
Changed prior to commit:
https://reviews.llvm.org/D33461?vs=99988&id=99990#toc
Repository:
rL LLVM
https://reviews.llvm.org/D33461
Files:
lld/trunk/ELF/Driver.cpp
lld/trunk/test/ELF/build-id.s
Index: lld/trunk/test/ELF/build-id.s
===================================================================
--- lld/trunk/test/ELF/build-id.s
+++ lld/trunk/test/ELF/build-id.s
@@ -33,6 +33,10 @@
# RUN: ld.lld --build-id=md5 --build-id=none %t -o %t2
# RUN: llvm-objdump -s %t2 | FileCheck -check-prefix=NONE %s
+# RUN: ld.lld --build-id --build-id=none %t -o %t2
+# RUN: llvm-objdump -s %t2 | FileCheck -check-prefix=NONE %s
+# RUN: ld.lld --build-id=none --build-id %t -o %t2
+# RUN: llvm-objdump -s %t2 | FileCheck -check-prefix=DEFAULT %s
.globl _start
_start:
Index: lld/trunk/ELF/Driver.cpp
===================================================================
--- lld/trunk/ELF/Driver.cpp
+++ lld/trunk/ELF/Driver.cpp
@@ -572,10 +572,14 @@
// -build-id=sha1 are actually tree hashes for performance reasons.
static std::pair<BuildIdKind, std::vector<uint8_t>>
getBuildId(opt::InputArgList &Args) {
- if (Args.hasArg(OPT_build_id))
+ auto *Arg = Args.getLastArg(OPT_build_id, OPT_build_id_eq);
+ if (!Arg)
+ return {BuildIdKind::None, {}};
+
+ if (Arg->getOption().getID() == OPT_build_id)
return {BuildIdKind::Fast, {}};
- StringRef S = getString(Args, OPT_build_id_eq, "none");
+ StringRef S = Arg->getValue();
if (S == "md5")
return {BuildIdKind::Md5, {}};
if (S == "sha1" || S == "tree")
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33461.99990.patch
Type: text/x-patch
Size: 1330 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170523/65b22c7d/attachment.bin>
More information about the llvm-commits
mailing list