[lld] r319051 - Add a missing test.
Rafael Espindola via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 27 09:18:09 PST 2017
Author: rafael
Date: Mon Nov 27 09:18:09 2017
New Revision: 319051
URL: http://llvm.org/viewvc/llvm-project?rev=319051&view=rev
Log:
Add a missing test.
We were not testing that we correctly handled a .o with a weak symbol
after a .so.
Modified:
lld/trunk/test/ELF/gc-sections-shared.s
Modified: lld/trunk/test/ELF/gc-sections-shared.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/gc-sections-shared.s?rev=319051&r1=319050&r2=319051&view=diff
==============================================================================
--- lld/trunk/test/ELF/gc-sections-shared.s (original)
+++ lld/trunk/test/ELF/gc-sections-shared.s Mon Nov 27 09:18:09 2017
@@ -66,6 +66,62 @@
# CHECK: NEEDED Shared library: [{{.*}}3.so]
# CHECK-NOT: NEEDED
+# Test with %t.o at the end too.
+# RUN: ld.lld --gc-sections --export-dynamic-symbol foo -o %t --as-needed %t2.so %t3.so %t4.so %t.o
+# RUN: llvm-readobj --dynamic-table --dyn-symbols %t | FileCheck --check-prefix=CHECK2 %s
+
+# CHECK2: DynamicSymbols [
+# CHECK2-NEXT: Symbol {
+# CHECK2-NEXT: Name:
+# CHECK2-NEXT: Value:
+# CHECK2-NEXT: Size:
+# CHECK2-NEXT: Binding: Local
+# CHECK2-NEXT: Type:
+# CHECK2-NEXT: Other:
+# CHECK2-NEXT: Section: Undefined (0x0)
+# CHECK2-NEXT: }
+# CHECK2-NEXT: Symbol {
+# CHECK2-NEXT: Name: bar
+# CHECK2-NEXT: Value:
+# CHECK2-NEXT: Size:
+# CHECK2-NEXT: Binding: Global
+# CHECK2-NEXT: Type:
+# CHECK2-NEXT: Other:
+# CHECK2-NEXT: Section: .text
+# CHECK2-NEXT: }
+# CHECK2-NEXT: Symbol {
+# CHECK2-NEXT: Name: qux
+# CHECK2-NEXT: Value:
+# CHECK2-NEXT: Size:
+# CHECK2-NEXT: Binding: Weak
+# CHECK2-NEXT: Type:
+# CHECK2-NEXT: Other:
+# CHECK2-NEXT: Section: Undefined
+# CHECK2-NEXT: }
+# CHECK2-NEXT: Symbol {
+# CHECK2-NEXT: Name: foo
+# CHECK2-NEXT: Value:
+# CHECK2-NEXT: Size:
+# CHECK2-NEXT: Binding: Global
+# CHECK2-NEXT: Type:
+# CHECK2-NEXT: Other:
+# CHECK2-NEXT: Section: .text
+# CHECK2-NEXT: }
+# CHECK2-NEXT: Symbol {
+# CHECK2-NEXT: Name: baz
+# CHECK2-NEXT: Value:
+# CHECK2-NEXT: Size:
+# CHECK2-NEXT: Binding: Global
+# CHECK2-NEXT: Type:
+# CHECK2-NEXT: Other:
+# CHECK2-NEXT: Section: Undefined
+# CHECK2-NEXT: }
+# CHECK2-NEXT: ]
+
+# CHECK2-NOT: NEEDED
+# CHECK2: NEEDED Shared library: [{{.*}}3.so]
+# CHECK2-NOT: NEEDED
+
.section .text.foo, "ax"
.globl foo
foo:
More information about the llvm-commits
mailing list