[PATCH RESEND 23/62] init: rename __initramfs_{start,size} to __builtin_initramfs_{start,size}

Askar Safin
2025-09-13T01:05:11Z

Rename __initramfs_start to __builtin_initramfs_start and
__initramfs_size to __builtin_initramfs_size .

This is more clear

Signed-off-by: Askar Safin <safinaskar@gmail.com>
---
arch/x86/tools/relocs.c | 2 +-
drivers/acpi/tables.c | 4 ++--
include/asm-generic/vmlinux.lds.h | 6 +++---
include/linux/initrd.h | 4 ++--
init/initramfs.c | 4 +---
usr/initramfs_data.S | 4 ++--
6 files changed, 11 insertions(+), 13 deletions(-)

diff --git a/arch/x86/tools/relocs.c b/arch/x86/tools/relocs.c
index 5778bc498415..4b4e556f1b52 100644
--- a/arch/x86/tools/relocs.c
+++ b/arch/x86/tools/relocs.c
@@ -87,7 +87,7 @@ static const char * const sym_regex_kernel[S_NSYMTYPES] = {
"__(start|stop)_notes|"
"__end_rodata|"
"__end_rodata_aligned|"
- "__initramfs_start|"
+ "__builtin_initramfs_start|"
"(jiffies|jiffies_64)|"
#if ELF_BITS == 64
"__end_rodata_hpage_align|"
diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c
index fa9bb8c8ce95..3160cb7dca00 100644
--- a/drivers/acpi/tables.c
+++ b/drivers/acpi/tables.c
@@ -429,8 +429,8 @@ void __init acpi_table_upgrade(void)
struct cpio_data file;

if (IS_ENABLED(CONFIG_ACPI_TABLE_OVERRIDE_VIA_BUILTIN_INITRD)) {
- data = __initramfs_start;
- size = __initramfs_size;
+ data = __builtin_initramfs_start;
+ size = __builtin_initramfs_size;
} else {
data = (void *)initrd_start;
size = initrd_end - initrd_start;
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index ae2d2359b79e..a6bd2ff46f7e 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -46,8 +46,8 @@
* [_sdata, _edata] is the data section
*
* Some of the included output section have their own set of constants.
- * Examples are: [__initramfs_start, __initramfs_end] for initramfs and
- * [__nosave_begin, __nosave_end] for the nosave data
+ * Examples are: [__builtin_initramfs_start, __builtin_initramfs_start + __builtin_initramfs_size]
+ * for initramfs and [__nosave_begin, __nosave_end] for the nosave data
*/

#include <asm-generic/codetag.lds.h>
@@ -969,7 +969,7 @@ defined(CONFIG_AUTOFDO_CLANG) || defined(CONFIG_PROPELLER_CLANG)
#ifdef CONFIG_BLK_DEV_INITRD
#define INIT_RAM_FS \
. = ALIGN(4); \
- __initramfs_start = .; \
+ __builtin_initramfs_start = .; \
KEEP(*(.init.ramfs)) \
. = ALIGN(8); \
KEEP(*(.init.ramfs.info))
diff --git a/include/linux/initrd.h b/include/linux/initrd.h
index cc389ef1a738..e49c7166dbb3 100644
--- a/include/linux/initrd.h
+++ b/include/linux/initrd.h
@@ -21,8 +21,8 @@ static inline void wait_for_initramfs(void) {}
extern phys_addr_t phys_initrd_start;
extern unsigned long phys_initrd_size;

-extern char __initramfs_start[];
-extern unsigned long __initramfs_size;
+extern char __builtin_initramfs_start[];
+extern unsigned long __builtin_initramfs_size;

void console_on_rootfs(void);

diff --git a/init/initramfs.c b/init/initramfs.c
index 850cb0de873e..2866d7a0afd7 100644
--- a/init/initramfs.c
+++ b/init/initramfs.c
@@ -597,8 +597,6 @@ static int __init initramfs_async_setup(char *str)
}
__setup("initramfs_async=", initramfs_async_setup);

-extern char __initramfs_start[];
-extern unsigned long __initramfs_size;
#include <linux/initrd.h>
#include <linux/kexec.h>

@@ -695,7 +693,7 @@ static inline bool kexec_free_initrd(void)
static void __init do_populate_rootfs(void *unused, async_cookie_t cookie)
{
/* Load the built in initramfs */
- char *err = unpack_to_rootfs(__initramfs_start, __initramfs_size);
+ char *err = unpack_to_rootfs(__builtin_initramfs_start, __builtin_initramfs_size);
if (err)
panic_show_mem("%s", err); /* Failed to decompress INTERNAL initramfs */

diff --git a/usr/initramfs_data.S b/usr/initramfs_data.S
index cd67edc38797..64ca648a80e2 100644
--- a/usr/initramfs_data.S
+++ b/usr/initramfs_data.S
@@ -27,8 +27,8 @@ __irf_start:
.incbin "usr/initramfs_inc_data"
__irf_end:
.section .init.ramfs.info,"a"
-.globl __initramfs_size
-__initramfs_size:
+.globl __builtin_initramfs_size
+__builtin_initramfs_size:
#ifdef CONFIG_64BIT
.quad __irf_end - __irf_start
#else
--
2.47.2