[PATCH] arm: emit .type %function directive in FUNC_START macro

Christophe Lyon <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <[email protected]>
The linker needs to know whether a symbol is STT_FUNCTION when
deciding which farcall stub to emit (if needed), this patch adds this
to the FUNC_START macro which is used in crt0.
---
 libgloss/arm/crt0.S         | 2 ++
 libgloss/arm/redboot-crt0.S | 2 ++
 newlib/libc/sys/arm/crt0.S  | 2 ++
 3 files changed, 6 insertions(+)

diff --git a/libgloss/arm/crt0.S b/libgloss/arm/crt0.S
index cd1a20d61..9ff0e6323 100644
--- a/libgloss/arm/crt0.S
+++ b/libgloss/arm/crt0.S
@@ -48,6 +48,7 @@
 	.thumb
 .macro FUNC_START name
 	.global \name
+	.type \name, %function
 	.thumb_func
 \name:
 .endm
@@ -55,6 +56,7 @@
 	.code 32
 .macro FUNC_START name
 	.global \name
+	.type \name, %function
 \name:
 .endm
 #endif
diff --git a/libgloss/arm/redboot-crt0.S b/libgloss/arm/redboot-crt0.S
index 0e3a9b4e2..c9f3440ac 100644
--- a/libgloss/arm/redboot-crt0.S
+++ b/libgloss/arm/redboot-crt0.S
@@ -17,6 +17,7 @@
 #ifdef PREFER_THUMB
 .macro FUNC_START name
 	.global \name
+	.type \name, %function
 	.thumb_func
 \name:
 .endm
@@ -24,6 +25,7 @@
 #else
 .macro FUNC_START name
 	.global \name
+	.type \name, %function
 \name:
 .endm
 	.code 32
diff --git a/newlib/libc/sys/arm/crt0.S b/newlib/libc/sys/arm/crt0.S
index 90d5be393..dae0f0465 100644
--- a/newlib/libc/sys/arm/crt0.S
+++ b/newlib/libc/sys/arm/crt0.S
@@ -48,6 +48,7 @@
 	.thumb
 .macro FUNC_START name
 	.global \name
+	.type \name, %function
 	.thumb_func
 \name:
 .endm
@@ -55,6 +56,7 @@
 	.code 32
 .macro FUNC_START name
 	.global \name
+	.type \name, %function
 \name:
 .endm
 #endif
-- 
2.34.1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.