File: elf-dynsym.test

package info (click to toggle)
llvm-toolchain-20 1%3A20.1.8-1~exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,111,388 kB
  • sloc: cpp: 7,438,767; ansic: 1,393,871; asm: 1,012,926; python: 241,728; f90: 86,635; objc: 75,411; lisp: 42,144; pascal: 17,286; sh: 10,027; ml: 5,082; perl: 4,730; awk: 3,523; makefile: 3,349; javascript: 2,251; xml: 892; fortran: 672
file content (45 lines) | stat: -rw-r--r-- 1,844 bytes parent folder | download | duplicates (7)
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
// This test verifies that loading an ELF file that has no section headers can
// load the dynamic symbol table using the DT_SYMTAB, DT_SYMENT, DT_HASH or
// the DT_GNU_HASH .dynamic key/value pairs that are loaded via the PT_DYNAMIC
// segment.

// REQUIRES: x86-registered-Target
// RUN: llvm-mc -triple=x86_64-pc-linux -filetype=obj \
// RUN:   -o - - <<<".globl defined, undefined; defined:" | \
// RUN:   ld.lld /dev/stdin -o - --hash-style=gnu -export-dynamic -shared \
// RUN:   -o %t.gnu
// RUN: llvm-strip --strip-sections %t.gnu
// RUN: %lldb %t.gnu -b \
// RUN:   -o "image dump objfile" \
// RUN:   | FileCheck %s --dump-input=always --check-prefix=GNU
// GNU: (lldb) image dump objfile
// GNU: Dumping headers for 1 module(s).
// GNU: ObjectFileELF, file =
// GNU: ELF Header
// GNU: e_type      = 0x0003 ET_DYN
// Make sure there are no section headers
// GNU: e_shnum = 0x00000000
// Make sure we were able to load the symbols
// GNU: Symtab, file = {{.*}}elf-dynsym.test.tmp.gnu, num_symbols = 2:
// GNU-DAG: undefined
// GNU-DAG: defined

// RUN: llvm-mc -triple=x86_64-pc-linux -filetype=obj \
// RUN:   -o - - <<<".globl defined, undefined; defined:" | \
// RUN:   ld.lld /dev/stdin -o - --hash-style=sysv -export-dynamic -shared \
// RUN:   -o %t.sysv
// RUN: llvm-strip --strip-sections %t.sysv
// RUN: %lldb %t.sysv -b \
// RUN:   -o "image dump objfile" \
// RUN:   | FileCheck %s --dump-input=always --check-prefix=HASH
// HASH: (lldb) image dump objfile
// HASH: Dumping headers for 1 module(s).
// HASH: ObjectFileELF, file =
// HASH: ELF Header
// HASH: e_type      = 0x0003 ET_DYN
// Make sure there are no section headers
// HASH: e_shnum = 0x00000000
// Make sure we were able to load the symbols
// HASH: Symtab, file = {{.*}}elf-dynsym.test.tmp.sysv, num_symbols = 2:
// HASH-DAG: undefined
// HASH-DAG: defined