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


On Sun, Jun 01, 2003 at 05:34:00PM -0400, Andrew Cagney wrote:
> >Hi Andrew,
> >
> >
> >>Wouldn't two note sections work better:
> >>
> >>	if (.note.GNU-stack.rwx)
> >>	  stack read-write-executable
> >>	else if (.note.GNU-stack.rw)
> >>	  stack read-write
> 
> Having empty sections would let binutils ignore the problem entirely. 
> Instead it could just pass the sections through.

That's not true. If ld doesn't handle them specially
during ld -r and final link, then there is no way to differentiate between
all input files .note.GNU-stack.rw and some input files .note.GNU-stack.rw
and some input files without any note section (in the former case
non-exec stack can be used, in the latter case most probably shouldn't,
as no assumptions can be made on whether the remaining objects need
or don't need exec stack).
Another thing is efficiency. If there is more than one PT_ segment for this
stack or if kernel/ld.so has to read some segment and analyze it to find
out whether exec stack is needed or not, it means more runtime overhead.
And IMHO the default should be clear from what the ABI allows or doesn't
allow. If say i?86-*-linux* so far could assume executable stack, then the
default for old .o files must be executable stack.

	Jakub


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