Bring r319051 back.

It had been reverted because it depended on r319008 which has been
recommitted.

Original message:

Add a missing test.

We were not testing that we correctly handled a .o with a weak symbol
after a .so.

llvm-svn: 319217
This commit is contained in:
Rafael Espindola 2017-11-28 20:21:44 +00:00
parent 7fe7acc6b1
commit f70502d3a6
1 changed files with 56 additions and 0 deletions

View File

@ -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: