diff options
| author | George Rimar <grimar@accesssoftek.com> | 2016-07-13 07:46:00 +0000 |
|---|---|---|
| committer | George Rimar <grimar@accesssoftek.com> | 2016-07-13 07:46:00 +0000 |
| commit | e05103ea11f797a6f210fe11dfaf46289cceba24 (patch) | |
| tree | bf7fb241fce04f6631e5c84327aa470d5add434e /lld/test/ELF | |
| parent | 14ef11c110e574ecc575fff3e43a95b88452a8fb (diff) | |
| download | bcm5719-llvm-e05103ea11f797a6f210fe11dfaf46289cceba24.tar.gz bcm5719-llvm-e05103ea11f797a6f210fe11dfaf46289cceba24.zip | |
[ELF] - Implement extern "c++" version script tag
Patch implements 'extern' version script tag.
Currently only values in quotes(") are supported.
Matching of externs is performed in the same pass as exact match of globals.
Differential revision: http://reviews.llvm.org/D21930
llvm-svn: 275257
Diffstat (limited to 'lld/test/ELF')
| -rw-r--r-- | lld/test/ELF/version-script-err.s | 5 | ||||
| -rw-r--r-- | lld/test/ELF/version-script-extern.s | 98 |
2 files changed, 98 insertions, 5 deletions
diff --git a/lld/test/ELF/version-script-err.s b/lld/test/ELF/version-script-err.s index 4df15d59265..15b69e98505 100644 --- a/lld/test/ELF/version-script-err.s +++ b/lld/test/ELF/version-script-err.s @@ -8,8 +8,3 @@ // RUN: not ld.lld --version-script %terr1.script -shared %t.o -o %t.so 2>&1 | \ // RUN: FileCheck -check-prefix=ERR1 %s // ERR1: unclosed quote - -// RUN: echo "VERSION { extern "C++" {}; }; " > %terr2.script -// RUN: not ld.lld --version-script %terr2.script -shared %t.o -o %t.so 2>&1 | \ -// RUN: FileCheck -check-prefix=ERR2 %s -// ERR2: extern keyword is not supported diff --git a/lld/test/ELF/version-script-extern.s b/lld/test/ELF/version-script-extern.s new file mode 100644 index 00000000000..c5533fbdced --- /dev/null +++ b/lld/test/ELF/version-script-extern.s @@ -0,0 +1,98 @@ +# REQUIRES: x86 +# XFAIL: win32 + +# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o +# RUN: echo "LIBSAMPLE_1.0 { \ +# RUN: global: \ +# RUN: extern "C++" { \ +# RUN: \"foo()\"; \ +# RUN: \"zed()\"; \ +# RUN: }; \ +# RUN: }; \ +# RUN: LIBSAMPLE_2.0 { \ +# RUN: global: \ +# RUN: extern "C++" { \ +# RUN: \"bar()\"; \ +# RUN: }; \ +# RUN: }; " > %t.script +# RUN: ld.lld --version-script %t.script -shared %t.o -o %t.so +# RUN: llvm-readobj -V -dyn-symbols %t.so | FileCheck --check-prefix=DSO %s + +# DSO: DynamicSymbols [ +# DSO-NEXT: Symbol { +# DSO-NEXT: Name: @ +# DSO-NEXT: Value: 0x0 +# DSO-NEXT: Size: 0 +# DSO-NEXT: Binding: Local +# DSO-NEXT: Type: None +# DSO-NEXT: Other: 0 +# DSO-NEXT: Section: Undefined +# DSO-NEXT: } +# DSO-NEXT: Symbol { +# DSO-NEXT: Name: _Z3barv@@LIBSAMPLE_2.0 +# DSO-NEXT: Value: 0x1001 +# DSO-NEXT: Size: 0 +# DSO-NEXT: Binding: Global +# DSO-NEXT: Type: Function +# DSO-NEXT: Other: 0 +# DSO-NEXT: Section: .text +# DSO-NEXT: } +# DSO-NEXT: Symbol { +# DSO-NEXT: Name: _Z3foov@@LIBSAMPLE_1.0 +# DSO-NEXT: Value: 0x1000 +# DSO-NEXT: Size: 0 +# DSO-NEXT: Binding: Global +# DSO-NEXT: Type: Function +# DSO-NEXT: Other: 0 +# DSO-NEXT: Section: .text +# DSO-NEXT: } +# DSO-NEXT: Symbol { +# DSO-NEXT: Name: _Z3zedv@@LIBSAMPLE_1.0 +# DSO-NEXT: Value: 0x1002 +# DSO-NEXT: Size: 0 +# DSO-NEXT: Binding: Global (0x1) +# DSO-NEXT: Type: Function (0x2) +# DSO-NEXT: Other: 0 +# DSO-NEXT: Section: .text (0x6) +# DSO-NEXT: } +# DSO-NEXT: ] +# DSO-NEXT: Version symbols { +# DSO-NEXT: Section Name: .gnu.version +# DSO-NEXT: Address: 0x228 +# DSO-NEXT: Offset: 0x228 +# DSO-NEXT: Link: 1 +# DSO-NEXT: Symbols [ +# DSO-NEXT: Symbol { +# DSO-NEXT: Version: 0 +# DSO-NEXT: Name: @ +# DSO-NEXT: } +# DSO-NEXT: Symbol { +# DSO-NEXT: Version: 3 +# DSO-NEXT: Name: _Z3barv@@LIBSAMPLE_2.0 +# DSO-NEXT: } +# DSO-NEXT: Symbol { +# DSO-NEXT: Version: 2 +# DSO-NEXT: Name: _Z3foov@@LIBSAMPLE_1.0 +# DSO-NEXT: } +# DSO-NEXT: Symbol { +# DSO-NEXT: Version: 2 +# DSO-NEXT: Name: _Z3zedv@@LIBSAMPLE_1.0 +# DSO-NEXT: } +# DSO-NEXT: ] +# DSO-NEXT: } + +.text +.globl _Z3foov +.type _Z3foov,@function +_Z3foov: +retq + +.globl _Z3barv +.type _Z3barv,@function +_Z3barv: +retq + +.globl _Z3zedv +.type _Z3zedv,@function +_Z3zedv: +retq |

