This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


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

Re: why isn't the .eh_frame section marked READONLY?


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~


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