blob: cd6bf82b55b81b5d03a51c02802267df4341c725 [file] [log] [blame]
Eugene Leviantbbe38602016-07-19 09:25:43 +00001# REQUIRES: x86
2# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
3# RUN: echo "PHDRS {all PT_LOAD FILEHDR PHDRS ;} \
4# RUN: SECTIONS { \
5# RUN: . = 0x10000200; \
George Rimar215dd472016-08-10 14:02:35 +00006# RUN: .text : {*(.text*)} :all \
Eugene Leviantbbe38602016-07-19 09:25:43 +00007# RUN: .foo : {*(.foo.*)} :all \
8# RUN: .data : {*(.data.*)} :all}" > %t.script
9
10# RUN: ld.lld -o %t1 --script %t.script %t
11# RUN: llvm-readobj -program-headers %t1 | FileCheck %s
12# CHECK: ProgramHeaders [
13# CHECK-NEXT: ProgramHeader {
14# CHECK-NEXT: Type: PT_LOAD (0x1)
15# CHECK-NEXT: Offset: 0x0
16# CHECK-NEXT: VirtualAddress: 0x10000000
17# CHECK-NEXT: PhysicalAddress: 0x10000000
18# CHECK-NEXT: FileSize: 521
19# CHECK-NEXT: MemSize: 521
20# CHECK-NEXT: Flags [ (0x7)
21# CHECK-NEXT: PF_R (0x4)
22# CHECK-NEXT: PF_W (0x2)
23# CHECK-NEXT: PF_X (0x1)
24# CHECK-NEXT: ]
25
26.global _start
27_start:
28 nop
29
30.section .foo.1,"a"
31foo1:
32 .long 0
33
34.section .foo.2,"aw"
35foo2:
36 .long 0