Re: Callling clib from assembly language
Re: Callling clib from assembly language
- Subject: Re: Callling clib from assembly language
- From: Jonas Maebe <email@hidden>
- Date: Mon, 17 Apr 2006 13:46:16 +0200
On 17 Apr 2006, at 13:31, David N. Williams wrote:
That's a fine way to do it for non-PIC executables.
Your code is identical to the following when compiled under GCC
with -mdynamic-no-pic:
#include <math.h>
static double (*mysqrtptr)(double) = sqrt;
double mysqrt(double d)
{
return mysqrtptr(d);
}
Many thanks, Matt, that's good to know! In this case, it
appears I'm doing the right thing.
A downside is that you're getting code bloat this way, by having the
call stub inside the code itself. If you so it exactly like gcc (with
the stubs in their own section), then the linker will merge all stubs
together (also from other objects calling these procedures) so that
only one instance is left in the final binary (at least as long as
all can be reached by the branches referring to it).
Jonas
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden