This is the mail archive of the cygwin-apps@cygwin.com mailing list for the Cygwin 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: .rdata section in Cygwin executables?


Joe Buehler wrote:
The emacs recompile fails because there is a section in
the initially built emacs.exe named ".rdata" that the
unexec() code for Cygwin is not expecting.  The section
appears to have something to do with exception handling
and is only 1k in size.

.rdata is a section where read-only data, such as constants, is stored.
Most modern OSes and toolchain try to put as much info as possible to
read-only segments of binary image because it reduce memory required by
programs to run (when program is fork()ed, for instance, read-only pages may be shared between processes)


On linux such section is called .rodata, so probably you can take a look how linux version of emacs deals with that.

I'm reading up on this at the moment, but a couple
questions occur to me that someone here might be able
to answer off the top of their head:

- can .rdata just be combined with the preceeding .data
  section?

It's possible, but it's not the Right Way (tm).


- perhaps there is a way to do this with the linker so
  I don't have to change the emacs unexec() code?

You may write your own linker script so that all rdata section will be put to .data when emacs.exe is linked, but again, it doesn't look as the proper way to deal with the problem.


egor.


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