With the current code if the script has a PHDRS we always obey and try to allocate a header. This can cause Min - HeaderSize to underflow. It looks like bfd actually prints an error for this case. With this patch we do the same. Found while looking at pr36515. llvm-svn: 326441
12 lines
367 B
ArmAsm
12 lines
367 B
ArmAsm
# REQUIRES: x86
|
|
# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
|
|
# RUN: echo "PHDRS { foobar PT_LOAD FILEHDR PHDRS; }" > %t.script
|
|
# RUN: echo "SECTIONS { .text : { *(.text) } : foobar }" >> %t.script
|
|
# RUN: not ld.lld --script %t.script %t.o -o %t 2>&1 | FileCheck %s
|
|
|
|
# CHECK: could not allocate headers
|
|
|
|
.global _start
|
|
_start:
|
|
retq
|