On 9-ago-10, at 22:08, Walter Bright wrote:
Fawzi Mohamed wrote:
On 9-ago-10, at 16:29, Fawzi Mohamed wrote:
[...]
Yes osx needs position independent code, I have tried to replace
D_PIC with IS_PIC and add
from experimenting with gdc and the atomic module I remember that I
had to completly free up ebx, as it holds the Position-independent
code base register.
Even pushing & popping it would not satisfy the gdc compiler (not
sure why, maybe becuase signal handlers might need it?)
In any case the abi is here
http://developer.apple.com/mac/library/documentation/DeveloperTools/Conceptual/LowLevelABI/130-IA-32_Function_Calling_Conventions/IA32.html#/
/apple_ref/doc/uid/TP40002492-SW4
The EBX must be preserved across function calls. That's the only
restriction on its use. Whether within a function it is used as a
base register or not is relevant only to that function, and is not
part of the ABI.
dmd regenerates the base register contents as required.
ok good, I just know that gdc (actually the underlying asm backend)
did not allow any change to the EBX, which I found surprising, becuase
if one doesn't perform any call or access globals I though safe to
clobber the global offset table...
As gcc/gdc did not allow it I wondered if there were hidden pitfalls
into it...
_______________________________________________
dmd-beta mailing list
[email protected]
http://lists.puremagic.com/mailman/listinfo/dmd-beta