llvm-project/lld/test/elf/sections.objtxt
Michael J. Spencer 1ac382f0c5 [ELF] Emit the file header and program headers at the beginning of the first segment.
This is required for the loader to correctly set AT_PHDR.

With this lld can correctly link against dietlibc and get to main.

llvm-svn: 171709
2013-01-07 08:00:04 +00:00

36 lines
1.3 KiB
Plaintext

RUN: lld-core -reader ELF -writer ELF -o %t1 %p/Inputs/section-test.i386
RUN: llvm-objdump -section-headers %t1 | FileCheck -check-prefix=OBJDUMP %s
RUN: llvm-readobj %t1 | FileCheck -check-prefix=READOBJ %s
RUN: elf-dump --dump-section %t1 | FileCheck -check-prefix=ED %s
OBJDUMP: 0 000000000 00000000000000000
OBJDUMP: 1 .text 00000000a 00000000000000074 TEXT DATA
OBJDUMP: 2 .data 000000004 00000000000001000 DATA
OBJDUMP: 3 .special 000000004 00000000000001004 DATA
OBJDUMP: 4 .anotherspecial 000000004 00000000000001008 DATA
OBJDUMP: 5 .bss 000000001 0000000000000100c BSS
OBJDUMP: 6 .shstrtab 000000045 00000000000000000
OBJDUMP: 7 .symtab 0000000c0 00000000000000000
OBJDUMP: 8 .strtab 00000003b 00000000000000000
READOBJ: File Format : ELF32-i386
READOBJ: Arch : i386
READOBJ: Address Size: 32 bits
READOBJ: Symbols
READOBJ: baz FUNC 74 a e8 global
READOBJ: y DATA 1004 4 2008 global
ED: 'e_indent[EI_DATA]', 0x01
ED: 'e_machine', 0x0003
ED: Section 1
ED: 'sh_addralign', 0x00000004
ED: Section 2
ED: 'sh_addralign', 0x00000004
ED: Section 6
ED: 'sh_link', 0x00000000
ED: 'sh_addralign', 0x00000001
ED: Section 7
ED: 'sh_link', 0x00000008
ED: 'sh_addralign', 0x00000008
ED: 'sh_entsize', 0x00000010