blob: c79ba6e02c347e2a5a8c584c7b32ca56109382e9 [file] [log] [blame]
Ed Maste6556aa62018-05-10 11:12:18 +00001// REQUIRES: x86
George Rimar6b380182018-05-10 13:45:34 +00002// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
Ed Maste6556aa62018-05-10 11:12:18 +00003// RUN: ld.lld %t.o -o %t -shared
4// RUN: llvm-readobj -program-headers -sections %t | FileCheck %s
5
George Rimar6b380182018-05-10 13:45:34 +00006// PR37361: A note without SHF_ALLOC should not be included into a PT_NOTE program header.
Ed Maste6556aa62018-05-10 11:12:18 +00007
George Rimar6b380182018-05-10 13:45:34 +00008// CHECK: Section {
9// CHECK: Index:
10// CHECK: Name: .note.a
11// CHECK-NEXT: Type: SHT_NOTE
12// CHECK-NEXT: Flags [
13// CHECK-NEXT: SHF_ALLOC
14// CHECK-NEXT: ]
15// CHECK-NEXT: Address: 0x[[ADDR:.*]]
Ed Maste6556aa62018-05-10 11:12:18 +000016
George Rimar6b380182018-05-10 13:45:34 +000017// Check we still emit the non-alloc SHT_NOTE section and keep its type.
Ed Maste6556aa62018-05-10 11:12:18 +000018
George Rimar6b380182018-05-10 13:45:34 +000019// CHECK: Name: .note.b
20// CHECK-NEXT: Type: SHT_NOTE
21// CHECK-NEXT: Flags [
22// CHECK-NEXT: ]
Ed Maste6556aa62018-05-10 11:12:18 +000023
George Rimar6b380182018-05-10 13:45:34 +000024// CHECK: ProgramHeader {
25// CHECK: Type: PT_NOTE
26// CHECK-NEXT: Offset:
27// CHECK-NEXT: VirtualAddress: 0x[[ADDR]]
28// CHECK-NEXT: PhysicalAddress: 0x245
29// CHECK-NEXT: FileSize: 16
30// CHECK-NEXT: MemSize: 16
31// CHECK-NOT: PT_NOTE
32
33.section .note.a,"a",@note
34.quad 1
35.quad 2
36
37.section .note.b,"",@note
38.quad 3