2015-09-18 03:58:07 +08:00
|
|
|
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
|
2015-11-18 14:11:01 +08:00
|
|
|
# RUN: ld.lld %t -o %t2
|
2015-09-18 05:19:56 +08:00
|
|
|
# RUN: llvm-readobj -sections -program-headers %t2 | FileCheck %s
|
2015-09-18 03:58:07 +08:00
|
|
|
# REQUIRES: x86
|
|
|
|
|
|
|
|
# Check that different output sections with the same flags are merged into a
|
|
|
|
# single Read/Write PT_LOAD.
|
|
|
|
|
|
|
|
.section .r,"a"
|
|
|
|
.globl _start
|
|
|
|
_start:
|
|
|
|
.quad 0
|
|
|
|
|
|
|
|
.section .a,"aw"
|
|
|
|
.quad 1
|
|
|
|
|
|
|
|
.section .b,"aw"
|
|
|
|
.quad 2
|
|
|
|
|
2015-09-18 05:19:56 +08:00
|
|
|
# CHECK: Name: .r
|
|
|
|
# CHECK-NEXT: Type: SHT_PROGBITS
|
|
|
|
# CHECK-NEXT: Flags [
|
|
|
|
# CHECK-NEXT: SHF_ALLOC
|
|
|
|
# CHECK-NEXT: ]
|
|
|
|
# CHECK-NEXT: Address:
|
2015-11-25 02:48:16 +08:00
|
|
|
# CHECK-NEXT: Offset: 0x158
|
2015-09-18 05:19:56 +08:00
|
|
|
# CHECK-NEXT: Size:
|
|
|
|
# CHECK-NEXT: Link:
|
|
|
|
# CHECK-NEXT: Info:
|
|
|
|
# CHECK-NEXT: AddressAlignment:
|
|
|
|
# CHECK-NEXT: EntrySize:
|
|
|
|
# CHECK-NEXT: }
|
|
|
|
|
2015-09-18 03:58:07 +08:00
|
|
|
# CHECK: ProgramHeaders [
|
|
|
|
# CHECK-NEXT: ProgramHeader {
|
2015-10-09 23:31:49 +08:00
|
|
|
# CHECK-NEXT: Type: PT_PHDR (0x6)
|
|
|
|
# CHECK-NEXT: Offset: 0x40
|
|
|
|
# CHECK-NEXT: VirtualAddress: 0x10040
|
|
|
|
# CHECK-NEXT: PhysicalAddress: 0x10040
|
2015-11-25 02:48:16 +08:00
|
|
|
# CHECK-NEXT: FileSize: 280
|
|
|
|
# CHECK-NEXT: MemSize: 280
|
2015-10-09 23:31:49 +08:00
|
|
|
# CHECK-NEXT: Flags [ (0x4)
|
|
|
|
# CHECK-NEXT: PF_R (0x4)
|
|
|
|
# CHECK-NEXT: ]
|
|
|
|
# CHECK-NEXT: Alignment: 8
|
|
|
|
# CHECK-NEXT: }
|
|
|
|
# CHECK-NEXT: ProgramHeader {
|
2015-09-18 03:58:07 +08:00
|
|
|
# CHECK-NEXT: Type: PT_LOAD
|
|
|
|
# CHECK-NEXT: Offset: 0x0
|
|
|
|
# CHECK-NEXT: VirtualAddress:
|
|
|
|
# CHECK-NEXT: PhysicalAddress:
|
2015-11-25 02:48:16 +08:00
|
|
|
# CHECK-NEXT: FileSize: 352
|
|
|
|
# CHECK-NEXT: MemSize: 352
|
2015-09-18 03:58:07 +08:00
|
|
|
# CHECK-NEXT: Flags [
|
|
|
|
# CHECK-NEXT: PF_R
|
|
|
|
# CHECK-NEXT: ]
|
|
|
|
# CHECK-NEXT: Alignment:
|
|
|
|
# CHECK-NEXT: }
|
|
|
|
# CHECK-NEXT: ProgramHeader {
|
|
|
|
# CHECK-NEXT: Type: PT_LOAD
|
|
|
|
# CHECK-NEXT: Offset:
|
|
|
|
# CHECK-NEXT: VirtualAddress:
|
|
|
|
# CHECK-NEXT: PhysicalAddress:
|
2015-11-04 06:08:08 +08:00
|
|
|
# CHECK-NEXT: FileSize: 0
|
|
|
|
# CHECK-NEXT: MemSize: 0
|
|
|
|
# CHECK-NEXT: Flags [
|
|
|
|
# CHECK-NEXT: PF_R
|
|
|
|
# CHECK-NEXT: PF_X
|
|
|
|
# CHECK-NEXT: ]
|
|
|
|
# CHECK-NEXT: Alignment:
|
|
|
|
# CHECK-NEXT: }
|
|
|
|
# CHECK-NEXT: ProgramHeader {
|
|
|
|
# CHECK-NEXT: Type: PT_LOAD
|
|
|
|
# CHECK-NEXT: Offset:
|
|
|
|
# CHECK-NEXT: VirtualAddress:
|
|
|
|
# CHECK-NEXT: PhysicalAddress:
|
2015-09-18 03:58:07 +08:00
|
|
|
# CHECK-NEXT: FileSize: 16
|
|
|
|
# CHECK-NEXT: MemSize: 16
|
|
|
|
# CHECK-NEXT: Flags [
|
|
|
|
# CHECK-NEXT: PF_R
|
|
|
|
# CHECK-NEXT: PF_W
|
|
|
|
# CHECK-NEXT: ]
|
|
|
|
# CHECK-NEXT: Alignment:
|
|
|
|
# CHECK-NEXT: }
|
2015-11-25 02:48:16 +08:00
|
|
|
# CHECK-NEXT: ProgramHeader {
|
|
|
|
# CHECK-NEXT: Type: PT_GNU_STACK
|
|
|
|
# CHECK-NEXT: Offset: 0x0
|
|
|
|
# CHECK-NEXT: VirtualAddress: 0x0
|
|
|
|
# CHECK-NEXT: PhysicalAddress: 0x0
|
|
|
|
# CHECK-NEXT: FileSize: 0
|
|
|
|
# CHECK-NEXT: MemSize: 0
|
|
|
|
# CHECK-NEXT: Flags [
|
|
|
|
# CHECK-NEXT: PF_R
|
|
|
|
# CHECK-NEXT: PF_W
|
|
|
|
# CHECK-NEXT: ]
|
|
|
|
# CHECK-NEXT: Alignment: 0
|
|
|
|
# CHECK-NEXT: }
|
2015-09-18 03:58:07 +08:00
|
|
|
# CHECK-NEXT: ]
|