[lld] r287119 - Define -build-id=tree as a synonym for -build-id=sha1.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 16 09:14:11 PST 2016
Author: ruiu
Date: Wed Nov 16 11:14:11 2016
New Revision: 287119
URL: http://llvm.org/viewvc/llvm-project?rev=287119&view=rev
Log:
Define -build-id=tree as a synonym for -build-id=sha1.
Our build-id is a tree hash anyway, so I'll define this as a synonym
for sha1. GNU gold takes this parameter, so this is for compatibility
with that.
Modified:
lld/trunk/ELF/Driver.cpp
lld/trunk/test/ELF/build-id.s
Modified: lld/trunk/ELF/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Driver.cpp?rev=287119&r1=287118&r2=287119&view=diff
==============================================================================
--- lld/trunk/ELF/Driver.cpp (original)
+++ lld/trunk/ELF/Driver.cpp Wed Nov 16 11:14:11 2016
@@ -561,7 +561,7 @@ void LinkerDriver::readConfigs(opt::Inpu
StringRef S = Arg->getValue();
if (S == "md5") {
Config->BuildId = BuildIdKind::Md5;
- } else if (S == "sha1") {
+ } else if (S == "sha1" || S == "tree") {
Config->BuildId = BuildIdKind::Sha1;
} else if (S == "uuid") {
Config->BuildId = BuildIdKind::Uuid;
Modified: lld/trunk/test/ELF/build-id.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/build-id.s?rev=287119&r1=287118&r2=287119&view=diff
==============================================================================
--- lld/trunk/test/ELF/build-id.s (original)
+++ lld/trunk/test/ELF/build-id.s Wed Nov 16 11:14:11 2016
@@ -1,29 +1,39 @@
# REQUIRES: x86
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
-# RUN: ld.lld --build-id %t -o %t2
+
+# RUN: ld.lld --build-id %t -o %t2 -threads
+# RUN: llvm-objdump -s %t2 | FileCheck -check-prefix=DEFAULT %s
+# RUN: ld.lld --build-id %t -o %t2 -no-threads
# RUN: llvm-objdump -s %t2 | FileCheck -check-prefix=DEFAULT %s
-# RUN: ld.lld --build-id=md5 %t -o %t2
+
+# RUN: ld.lld --build-id=md5 %t -o %t2 -threads
# RUN: llvm-objdump -s %t2 | FileCheck -check-prefix=MD5 %s
-# RUN: ld.lld --build-id=sha1 %t -o %t2
+# RUN: ld.lld --build-id=md5 %t -o %t2 -no-threads
+# RUN: llvm-objdump -s %t2 | FileCheck -check-prefix=MD5 %s
+
+# RUN: ld.lld --build-id=sha1 %t -o %t2 -threads
+# RUN: llvm-objdump -s %t2 | FileCheck -check-prefix=SHA1 %s
+# RUN: ld.lld --build-id=sha1 %t -o %t2 -no-threads
+# RUN: llvm-objdump -s %t2 | FileCheck -check-prefix=SHA1 %s
+
+# RUN: ld.lld --build-id=tree %t -o %t2 -threads
+# RUN: llvm-objdump -s %t2 | FileCheck -check-prefix=SHA1 %s
+# RUN: ld.lld --build-id=tree %t -o %t2 -no-threads
# RUN: llvm-objdump -s %t2 | FileCheck -check-prefix=SHA1 %s
+
# RUN: ld.lld --build-id=uuid %t -o %t2
# RUN: llvm-objdump -s %t2 | FileCheck -check-prefix=UUID %s
+
# RUN: ld.lld --build-id=0x12345678 %t -o %t2
# RUN: llvm-objdump -s %t2 | FileCheck -check-prefix=HEX %s
+
# RUN: ld.lld %t -o %t2
# RUN: llvm-objdump -s %t2 | FileCheck -check-prefix=NONE %s
+
# RUN: ld.lld --build-id=md5 --build-id=none %t -o %t2
# RUN: llvm-objdump -s %t2 | FileCheck -check-prefix=NONE %s
-## Multithreaded cases:
-# RUN: ld.lld --build-id -threads %t -o %t2
-# RUN: llvm-objdump -s %t2 | FileCheck -check-prefix=DEFAULT %s
-# RUN: ld.lld --build-id=md5 -threads %t -o %t2
-# RUN: llvm-objdump -s %t2 | FileCheck -check-prefix=MD5 %s
-# RUN: ld.lld --build-id=sha1 -threads %t -o %t2
-# RUN: llvm-objdump -s %t2 | FileCheck -check-prefix=SHA1 %s
-
.globl _start
_start:
nop
More information about the llvm-commits
mailing list