HomeFreeBSD

lld: Put the header in the first PT_LOAD even if that PT_LOAD has a LMAExpr

Description

lld: Put the header in the first PT_LOAD even if that PT_LOAD has a LMAExpr

The root problem is that we were creating a PT_LOAD just for the header.
That was technically valid, but inconvenient: we should not be making
the ELF discontinuous.

The solution is to allow a section with LMAExpr to be added to a PT_LOAD
if that PT_LOAD doesn't already have a LMAExpr.

LLVM PR: 36017
Obtained from: LLVM r323625 by Rafael Espindola

Details

Provenance
emasteAuthored on
Parents
rS328547: lld: Move LMAOffset from the OutputSection to the PhdrEntry. NFC.
Branches
Unknown
Tags
Unknown