Defining a section that isn't file-backed

Ian Lance Taylor ian@wasabisystems.com
Thu Feb 26 15:35:00 GMT 2004


Mike Hearn <mike@theoretic.com> writes:

> On Thu, 2004-02-26 at 00:28, Ian Lance Taylor wrote:
> > ELF sections created using the assembler .section pseudo-op are
> > read-only by default.  They only acquire the write flag if you specify
> > it explicitly.
> 
> Does the "a" flag include write as well? If not then I'm not sure why
> the section is being mmapped rwx - are there other factors that can
> influence this?

The "a" flag does not imply write access.

To be careful about terminology, it is the segment which mapped rwx.
objdump -p prints out segments, objdump -h prints out sections.  To
find out why the segment is rwx, you have to look at all the sections
which are being incorporated into the segment.  The linker map file,
generated by -Map, can show you all the input sections being
incorporated into the output section.  Then you need to examine
addresses to see which output sections are being incorporated into the
segment.

Ian



More information about the Binutils mailing list