This is the mail archive of the
mailing list for the GCC project.
Re: Strict aliasing and pointers to functions
- From: Perry Smith <pedz at easesoftware dot com>
- To: av1474 at comtv dot ru
- Cc: gcc-help at gcc dot gnu dot org
- Date: Sat, 25 Nov 2006 19:30:30 -0600
- Subject: Re: Strict aliasing and pointers to functions
- References: <Pine.LNX.email@example.com>
On Nov 25, 2006, at 7:12 PM, firstname.lastname@example.org wrote:
*(void **) (char **) (void *) &funcs.dummy = dlsym (NULL,
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.
Perry Smith ( email@example.com )
Ease Software, Inc. ( http://www.easesoftware.com )
Low cost SATA Disk Systems for IBMs p5, pSeries, and RS/6000 AIX systems