|
From: | Nick Clifton |
Subject: | Re: [Bug ld/12565] NOLOAD sections empty |
Date: | Fri, 01 Jul 2011 14:09:55 +0100 |
User-agent: | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc15 Thunderbird/3.1.10 |
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
[Prev in Thread] | Current Thread | [Next in Thread] |