[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gcl-devel] plt.c and Mach-O ABI
From: |
Camm Maguire |
Subject: |
Re: [Gcl-devel] plt.c and Mach-O ABI |
Date: |
28 Feb 2004 15:20:02 -0500 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 |
Hi Aurelien!
Would you have time to check what if any problems you have with the
latest binutils ld?
We can configure #idef this file in, but ...
Do you have suggestions for portable ways of achieving this end?
Take care,
Aurelien Chanudet <address@hidden> writes:
> Just a quick note. Nothing really worth Camm's attention here as I
> understand that the plt trick is a temporary solution.
>
> In the Mach-O ABI, the gcc prepends a leading underscore to any C
> symbol name (however, symbols declared in raw assembler don't get this
> leading underscore prepended). The real symbol name is the one with
> the leading underscore (i.e. the mangled one). This means for instance
> that it's not possible to use nm output to declare C function
> prototypes without further parsing.
>
> Here is what I get on Debian :
>
> address@hidden:/tmp$ uname -a
> Linux aljunied 2.4.18-newpmac #1 Thu Mar 14 22:44:49 EST 2002 ppc
> unknown
> address@hidden:/tmp$ cat toto.c
> #include <stdio.h>
> int main ()
> {
> printf ("hello, world!\n");
> exit (0);
> return 0;
> }
> address@hidden:/tmp$ gcc -c toto.c
> address@hidden:/tmp$ nm toto.o
> U exit
> 00000000 t gcc2_compiled.
> 00000000 T main
> U printf
> address@hidden:/tmp$ exit
> logout
>
>
> And here is what I get on Darwin :
>
> -bash2.05b /tmp $ uname -a
> Darwin sabine.local 7.2.0 Darwin Kernel Version 7.2.0: Thu Dec 11
> 16:20:23 PST 2003; root:xnu/xnu-517.3.7.obj~1/RELEASE_PPC Power
> Macintosh powerpc
> -bash2.05b /tmp $ cat toto.c
> #include <stdio.h>
> int main ()
> {
> printf ("hello, world!\n");
> exit (0);
> return 0;
> }
> -bash2.05b /tmp $ gcc -c toto.c
> -bash2.05b /tmp $ nm toto.o
> U _exit
> 00000000 T _main
> U _printf
> U dyld_stub_binding_helper
>
>
> Note the difference in the way symbol names are mangled. I've tried to
> unravel the logic in plt.c, but I cannot compile it as such. Anyway,
> I'm not sure I need this file plt.o due to substantial differences in
> the ELF and Mach-O linking semantics.
>
> Aurelien
>
>
>
> _______________________________________________
> Gcl-devel mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/gcl-devel
>
>
>
--
Camm Maguire address@hidden
==========================================================================
"The earth is but one country, and mankind its citizens." -- Baha'u'llah