2018-04-09 19:43:52 +08:00
|
|
|
# REQUIRES: x86
|
|
|
|
|
2018-04-11 17:24:27 +08:00
|
|
|
# RUN: echo '.data; .file "file2"; foo2:; .global bar2; .hidden bar2; bar2:' > %t2.s
|
2018-04-09 19:43:52 +08:00
|
|
|
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %t2.s -o %t2.o
|
|
|
|
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t1.o
|
|
|
|
|
2018-04-11 17:24:27 +08:00
|
|
|
# RUN: ld.lld -o %t %t1.o %t2.o --emit-relocs
|
2019-05-01 14:02:16 +08:00
|
|
|
# RUN: llvm-readelf --symbols --sections %t | FileCheck %s
|
2018-04-09 19:43:52 +08:00
|
|
|
|
2018-04-11 17:24:27 +08:00
|
|
|
## Check we sort local symbols to match the following order:
|
|
|
|
## file1, local1, section1, hidden1, file2, local2, section2, hidden2 ...
|
|
|
|
|
|
|
|
# CHECK: Section Headers:
|
|
|
|
# CHECK: [Nr] Name
|
|
|
|
# CHECK: [ [[ST:.*]]] .text
|
|
|
|
# CHECK: [ [[SD:.*]]] .data
|
|
|
|
# CHECK: [ [[SC:.*]]] .comment
|
2018-04-09 19:43:52 +08:00
|
|
|
|
2019-09-07 18:42:11 +08:00
|
|
|
# CHECK: Size Type Bind Vis Ndx Name
|
|
|
|
# CHECK-NEXT: 0 NOTYPE LOCAL DEFAULT UND
|
|
|
|
# CHECK-NEXT: 0 FILE LOCAL DEFAULT ABS file1
|
|
|
|
# CHECK-NEXT: 0 NOTYPE LOCAL DEFAULT 1 foo1
|
|
|
|
# CHECK-NEXT: 0 SECTION LOCAL DEFAULT [[ST]]
|
|
|
|
# CHECK-NEXT: 0 NOTYPE LOCAL HIDDEN 1 bar1
|
|
|
|
# CHECK-NEXT: 0 FILE LOCAL DEFAULT ABS file2
|
|
|
|
# CHECK-NEXT: 0 NOTYPE LOCAL DEFAULT 2 foo2
|
|
|
|
# CHECK-NEXT: 0 SECTION LOCAL DEFAULT [[SD]]
|
|
|
|
# CHECK-NEXT: 0 NOTYPE LOCAL HIDDEN 2 bar2
|
|
|
|
# CHECK-NEXT: 0 SECTION LOCAL DEFAULT [[SC]]
|
2018-04-09 19:43:52 +08:00
|
|
|
|
|
|
|
foo1:
|
|
|
|
|
|
|
|
.global bar1
|
|
|
|
.hidden bar1
|
|
|
|
bar1:
|
|
|
|
|
|
|
|
.file "file1"
|