Hi Ian,
If you look in the libgloss linker scripts you will see a bunch of uses
of NOLOAD.
I'm not sure whether any of them are really necessary, but they are
certainly there.
Apart from a few .bss sections and one target which uses them to get the
addresses of its hardware I/O ports, all of the rest are for debugging
sections. Which brings us back to the original point of this PR. In
theory it makes sense to mark debug sections as NOLOAD, since you do not
need them in the running executable. But, for ELF based targets, this
must not be done because NOLOAD will also obliterate their contents on disk.
Maybe we need a new ELF section type, eg SHT_GNU_NOLOAD, which can be
used to mark sections which *do* have contents on disk but which should
not be loaded into running memory. Or maybe we could use SHT_NOTE instead.
At the moment the linker identifies debugging sections by their name and
arranges for them to be excluded from any loadable segments. But it
would be much cleaner if we could just examine the section type and if
it was SHT_GNU_NOLOAD then decide not to map it to a loadable segment.
Cheers
Nick
_______________________________________________
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils