public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] arm: emit .type %function directive in FUNC_START macro
@ 2024-06-26  9:07 Christophe Lyon
  2024-06-26 11:56 ` Richard Earnshaw (lists)
  0 siblings, 1 reply; 2+ messages in thread
From: Christophe Lyon @ 2024-06-26  9:07 UTC (permalink / raw)
  To: newlib; +Cc: Christophe Lyon

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] arm: emit .type %function directive in FUNC_START macro
  2024-06-26  9:07 [PATCH] arm: emit .type %function directive in FUNC_START macro Christophe Lyon
@ 2024-06-26 11:56 ` Richard Earnshaw (lists)
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Earnshaw (lists) @ 2024-06-26 11:56 UTC (permalink / raw)
  To: Christophe Lyon, newlib

On 26/06/2024 10:07, Christophe Lyon wrote:
> 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.

OK.

R.

> ---
>  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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-06-26 11:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-26  9:07 [PATCH] arm: emit .type %function directive in FUNC_START macro Christophe Lyon
2024-06-26 11:56 ` Richard Earnshaw (lists)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).