summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael J. Spencer <bigcheesegs@gmail.com>2015-10-02 21:57:52 +0000
committerMichael J. Spencer <bigcheesegs@gmail.com>2015-10-02 21:57:52 +0000
commited3476b79f8aa9ac1e8a5fa821b28daf01c75c28 (patch)
tree508229741fa15a8ffbcbcb84796b8609db5caf88
parent2d6c0e79f7270a039a9a2e708450be80c8fea423 (diff)
downloadbcm5719-llvm-ed3476b79f8aa9ac1e8a5fa821b28daf01c75c28.tar.gz
bcm5719-llvm-ed3476b79f8aa9ac1e8a5fa821b28daf01c75c28.zip
[elf2] Add STB_GNU_UNIQUE support.
llvm-svn: 249193
-rw-r--r--lld/ELF/InputFiles.cpp1
-rw-r--r--lld/test/elf2/gnu-unique.s24
2 files changed, 25 insertions, 0 deletions
diff --git a/lld/ELF/InputFiles.cpp b/lld/ELF/InputFiles.cpp
index 7e3e1bbbb8a..3ca44817420 100644
--- a/lld/ELF/InputFiles.cpp
+++ b/lld/ELF/InputFiles.cpp
@@ -181,6 +181,7 @@ SymbolBody *elf2::ObjectFile<ELFT>::createSymbolBody(StringRef StringTable,
error("unexpected binding");
case STB_GLOBAL:
case STB_WEAK:
+ case STB_GNU_UNIQUE:
return new (Alloc) DefinedRegular<ELFT>(Name, *Sym, *Sections[SecIndex]);
}
}
diff --git a/lld/test/elf2/gnu-unique.s b/lld/test/elf2/gnu-unique.s
new file mode 100644
index 00000000000..49496d60cc1
--- /dev/null
+++ b/lld/test/elf2/gnu-unique.s
@@ -0,0 +1,24 @@
+// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t
+// RUN: lld -flavor gnu2 %t -shared -o %tout.so
+// RUN: llvm-readobj -t -dyn-symbols %tout.so | FileCheck %s
+// REQUIRES: x86
+
+// Check that STB_GNU_UNIQUE is treated as a global and ends up in the dynamic
+// symbol table as STB_GNU_UNIQUE.
+
+.global _start
+.text
+_start:
+
+.data
+.type symb, @gnu_unique_object
+symb:
+
+# CHECK: Name: symb@
+# CHECK-NEXT: Value:
+# CHECK-NEXT: Size: 0
+# CHECK-NEXT: Binding: Unique
+# CHECK-NEXT: Type: Object
+# CHECK-NEXT: Other: 0
+# CHECK-NEXT: Section: .data
+# CHECK-NEXT: }
OpenPOWER on IntegriCloud