This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Need help on OVERLAY command in linker script...
Hi, Jie
> Hi Tao,
>
> > I changed the name of the original first .text section, then I got overlay
> > sections. But the "not enough room for program headers" problem is still
> > there.
>
> It is caused by the OVERLAY command. I used to solve this problem by
> replace SIZEOF_HEADERS with a reasonable large number. However, I think
> using PHDRS command is better for your problem. See the words about
> SIZEOF_HEADERS in the ld documentation for more information.
>
Thanks for the suggestion. I am using PHDRS command now and it looks
working, although I don't fully understand yet. So I guess if I don't use
PHDRS command and explicitly tell the linker which program headers to
create and which section should be put into which segment, then the linker
will try to create a new program header / segment for my overlay
sections? Why does it do that particularly to overlay sections rather than
picking up an existing one?
Thanks
Tao