From b5f1fa3e5c1503137c63d5eab1bd213dea706041 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Sun, 28 Nov 2021 18:33:55 -0800 Subject: [PATCH] [ELF][test] --oformat binary: Check that SIZEOF_HEADERS==0 --- lld/test/ELF/oformat-binary.s | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lld/test/ELF/oformat-binary.s b/lld/test/ELF/oformat-binary.s index 708a5dd4acbb..4b2ad8ec711f 100644 --- a/lld/test/ELF/oformat-binary.s +++ b/lld/test/ELF/oformat-binary.s @@ -30,7 +30,8 @@ # RUN: od -t x1 %tempty | FileCheck %s ## NOBITS sections are ignored as well. -# RUN: echo 'SECTIONS { .text : {*(.text .mysec*)} .data 0x100 (NOLOAD) : {BYTE(0)}}' > %tnobits.lds +## Also test that SIZEOF_HEADERS evaluates to 0. +# RUN: echo 'SECTIONS { .text : {. += SIZEOF_HEADERS; *(.text .mysec*)} .data 0x100 (NOLOAD) : {BYTE(0)}}' > %tnobits.lds # RUN: ld.lld -T %tnobits.lds %t --oformat binary -o %tnobits # RUN: od -t x1 %tnobits | FileCheck %s