]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPkg RVCT: add asm macro combining EXPORT, AREA and label definition
authorEugene Cohen <eugene@hp.com>
Wed, 2 Dec 2015 16:23:20 +0000 (16:23 +0000)
committerabiesheuvel <abiesheuvel@Edk2>
Wed, 2 Dec 2015 16:23:20 +0000 (16:23 +0000)
In response to Leif's request earlier, this adds a new RVCT assembler
macro to centralize the exporting of assembly functions including the
EXPORT directive (so the linker can see it), the AREA directive (so
it's in its own section for code size reasons) and the function label
itself.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eugene Cohen <eugene@hp.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19098 6f19259b-4bc3-4df7-8a09-765794883524

ArmPkg/Include/AsmMacroExport.inc [new file with mode: 0644]

diff --git a/ArmPkg/Include/AsmMacroExport.inc b/ArmPkg/Include/AsmMacroExport.inc
new file mode 100644 (file)
index 0000000..818d6b2
--- /dev/null
@@ -0,0 +1,29 @@
+;%HEADER%\r
+;/** @file\r
+;  Macros to centralize the EXPORT, AREA, and definition of an assembly\r
+;  function.  The AREA prefix is required to put the function in its own\r
+;  section so that removal of unused functions in the final link is performed.\r
+;  This provides  equivalent functionality to the compiler's --split-sections\r
+;  option.\r
+;\r
+;  Copyright (c) 2015 HP Development Company, L.P.\r
+;\r
+;  This program and the accompanying materials\r
+;  are licensed and made available under the terms and conditions of the BSD License\r
+;  which accompanies this distribution.  The full text of the license may be found at\r
+;  http://opensource.org/licenses/bsd-license.php\r
+;\r
+;  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+;  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+;\r
+;**/\r
+\r
+\r
+  MACRO\r
+  RVCT_ASM_EXPORT $func\r
+    EXPORT  $func\r
+    AREA s_$func, CODE, READONLY\r
+$func\r
+  MEND\r
+\r
+  END\r