Why can a section be mapped to multiple segments?

Alan Modra amodra@gmail.com
Wed May 5 02:30:07 GMT 2021


On Tue, May 04, 2021 at 07:07:26PM -0500, Peng Yu via Binutils wrote:
> Hi,
> 
> I see .tdata is mapped to multiple segments. Why a section can be
> mapped to multiple segments? Isn't that it is sufficient to map a
> section to a segment once so that when the program run, the program
> can access the data in the section? Thanks.

It is sufficient to map a section to one PT_LOAD header in order for
that section to be loaded into memory, but there are other program
header types with meaning differing from "load this segment".

You can find the meaning of other header types by doing web searches,
looking at the source, or finding the mailing list posts where those
header type were first introduced into binutils and glibc.

-- 
Alan Modra
Australia Development Lab, IBM


More information about the Binutils mailing list