Place assembler functions in separate sections
This extends the --gc-sections behaviour to the many assembler
support functions in the firmware images by placing each function
into its own code section. This is achieved by creating a 'func'
macro used to declare each function label.
Fixes ARM-software/tf-issues#80
Change-Id: I301937b630add292d2dec6d2561a7fcfa6fec690
diff --git a/lib/sync/locks/exclusive/spinlock.S b/lib/sync/locks/exclusive/spinlock.S
index 79d19e7..5eae2b0 100644
--- a/lib/sync/locks/exclusive/spinlock.S
+++ b/lib/sync/locks/exclusive/spinlock.S
@@ -28,13 +28,13 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
+#include <asm_macros.S>
+
.globl spin_lock
.globl spin_unlock
- .section .text, "ax";
-
-spin_lock: ; .type spin_lock, %function
+func spin_lock
mov w2, #1
sevl
l1: wfe
@@ -45,6 +45,6 @@
ret
-spin_unlock: ; .type spin_unlock, %function
+func spin_unlock
stlr wzr, [x0]
ret