[clang] [Hexagon] Pass -m emulation flag to linker from clang driver (PR #185745)
Fangrui Song via cfe-commits
cfe-commits at lists.llvm.org
Fri Apr 3 00:50:26 PDT 2026
MaskRay wrote:
> > ```
> > $ ld.eld hw.o && llvm-readelf -l -W a.out
> > LOAD **0x001000** 0x00000000 0x00000000 ....
> >
> > $ld.eld -mhexagonlinux hw.o && llvm-readelf -l -W a.out
> > LOAD **0x000000** 0x00000000 0x00000000 ....
> > ```
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > Can we have a switch such as `-z programheader` that linker can consume to selectively load program headers when linker script is not used ?
>
> I think @quic-seaswara was asking @MaskRay here if this was an appropriate solution for consideration by the linkers.
>
> If that works, then I'll update this PR to use that new switch instead.
I am still confused. Can you paste `hw.o` and show the full llvm-readelf -Sl output?
lld's program header allocation logic is at LinkerScript::allocateHeaders in case that helps.
https://github.com/llvm/llvm-project/pull/185745
More information about the cfe-commits
mailing list