cygwin, libtool, dlpreopen, and .rdata
Shankar Unni
shankarunni@netscape.net
Thu Sep 23 17:15:00 GMT 2004
Charles Wilson wrote:
> Actually, *function* addresses are fine; they don't get relocated (at
> least, not by the runtime-pseudo-reloc gobbledygook). It's only the
> addresses of DATA items exported by DLLs that get relocated in this way.
>
> AND, they get relocated IF AND ONLY IF you are linking to a DLL.
On x86/PE, anyway. The rules for other platforms and object-file formats
vary.
Leaving this as "implementation-defined" (may or may not work -
documented, but how easy is it to track down this documentation?) makes
the programmer's task more difficult - they can never be sure where they
can use 'const' on an initialized structure definition. What if function
addresses are also 'bad' on some other platform?
Gcc should either warn about this usage, or it should silently "do the
right thing" on each platform based on its capabilities.
But I'm just being picky, being an old compiler fart..
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
More information about the Cygwin
mailing list