why isn't the .eh_frame section marked READONLY?
Richard Henderson
rth@cygnus.com
Tue Jun 2 21:06:00 GMT 1998
On Tue, Jun 02, 1998 at 09:27:49AM -0700, Joe Buck wrote:
> As someone else asked: that explains why it is not readonly when -fPIC
> is provided. But why isn't it readonly if -fPIC is not provided? After
> all, in that same situation the text section is readonly even though it
> contains relocations.
Because in the -shared case, those relocations must be applied
at run time by ld.so.
If the section is marked read-only, this means that _DYNAMIC will
bear a DT_TEXTREL=1 note, which will require two calls to mprotect
to handle properly. In addition, it will dirty what would ordinarily
be read-only pages, instead of sharing those dirty pages with other
read-write data.
All in all, a lose.
r~
More information about the Gcc
mailing list