Re: CFBundleGetFunctionPointerForName
Re: CFBundleGetFunctionPointerForName
- Subject: Re: CFBundleGetFunctionPointerForName
- From: Alastair Houghton <email@hidden>
- Date: Fri, 14 Mar 2008 11:38:31 +0000
On 14 Mar 2008, at 09:05, Steve Checkoway wrote:
On Mar 13, 2008, at 11:57 AM, Chris Espinosa wrote:
The C and C++ standards are silent on these issues, but the
underscore conventions are industrywide.
Chris is quite correct; the underscore is the most common symbol
prefix character.
I guess the only platforms I checked were PPC mac, PPC linux, x86
mac, x86 linux (and of course just one distro of linux each). Both
mac prepend an underscore, and neither linux (ubuntu for ppc and
fedora for x86) did. Someone is now telling me that Windows doesn't
use the prefix, but this isn't something I can check myself.
AFAIK Windows is a total mess in this respect, because of the entirely
separate symbol namespace used by DLLs (which is nothing to do with
the normal symbol table). From memory (it's been a while since I
wrote a Windows program :-)), underscores are used for normal object
files, but not for DLL symbols, though the other name mangling that
Microsoft does for Pascal and register calling conventions still
happens.
As for assembly issues, it seems that the two gcc assemblers for x86
I tried, Apple's and FSF's use % for register prefixes.
That's because they're using AT&T syntax, not Intel syntax. (The FSF
assembler does this on MC68K too.)
The standard Intel syntax, which is supported by nasm (which you also
get with Mac OS X) as well as being the inline syntax for CodeWarrior-
style inline assembler (AFAIK) doesn't prefix registers, and since you
can use symbols *and* registers in many places in the syntax, there's
ambiguity, hence the underscores.
I'm not sure if there is any case with ppc where it would be
ambiguous, but ibm's examples for assembly don't include the r
prefix for registers <http://www.ibm.com/developerworks/linux/library/l-ppc/
> that Apple's does so there really can't be any confusion. FSF's
gcc follows ibm.
I don't think there is any ambiguity in the PPC instruction set;
making a symbol called "r5" seems eminently possible, albeit an
extremely bad idea, for hopefully obvious reasons:
mac-pro:~ alastair$ as -arch ppc
li r3,4
r3: b r3
mac-pro:~ alastair$ otool -t -V a.out
a.out:
(__TEXT,__text) section
00000000 li r3,r3
r3:
00000004 b r3
Kind regards,
Alastair.
--
http://alastairs-place.net
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden