aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrooks Davis <brooks@FreeBSD.org>2026-03-05 10:33:53 +0000
committerBrooks Davis <brooks@FreeBSD.org>2026-03-05 10:34:47 +0000
commit4dd517acb6949d6fed5b16f26fbffb150749b121 (patch)
tree39ea9c9710f32e6102daf8cd51d754fd5cede3f2
parentdb1ecd5854d4d9ed596d6411a01de0df6e41e629 (diff)
libc/armv7: remove default version for alloca
The alloca() interface has been a macro expanding to __builtin_alloca() since 2003 (commit 79806b4cdce0, included in FreeBSD 5.2). Even before that virtually every compiler version I was able to test replaced alloca() with compiler generated code when targeting C. Hide it to prevent future (mis)use. Reviewed by: imp, kib Differential Revision: https://reviews.freebsd.org/D51858
-rw-r--r--lib/libc/arm/Symbol.map1
-rw-r--r--lib/libc/arm/gen/alloca.S3
2 files changed, 3 insertions, 1 deletions
diff --git a/lib/libc/arm/Symbol.map b/lib/libc/arm/Symbol.map
index 49476d2e176a..0be97d4ea693 100644
--- a/lib/libc/arm/Symbol.map
+++ b/lib/libc/arm/Symbol.map
@@ -5,7 +5,6 @@
*/
FBSD_1.0 {
__mcount;
- alloca;
brk;
sbrk;
};
diff --git a/lib/libc/arm/gen/alloca.S b/lib/libc/arm/gen/alloca.S
index 3545cc642aad..88db0cab749b 100644
--- a/lib/libc/arm/gen/alloca.S
+++ b/lib/libc/arm/gen/alloca.S
@@ -35,6 +35,7 @@
/* like alloc, but automatic automatic free in return */
#include <machine/asm.h>
+
ENTRY(alloca)
add r0, r0, #0x00000007 /* round up to next 8 byte alignment */
bic r0, r0, #0x00000007
@@ -43,4 +44,6 @@ ENTRY(alloca)
RET
END(alloca)
+ .symver alloca, alloca@FBSD_1.0
+
.section .note.GNU-stack,"",%progbits