File: nm-shared-object.test

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (50 lines) | stat: -rw-r--r-- 1,552 bytes parent folder | download | duplicates (21)
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
# RUN: llvm-nm -D %p/Inputs/shared-object-test.elf-i386 \
# RUN:         | FileCheck %s -check-prefix ELF-32
# RUN: llvm-nm --dynamic %p/Inputs/shared-object-test.elf-i386 \
# RUN:         | FileCheck %s -check-prefix ELF-32

# ELF-32-NOT: U
# ELF-32: 000012c8 A __bss_start
# ELF-32: 000012c8 A _edata
# ELF-32: 000012cc A _end
# ELF-32: 000012c8 B common_sym
# ELF-32: 000012c4 D defined_sym
# ELF-32: 000001f0 T global_func
# ELF-32: 00000000 D tls_sym

# RUN: llvm-nm -D %p/Inputs/shared-object-test.elf-x86-64 \
# RUN:         | FileCheck %s -check-prefix ELF-64
# RUN: llvm-nm --dynamic %p/Inputs/shared-object-test.elf-x86-64 \
# RUN:         | FileCheck %s -check-prefix ELF-64

# ELF-64-NOT: U
# ELF-64: 0000000000200454 A __bss_start
# ELF-64: 0000000000200454 A _edata
# ELF-64: 0000000000200458 A _end
# ELF-64: 0000000000200454 B common_sym
# ELF-64: 0000000000200450 D defined_sym
# ELF-64: 00000000000002f0 T global_func
# ELF-64: 0000000000000000 D tls_sym

# RUN: not llvm-nm -D %p/Inputs/weak-global-symbol.macho-i386 2>&1 \
# RUN:         | FileCheck %s -check-prefix ERROR

# RUN: not llvm-nm -D %p/Inputs/trivial-object-test.coff-i386 2>&1 \
# RUN:         | FileCheck %s -check-prefix ERROR

# ERROR: File format has no dynamic symbol table

# RUN: yaml2obj %s -o %t.elf-i386
# RUN: llvm-nm -D %t.elf-i386 2>&1 | FileCheck %s -check-prefix=NO-SYMBOLS

# NO-SYMBOLS: no symbols

--- !ELF
FileHeader:
  Class:   ELFCLASS32
  Data:    ELFDATA2LSB
  Type:    ET_REL
  Machine: EM_386
Symbols:
  - Name:    foo
    Binding: STB_GLOBAL