aboutsummaryrefslogtreecommitdiff
path: root/test/elf/undef-from-dso-to-main.test
blob: 71d0b51499ddd077215aca650e0394431e6459d8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# Tests that a reference from a DSO to a regular object
# forces the final executable to export the symbol.

#RUN: yaml2obj -format=elf %p/Inputs/undef2-so.o.yaml -o=%t.o.so
#RUN: lld -flavor gnu  -target x86_64 -shared %t.o.so -o %T/libundef2.so
#RUN: yaml2obj -format=elf %s -o=%t.o
#RUN: lld -flavor gnu  -target x86_64 %t.o -L%T -lundef2 -o %t1
#RUN: llvm-readobj -dyn-symbols %t1 | FileCheck -check-prefix CHECKSYMS %s

---
FileHeader:
  Class:           ELFCLASS64
  Data:            ELFDATA2LSB
  Type:            ET_REL
  Machine:         EM_X86_64
Sections:
  - Name:            .text
    Type:            SHT_PROGBITS
    Flags:           [ SHF_ALLOC, SHF_EXECINSTR ]
    AddressAlign:    0x0000000000000001
    Content:         C3
  - Name:            .data
    Type:            SHT_PROGBITS
    Flags:           [ SHF_WRITE, SHF_ALLOC ]
    AddressAlign:    0x0000000000000001
    Content:         ''
  - Name:            .bss
    Type:            SHT_NOBITS
    Flags:           [ SHF_WRITE, SHF_ALLOC ]
    AddressAlign:    0x0000000000000004
    Content:         '002E7379'
Symbols:
  Local:
    - Name:            .text
      Type:            STT_SECTION
      Section:         .text
    - Name:            .data
      Type:            STT_SECTION
      Section:         .data
    - Name:            .bss
      Type:            STT_SECTION
      Section:         .bss
  Global:
    - Name:            myexportedsymbol
      Type:            STT_OBJECT
      Section:         .bss
      Size:            0x0000000000000004
    - Name:            _start
      Section:         .text
      Size:            0x0000000000000001

#CHECKSYMS: myexportedsymbol