[edk2-devel] [edk2-test PATCH v1 2/2] SctPkg: Enable RISCV64 support using AARCH64 sources

Daniel Schaefer daniel.schaefer at hpe.com
Tue Feb 9 15:11:18 UTC 2021


On 2/9/21 10:58 PM, Leif Lindholm wrote:
> On Tue, Feb 09, 2021 at 14:47:46 +0100, Heinrich Schuchardt wrote:
>>>>> I have no idea why the alignment would be 3 on other platforms, so I
>>>>> don't know how to fix it.
>>>>> If anyone knows more, please let me know. I'll just change the comment
>>>>> to say Riscv64.
>>>>>
>>>>>>> +.align 3
>>>>
>>>> Both on Aarch64 and on RISC-V an odd alignment value makes no sense.
>>>>
>>>> .align 8 should do no harm. But is it needed?

No idea why it was added for Arm and Aarch64 copied it.
It's not there for the other architectures. Let's remove it.

>>> The glory of the GAS .align directive is that its meaning differs
>>> between architectures and executable formats. On ARM/AArch64, as well
>>> as on RISC-V (I think?) the alignment is described as a power of 2.
>>>
>>> So .align 3 on ARM and others are the same as .align 8 on x86 (ELF)
>>> and others.
>>>
>>> (It might not be a bad idea to start replacing .align directives with
>>> .baligh to reduce confusion.)
>>
>> Thanks for pointing out the different meanings of .align. They are
>> documented in binutils-2.36/gas/doc/as.info chapter 7.3.
>>
>> .balign is GNU assembler specific.
>>
>> Do we have to consider other assemblers here?
> 
> I don't think so.
> The GNU family of toolchains are the only ones using .s/.S sources.
> Unless there are GNU-compatible assemblers that don't support the
> directive.
> 
> Visual Studio uses .asm on ARM* and .nasm on x86.
> 
> /
>      Leif
> 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71525): https://edk2.groups.io/g/devel/message/71525
Mute This Topic: https://groups.io/mt/78637307/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-





More information about the edk2-devel-archive mailing list