Re: [edk2-test PATCH v1 2/2] SctPkg: Enable RISCV64 support using AARCH64 sources
On 09.02.21 13:42, Leif Lindholm wrote:
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?
Best regards
Heinrich
On Mon, Feb 08, 2021 at 18:04:45 +0100, Heinrich Schuchardt wrote:Thanks for pointing out the different meanings of .align. They areThe glory of the GAS .align directive is that its meaning differsBoth on Aarch64 and on RISC-V an odd alignment value makes no sense.I have no idea why the alignment would be 3 on other platforms, so Idiff --git a/uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/GoVirtual.S1) FIXME
b/uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/GoVirtual.S
new file mode 100644
index 00000000..8bc2c624
--- /dev/null
+++ b/uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/GoVirtual.S
@@ -0,0 +1,45 @@
+## @file
+#
+# Copyright 2010 - 2012 Unified EFI, Inc.<BR>
+# Copyright (c) 2012, ARM Ltd. All rights reserved.<BR>
+# Copyright (c) 2020, Hewlett Packard Enterprise Development LP.<BR>
+#
+# This program and the accompanying materials
+# are licensed and made available under the terms and conditions of
the BSD License
+# which accompanies this distribution. The full text of the
license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS"
BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS
OR IMPLIED.
+#
+##
+#
+#
+#/*++
+#
+# Module Name:
+#
+# GoVirtual.S
+#
+#--*/
+#start of the code section
+.text
+/* FIXME: Should alignment be different on Aarch64? */
2) Aarch64.
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
.align 8 should do no harm. But is it needed?
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.)
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?
Best regards
Heinrich
I haven't looked into whether 8-byte alignment is actually required by
the code here.
/
Leif