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: [PATCH] PT_GNU_STACK


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ian Lance Taylor wrote:

> It seems to me that it would be better to indicate this using a DT_
> flag rather than a PT_ segment.

No.  Just look at how the *kernel* loads an ELF binary.  The kernel
never looks at the dynamic section.  The only alternative is an ELF flag
(in e_flags) but that space is too limited and has no OS-specific
reserved bits.  The program header is exactly the right place for this.


> I would suggest a linker option which means ``make the stack
> non-executable unless some input file requires an executable stack.''

That's the whole purpose of the patch.  This is the binutils side.  The
gcc side will hopefully follow.  We need no flag indicating "use
non-exec when possible" since the presence of the note sections
indicates just that.  If all input files have the input it is safe to
add the non-exec flag in the output file.  If the note section is
missing in one or more input files it is not safe and only the user can
overwrite the decision by explicitly specifying the appropriate linker
option.

- -- 
- --------------.                        ,-.            444 Castro Street
Ulrich Drepper \    ,-----------------'   \ Mountain View, CA 94041 USA
Red Hat         `--' drepper at redhat.com `---------------------------
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE+0EoZ2ijCOnn/RHQRAmDVAJ4yh7LXi6KievQo6HwC40/PzlBXuwCfUdEK
XvCgHrd91IrIbwlVA0QYqUs=
=YomL
-----END PGP SIGNATURE-----


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