On Jan 9, 2013, at 9:17 AM, Joel Reymont <joe...@gmail.com> wrote:

> Tech Note 2239 refers to 64-bit register details in Listing 10,
> Objective-C runtime 'secrets'. These details can be found here
> 
> http://developer.apple.com/library/mac/#technotes/tn2124/_index.html
> 
> It should be straightforward to translate to ARM and LLDB now.

One cannot blithely translate calling conventions into the terms of another 
architecture and expect things to always work.

The previous link you provided covers the simple case of four register-sized 
arguments. It doesn't cover a bunch of other important cases:

- Function calls with more than 4 arguments
- Floating-point arguments
- Aggregate (struct) or larger-than-register-size arguments
- Functions with variable arguments
- Functions that return floats or structs or other non-register-sized types

OS X follows the AMD64 Unix ABI, which defines the calling convention for these 
kinds of function calls in ways that don't necessarily map to ARM processors in 
use on iOS devices.

The standard ARM calling convention can be found here: 
http://infocenter.arm.com/help/topic/com.arm.doc.ihi0042e/IHI0042E_aapcs.pdf#page15

Sadly I can't find anything on the iOS Dev Center that assures me that iOS 
obeys the standard calling convention. This concern is real; for example, 
Windows does not obey the AMD64 calling convention on x86-64.

--Kyle Sluder
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to