Files
clang-p2996/lld/test/ELF/version-script-glob.s
Fangrui Song 962b29d716 ELFObjectWriter: Don't sort non-local symbols
As we don't sort local symbols, don't sort non-local symbols.  This makes
non-local symbols appear in their register order, which matches GNU as. The
register order is nice in that you can write tests with interleaved CHECK
prefixes, e.g.

```
// CHECK: something about foo
.globl foo
foo:
// CHECK: something about bar
.globl bar
bar:
```

With the lexicographical order, the user needs to place lexicographical smallest
symbol first or keep CHECK prefixes in one place.
2021-02-13 10:32:27 -08:00

24 lines
623 B
ArmAsm

# REQUIRES: x86
# RUN: echo "{ global: foo*; bar*; local: *; };" > %t.script
# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
# RUN: ld.lld -shared --version-script %t.script %t.o -o %t.so
# RUN: llvm-readelf --dyn-syms %t.so | FileCheck %s
.globl foo1, bar1, zed1, local
foo1:
bar1:
zed1:
local:
# CHECK: foo1{{$}}
# CHECK-NEXT: bar1{{$}}
# CHECK-NOT: {{.}}
# RUN: echo "{ global : local; local: *; };" > %t1.script
# RUN: ld.lld -shared --version-script %t1.script %t.o -o %t.so
# RUN: llvm-readelf --dyn-syms %t.so | FileCheck --check-prefix=LOCAL %s
# LOCAL: local{{$}}
# LOCAL-NOT: {{.}}