1// REQUIRES: x86
2// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
3// RUN: ld.lld --hash-style=sysv %t.o %S/Inputs/segment-start.script -shared -o %t.so
4// RUN: llvm-readobj --dyn-symbols %t.so | FileCheck %s
5
6// CHECK:      Name: foobar1
7// CHECK-NEXT: Value: 0x8001
8
9// CHECK:      Name: foobar2
10// CHECK-NEXT: Value: 0x8002
11
12// CHECK:      Name: foobar3
13// CHECK-NEXT: Value: 0x8003
14
15// CHECK:      Name: foobar4
16// CHECK-NEXT: Value: 0x8004
17
18.data
19.quad foobar1
20.quad foobar2
21.quad foobar3
22.quad foobar4
23
24// RUN: echo "SECTIONS { . = SEGMENT_START(\"foobar\", foo); }" > %t.script
25// RUN: not ld.lld %t.o %t.script -shared -o /dev/null 2>&1 \
26// RUN: | FileCheck --check-prefix=ERR %s
27// ERR: {{.*}}.script:1: symbol not found: foo
28