From 139f5292e7985d0326a1d18eee88720255e423dc Mon Sep 17 00:00:00 2001 From: Casey Connolly Date: Wed, 1 Apr 2026 16:15:19 +0200 Subject: string: add strdup_const and kstrdup_const Extend Linux compat by adding kstrdup_const(), backed by lib/string.c. This leverages U-Boots .rodata section on ARM64 to avoid pointlessly duplicating const strings. This is used by the Linux CCF_FULL port and may be useful elsewhere in U-Boot. Signed-off-by: Casey Connolly --- include/linux/string.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/linux/string.h') diff --git a/include/linux/string.h b/include/linux/string.h index d943fcce690..a8a6cf4af50 100644 --- a/include/linux/string.h +++ b/include/linux/string.h @@ -104,6 +104,8 @@ size_t strcspn(const char *s, const char *reject); #ifndef __HAVE_ARCH_STRDUP extern char * strdup(const char *); extern char * strndup(const char *, size_t); +extern const char *strdup_const(const char *s); +extern void kfree_const(const void *x); #endif #ifndef __HAVE_ARCH_STRSWAB extern char * strswab(const char *); -- cgit v1.2.3