This is the mail archive of the gcc-help@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]
Other format: [Raw text]

Re: Strict aliasing and pointers to functions


On Nov 25, 2006, at 7:12 PM, av1474@comtv.ru wrote:
*(void **) (char **) (void *) &funcs.dummy = dlsym (NULL, "dummy");

I don't think this has anything to do with the compiler. dlsym is returning null. It did not find dummy.


It may be that dummy is called something else: _dummy or .dummy

It might also be that dummy is not obviously referenced so the linker optimized it completely away. Look at the nm output of your code to see if it is in the final executable.

Or, you can put a call to dummy (and for testing purposes, I'd make dummy call out to something like printf, just in case), and then see if it works.

Also, in the man page I found via google for dlsym, it does not say that passing NULL as the first argument is valid. Maybe its valid on the i386 implementation but not on the PPC implementation.

Good luck,
Perry Smith ( pedz@easesoftware.com )
Ease Software, Inc. ( http://www.easesoftware.com )

Low cost SATA Disk Systems for IBMs p5, pSeries, and RS/6000 AIX systems



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