This is the mail archive of the libffi-discuss@sourceware.org mailing list for the libffi project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: please, help me with libffi on iOS porting


On 08/15/2012 03:30 AM, cowwoc wrote:
> 
> Andrew Haley wrote:
>>
>>> to have 4 bytes alignment.  So is there a reason the alignment is
>>> set to 1 byte?
>>
>> The doc says:
>>
>> `.align EXPRESSION [, EXPRESSION]'
>>      This is the generic .ALIGN directive.  For the ARM however if the
>>      first argument is zero (ie no alignment is needed) the assembler
>>      will behave as if the argument had been 2 (ie pad to the next four
>>      byte boundary).  This is for compatibility with ARM's own
>>      assembler.
>>
> 
> I believe you are wrong on this point.

I'm not: that is what it says.

> GNU Assembler says this:
> http://sourceware.org/binutils/docs/as/ARM-Directives.html
> 
> but Apple Assembler does not:
> https://developer.apple.com/library/mac/#documentation/developertools/Reference/Assembler/040-Assembler_Directives/asm_directives.html
> 
> hence the generated memory alignment is wrong.

Right, so Apple's assembler is incompatible.  The align_expression
doesn't seem to be optional there, so we could simply change this to
.align 2".

Andrew.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]