This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Defining a section that isn't file-backed


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]