Files
clang-p2996/lld/test/ELF/lto/version-script.ll
George Rimar d3566309eb [ELF] - Recommit r273143("[ELF] - Basic versioned symbols support implemented.")
With fix:
-soname flag was not set in testcase. Hash calculated for base def was different on local
and bot machines because filename fos used for calculating.

Initial commit message:
Patch implements basic support of versioned symbols.
There is no wildcards patterns matching except local: *;
There is no support for hierarchies.
There is no support for symbols overrides (@ vs @@ not handled).

This patch allows programs that using simple scripts to link and run.

Differential revision: http://reviews.llvm.org/D21018

llvm-svn: 273152
2016-06-20 11:55:12 +00:00

51 lines
1.2 KiB
LLVM

; REQUIRES: x86
; RUN: llvm-as %s -o %t.o
; RUN: echo "VERSION_1.0{ global: foo; local: *; }; VERSION_2.0{ global: bar; local: *; };" > %t.script
; RUN: ld.lld -m elf_x86_64 %t.o -o %t2 -shared --version-script %t.script -save-temps
; RUN: llvm-dis < %t2.lto.bc | FileCheck %s
; RUN: llvm-readobj -V -dyn-symbols %t2 | FileCheck --check-prefix=DSO %s
target triple = "x86_64-unknown-linux-gnu"
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
define void @foo() {
ret void
}
define void @bar() {
ret void
}
; CHECK: define void @foo()
; CHECK: define void @bar()
; DSO: DynamicSymbols [
; DSO: Symbol {
; DSO: Name: @ (0)
; DSO: Value: 0x0
; DSO: Size: 0
; DSO: Binding: Local
; DSO: Type: None
; DSO: Other: 0
; DSO: Section: Undefined
; DSO: }
; DSO: Symbol {
; DSO: Name: foo@@VERSION_1.0
; DSO: Value: 0x1000
; DSO: Size: 1
; DSO: Binding: Global
; DSO: Type: Function
; DSO: Other: 0
; DSO: Section: .text
; DSO: }
; DSO: Symbol {
; DSO: Name: bar@@VERSION_2.0
; DSO: Value: 0x1010
; DSO: Size: 1
; DSO: Binding: Global
; DSO: Type: Function
; DSO: Other: 0
; DSO: Section: .text
; DSO: }
; DSO: ]