From b4267dfc1083bf61104977bb084660670c583566 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Thu, 1 Mar 2018 02:25:40 +0000 Subject: [PATCH] Expand test a bit. It now includes both linkerscript and non linkerscript variants. Extracted from a patch by Rui while I was trying to figure out what exactly was changing. llvm-svn: 326409 --- lld/test/ELF/note-contiguous.s | 38 +++++++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/lld/test/ELF/note-contiguous.s b/lld/test/ELF/note-contiguous.s index f49d0b6..509b4ec 100644 --- a/lld/test/ELF/note-contiguous.s +++ b/lld/test/ELF/note-contiguous.s @@ -1,24 +1,40 @@ // REQUIRES: x86 // RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o -// RUN: echo "SECTIONS { \ -// RUN: .note : { *(.note.a) *(.note.b) } \ -// RUN: }" > %t.script -// RUN: ld.lld %t.o --script %t.script -o %t -// RUN: llvm-readobj -program-headers %t | FileCheck %s + +// RUN: ld.lld %t.o -o %t1 +// RUN: llvm-readobj -program-headers %t1 | FileCheck %s // CHECK: Type: PT_NOTE -// CHECK-NEXT: Offset: 0x1000 -// CHECK-NEXT: VirtualAddress: 0x0 -// CHECK-NEXT: PhysicalAddress: 0x0 -// CHECK-NEXT: FileSize: 16 -// CHECK-NEXT: MemSize: 16 -// CHECK-NEXT: Flags [ +// CHECK-NEXT: Offset: +// CHECK-NEXT: VirtualAddress: +// CHECK-NEXT: PhysicalAddress: +// CHECK-NEXT: FileSize: 8 +// CHECK-NEXT: MemSize: 8 +// CHECK-NEXT: Flags [ // CHECK-NEXT: PF_R // CHECK-NEXT: ] // CHECK-NEXT: Alignment: 1 +// RUN: echo "SECTIONS { .note : { *(.note.a) *(.note.b) } }" > %t.script +// RUN: ld.lld %t.o --script %t.script -o %t2 +// RUN: llvm-readobj -program-headers %t2 | FileCheck -check-prefix=SCRIPT %s + +// SCRIPT: Type: PT_NOTE +// SCRIPT-NEXT: Offset: +// SCRIPT-NEXT: VirtualAddress: +// SCRIPT-NEXT: PhysicalAddress: +// SCRIPT-NEXT: FileSize: 16 +// SCRIPT-NEXT: MemSize: 16 +// SCRIPT-NEXT: Flags [ +// SCRIPT-NEXT: PF_R +// SCRIPT-NEXT: ] +// SCRIPT-NEXT: Alignment: 1 + .section .note.a, "a", @note .quad 0 +.section .foo, "a" +.quad 0 + .section .note.b, "a", @note .quad 0 -- 2.7.4