This is the mail archive of the cygwin 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: cygwin, libtool, dlpreopen, and .rdata

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: Problem reports: Documentation: FAQ:

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