1# REQUIRES: x86
2# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
3# RUN: echo "PHDRS { foobar PT_LOAD FILEHDR PHDRS; }"  > %t.script
4# RUN: echo "SECTIONS { .text : { *(.text) } : foobar }" >> %t.script
5# RUN: not ld.lld --script %t.script %t.o -o /dev/null 2>&1 | FileCheck %s
6
7# CHECK: could not allocate headers
8
9        .global _start
10_start:
11        retq
12