39 lines · plain
1// REQUIRES: x862// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o3// RUN: ld.lld %t.o -o %t -shared4// RUN: llvm-readobj -l --sections %t | FileCheck %s5 6// PR37361: A note without SHF_ALLOC should not be included into a PT_NOTE program header.7 8// CHECK: Section {9// CHECK: Index:10// CHECK: Name: .note.a11// CHECK-NEXT: Type: SHT_NOTE12// CHECK-NEXT: Flags [13// CHECK-NEXT: SHF_ALLOC14// CHECK-NEXT: ]15// CHECK-NEXT: Address: 0x[[ADDR:.*]]16 17// Check we still emit the non-alloc SHT_NOTE section and keep its type.18 19// CHECK: Name: .note.b20// CHECK-NEXT: Type: SHT_NOTE21// CHECK-NEXT: Flags [22// CHECK-NEXT: ]23 24// CHECK: ProgramHeader {25// CHECK: Type: PT_NOTE26// CHECK-NEXT: Offset:27// CHECK-NEXT: VirtualAddress: 0x[[ADDR]]28// CHECK-NEXT: PhysicalAddress: 0x[[ADDR]]29// CHECK-NEXT: FileSize: 1630// CHECK-NEXT: MemSize: 1631// CHECK-NOT: PT_NOTE32 33.section .note.a,"a",@note34.quad 135.quad 236 37.section .note.b,"",@note38.quad 339