Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 05 Mar 2026 10:35:46 +0000
From:      Brooks Davis <brooks@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 4dd517acb694 - main - libc/armv7: remove default version for alloca
Message-ID:  <69a95c82.3c2ac.37899708@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by brooks:

URL: https://cgit.FreeBSD.org/src/commit/?id=4dd517acb6949d6fed5b16f26fbffb150749b121

commit 4dd517acb6949d6fed5b16f26fbffb150749b121
Author:     Brooks Davis <brooks@FreeBSD.org>
AuthorDate: 2026-03-05 10:33:53 +0000
Commit:     Brooks Davis <brooks@FreeBSD.org>
CommitDate: 2026-03-05 10:34:47 +0000

    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
---
 lib/libc/arm/Symbol.map   | 1 -
 lib/libc/arm/gen/alloca.S | 3 +++
 2 files changed, 3 insertions(+), 1 deletion(-)

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


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?69a95c82.3c2ac.37899708>