[LLVMdev] .align 0

Sid Manning sidneym at codeaurora.org
Tue Oct 29 06:05:25 PDT 2013


".align 0" triggers the following error:

a.s:2:8: error: alignment must be a power of 2
.align 0
        ^
In this case would it be reasonable to query the target for a default
or minimum value?  Only targets not implementing this would error out.

Thanks,

On 10/28/2013 03:00 PM, Jim Grosbach wrote:
> Apple’s assembler does use power-of-two for .align. I believe binutils
> does as well. I suspect the header file comment is in error and what’s
> actually happening is that the section in question has a minimum
> alignment on the system(s) in question, and so it just looks like it’s
> redundant. That is, I doubt we need to do anything here.
>
> -Jim
>
> On Oct 28, 2013, at 11:54 AM, Renato Golin <renato.golin at linaro.org
> <mailto:renato.golin at linaro.org>> wrote:
>
>> Hi Sid,
>>
>> It seems Apple's assembler used to treat .align 0 differently:
>>
>> https://developer.apple.com/library/mac/documentation/developertools/Reference/Assembler/040-Assembler_Directives/asm_directives.html
>>
>> If this is still the case, than we should have an option for what to
>> do in this case, maybe defaulting based on the triple?
>>
>> cheers,
>> --renato
>>
>>
>> On 28 October 2013 17:53, Sid Manning <sidneym at codeaurora.org
>> <mailto:sidneym at codeaurora.org>> wrote:
>>
>>
>>     I have several assembly files in a testsuite that use, ".align 0".
>>     I found a reference to, ".align 0" in ARM's elf.h that says .align
>>     0 is redundant and gas treats this as align 2.
>>
>>     Should the llvm-mc follow this convention?
>>
>>     --
>>     Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
>>     hosted by The Linux Foundation
>>     _________________________________________________
>>     LLVM Developers mailing list
>>     LLVMdev at cs.uiuc.edu <mailto:LLVMdev at cs.uiuc.edu>
>>     http://llvm.cs.uiuc.edu <http://llvm.cs.uiuc.edu/>
>>     http://lists.cs.uiuc.edu/__mailman/listinfo/llvmdev
>>     <http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev>
>>
>>
>> _______________________________________________
>> LLVM Developers mailing list
>> LLVMdev at cs.uiuc.edu <mailto:LLVMdev at cs.uiuc.edu> http://llvm.cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>


-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, 
hosted by The Linux Foundation



More information about the llvm-dev mailing list