After http://llvm.org/viewvc/llvm-project?view=revision&revision=281660
linking no works for me, because if first section VA is less than size of headers lld emits fatal error.
However in case we have PHDRS directive it doesn't really have to do so, because with PHDRS we can tell lld not to emit program headers or assign separate segment for them.
This patch does two things:
a) Do not emit fatal error in case hasPhdrsCommands() is true
b) Set elf headers VA to the end of the section, so there are more chances it is valid.
I thought about this new code probably more than 15 minutes but am still not sure if this is correct. What is the problem you are trying to fix with this change?