forked from OSchip/llvm-project
parent
67ef3b984a
commit
d8b81d6663
|
@ -706,8 +706,10 @@ void LinkerScript<ELFT>::assignAddresses(std::vector<PhdrEntry<ELFT>> &Phdrs) {
|
|||
std::find_if(Phdrs.begin(), Phdrs.end(), [](const PhdrEntry<ELFT> &E) {
|
||||
return E.H.p_type == PT_LOAD;
|
||||
});
|
||||
if (FirstPTLoad == Phdrs.end())
|
||||
return;
|
||||
|
||||
if (HeaderSize <= MinVA && FirstPTLoad != Phdrs.end()) {
|
||||
if (HeaderSize <= MinVA) {
|
||||
// If linker script specifies program headers and first PT_LOAD doesn't
|
||||
// have both PHDRS and FILEHDR attributes then do nothing
|
||||
if (!Opt.PhdrsCommands.empty()) {
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
# REQUIRES: x86
|
||||
# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
|
||||
# RUN: echo "PHDRS {foo PT_DYNAMIC ;} " \
|
||||
# RUN: "SECTIONS { .text : { *(.text) } : foo }" > %t.script
|
||||
# RUN: ld.lld -o %t1 --script %t.script %t.o
|
Loading…
Reference in New Issue