46 lines · plain
1// This test verifies that loading an ELF file that has no section headers can2// load the dynamic symbol table using the DT_SYMTAB, DT_SYMENT, DT_HASH or3// the DT_GNU_HASH .dynamic key/value pairs that are loaded via the PT_DYNAMIC4// segment.5 6// REQUIRES: x86-registered-Target7// RUN: llvm-mc -triple=x86_64-pc-linux -filetype=obj \8// RUN: -o - - <<<".globl defined, undefined; defined:" | \9// RUN: ld.lld /dev/stdin -o - --hash-style=gnu -export-dynamic -shared \10// RUN: -o %t.gnu11// RUN: llvm-strip --strip-sections %t.gnu12// RUN: %lldb %t.gnu -b \13// RUN: -o "image dump objfile" \14// RUN: | FileCheck %s --dump-input=always --check-prefix=GNU15// GNU: (lldb) image dump objfile16// GNU: Dumping headers for 1 module(s).17// GNU: ObjectFileELF, file =18// GNU: ELF Header19// GNU: e_type = 0x0003 ET_DYN20// Make sure there are no section headers21// GNU: e_shnum = 0x0000000022// Make sure we were able to load the symbols23// GNU: Symtab, file = {{.*}}elf-dynsym.test.tmp.gnu, num_symbols = 2:24// GNU-DAG: undefined25// GNU-DAG: defined26 27// RUN: llvm-mc -triple=x86_64-pc-linux -filetype=obj \28// RUN: -o - - <<<".globl defined, undefined; defined:" | \29// RUN: ld.lld /dev/stdin -o - --hash-style=sysv -export-dynamic -shared \30// RUN: -o %t.sysv31// RUN: llvm-strip --strip-sections %t.sysv32// RUN: %lldb %t.sysv -b \33// RUN: -o "image dump objfile" \34// RUN: | FileCheck %s --dump-input=always --check-prefix=HASH35// HASH: (lldb) image dump objfile36// HASH: Dumping headers for 1 module(s).37// HASH: ObjectFileELF, file =38// HASH: ELF Header39// HASH: e_type = 0x0003 ET_DYN40// Make sure there are no section headers41// HASH: e_shnum = 0x0000000042// Make sure we were able to load the symbols43// HASH: Symtab, file = {{.*}}elf-dynsym.test.tmp.sysv, num_symbols = 2:44// HASH-DAG: undefined45// HASH-DAG: defined46