1# REQUIRES: x86
2
3## Version scripts are handled before relocation processing, so
4## { local: *; } does not make a canonical PLT VER_NDX_LOCAL.
5
6# RUN: echo '.global foo; .type foo, @function; foo:' | \
7# RUN:   llvm-mc -filetype=obj -triple=x86_64-unknown-linux - -o %t.so.o
8# RUN: ld.lld %t.so.o -o %t.so -shared
9
10# RUN: echo "{ global: main; local: *; };" > %t.script
11
12# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
13# RUN: ld.lld %t.o %t.so -o %t -version-script %t.script
14# RUN: llvm-readelf -r --symbols %t | FileCheck %s
15
16# CHECK:      Relocation section '.rela.plt' at offset {{.*}} contains 1 entries:
17# CHECK:        R_X86_64_JUMP_SLOT [[ADDR:[0-9a-f]+]] foo + 0
18
19# CHECK:      Symbol table '.dynsym' contains 2 entries:
20# CHECK-NEXT:   Num:    Value          Size Type    Bind   Vis      Ndx Name
21# CHECK-NEXT:     0: 0000000000000000     0 NOTYPE  LOCAL  DEFAULT  UND
22# CHECK-NEXT:     1: [[ADDR]]             0 FUNC    GLOBAL DEFAULT  UND foo
23
24.globl _start
25_start:
26  movl $foo - ., %eax
27