Files
clang-p2996/lld/test/ELF/nmagic.s
Fangrui Song e8c0d93360 [ELF] nmagic or omagic: don't allocate PT_PHDR or PF_R PT_LOAD for the !hasPhdrsCommands case
```
part.phdrs = script->hasPhdrsCommands() ? script->createPhdrs() : createPhdrs(part);
```

createPhdrs() allocates a PT_PHDR and a PF_R PT_LOAD, which will be
deleted later in LinkerScript::allocateHeaders, but leave a gap between
the program headers and the first section. Don't allocate the segments
to avoid the gap. PT_INTERP is likely not needed as well.

Reviewed By: ruiu

Differential Revision: https://reviews.llvm.org/D67324

llvm-svn: 371398
2019-09-09 13:08:51 +00:00

24 lines
800 B
ArmAsm

# REQUIRES: x86
# Verify that .rodata is aligned to a 8 byte boundary.
# RUN: llvm-mc -filetype=obj -triple=i386 %s -o %t.o
# RUN: ld.lld %t.o -o %t.exe -n -Ttext 0
# RUN: llvm-readelf --section-headers %t.exe | FileCheck %s
# CHECK: [ 0] NULL 00000000 000000 000000 00 0 0 0
# CHECK: [ 1] .text PROGBITS 00000000 000094 000001 00 AX 0 0 4
# CHECK: [ 2] .rodata PROGBITS 00000008 000098 000008 00 A 0 0 8
# CHECK: [ 3] .comment PROGBITS 00000000 0000a0 000008 01 MS 0 0 1
# CHECK: [ 4] .symtab SYMTAB 00000000 0000a8 000020 10 6 1 4
# CHECK: [ 5] .shstrtab STRTAB 00000000 0000c8 000032 00 0 0 1
# CHECK: [ 6] .strtab STRTAB 00000000 0000fa 000008 00 0 0 1
.globl _start
.text
_start:
ret
.rodata
.align 8
.quad 42