• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# REQUIRES: x86
2# RUN: echo ".global foo; foo = 0x123" | llvm-mc -filetype=obj -triple=x86_64-pc-linux - -o %t.o
3# RUN: ld.lld -o %t.so --script %s %t.o -shared
4# RUN: llvm-readobj --symbols %t.so | FileCheck %s
5
6SECTIONS {
7  .text : {
8    bar1 = ALIGNOF(.text);
9    bar2 = CONSTANT (MAXPAGESIZE);
10    bar3 = SIZEOF (.text);
11    bar4 = SIZEOF_HEADERS;
12    bar5 = 0x42;
13    bar6 = foo + 1;
14    *(.text)
15  }
16}
17
18# CHECK:      Symbol {
19# CHECK:        Name: foo
20# CHECK-NEXT:   Value: 0x123
21# CHECK-NEXT:   Size: 0
22# CHECK-NEXT:   Binding: Global
23# CHECK-NEXT:   Type: None
24# CHECK-NEXT:   Other: 0
25# CHECK-NEXT:   Section: Absolute (0xFFF1)
26# CHECK-NEXT: }
27# CHECK-NEXT: Symbol {
28# CHECK-NEXT:   Name: bar1
29# CHECK-NEXT:   Value: 0x4
30# CHECK-NEXT:   Size: 0
31# CHECK-NEXT:   Binding: Global
32# CHECK-NEXT:   Type: None
33# CHECK-NEXT:   Other: 0
34# CHECK-NEXT:   Section: Absolute
35# CHECK-NEXT: }
36# CHECK-NEXT: Symbol {
37# CHECK-NEXT:   Name: bar2
38# CHECK-NEXT:   Value: 0x1000
39# CHECK-NEXT:   Size: 0
40# CHECK-NEXT:   Binding: Global
41# CHECK-NEXT:   Type: None
42# CHECK-NEXT:   Other: 0
43# CHECK-NEXT:   Section: Absolute
44# CHECK-NEXT: }
45# CHECK-NEXT: Symbol {
46# CHECK-NEXT:   Name: bar3
47# CHECK-NEXT:   Value: 0x0
48# CHECK-NEXT:   Size: 0
49# CHECK-NEXT:   Binding: Global
50# CHECK-NEXT:   Type: None
51# CHECK-NEXT:   Other: 0
52# CHECK-NEXT:   Section: Absolute
53# CHECK-NEXT: }
54# CHECK-NEXT: Symbol {
55# CHECK-NEXT:   Name: bar4
56# CHECK-NEXT:   Value:
57# CHECK-NEXT:   Size: 0
58# CHECK-NEXT:   Binding: Global
59# CHECK-NEXT:   Type: None
60# CHECK-NEXT:   Other: 0
61# CHECK-NEXT:   Section: Absolute
62# CHECK-NEXT: }
63# CHECK-NEXT: Symbol {
64# CHECK-NEXT:   Name: bar5
65# CHECK-NEXT:   Value: 0x42
66# CHECK-NEXT:   Size: 0
67# CHECK-NEXT:   Binding: Global
68# CHECK-NEXT:   Type: None
69# CHECK-NEXT:   Other: 0
70# CHECK-NEXT:   Section: Absolute
71# CHECK-NEXT: }
72# CHECK-NEXT: Symbol {
73# CHECK-NEXT:   Name: bar6
74# CHECK-NEXT:   Value: 0x124
75# CHECK-NEXT:   Size: 0
76# CHECK-NEXT:   Binding: Global (0x1)
77# CHECK-NEXT:   Type: None (0x0)
78# CHECK-NEXT:   Other: 0
79# CHECK-NEXT:   Section: Absolute (0xFFF1)
80# CHECK-NEXT: }
81