From 27356b782674a9e2bb040553bebb57f2330fd2e3 Mon Sep 17 00:00:00 2001 From: EnderIce2 Date: Mon, 24 Mar 2025 00:38:03 +0000 Subject: [PATCH] fix(userspace/libc): mark ABI and build ID notes as used to prevent optimization removal Signed-off-by: EnderIce2 --- Userspace/libc/interpreter/start.c | 4 ++-- Userspace/libc/runtime/fennix/amd64/crt1.c | 2 +- Userspace/libc/runtime/linux/x86_64/crt1.c | 2 +- Userspace/libc/src/main.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Userspace/libc/interpreter/start.c b/Userspace/libc/interpreter/start.c index 238f9e56..66662e32 100644 --- a/Userspace/libc/interpreter/start.c +++ b/Userspace/libc/interpreter/start.c @@ -69,7 +69,7 @@ const struct Elf_Nhdr header; char name[4]; __UINT32_TYPE__ desc[4]; -} __abi_tag __attribute__((aligned(4), section(".note.ABI-tag"))) = { +} __abi_tag __attribute__((used, aligned(4), section(".note.ABI-tag"))) = { .header = { .n_namesz = 4, /* "FNX" + '\0' */ .n_descsz = sizeof(__UINT32_TYPE__) * 4, /* Description Size */ @@ -84,7 +84,7 @@ const struct Elf_Nhdr header; char name[4]; __UINT8_TYPE__ desc[20]; -} __build_id __attribute__((aligned(4), section(".note.build-id"))) = { +} __build_id __attribute__((used, aligned(4), section(".note.build-id"))) = { .header = { .n_namesz = 4, /* "FNX" + '\0' */ .n_descsz = sizeof(__UINT8_TYPE__) * 20, /* Description Size */ diff --git a/Userspace/libc/runtime/fennix/amd64/crt1.c b/Userspace/libc/runtime/fennix/amd64/crt1.c index 73c53e3c..f7a35e75 100644 --- a/Userspace/libc/runtime/fennix/amd64/crt1.c +++ b/Userspace/libc/runtime/fennix/amd64/crt1.c @@ -90,7 +90,7 @@ const struct Elf_Nhdr header; char name[4]; __UINT32_TYPE__ desc[4]; -} __abi_tag __attribute__((aligned(4), section(".note.ABI-tag"))) = { +} __abi_tag __attribute__((used, aligned(4), section(".note.ABI-tag"))) = { .header = { .n_namesz = 4, /* "FNX" + '\0' */ .n_descsz = sizeof(__UINT32_TYPE__) * 4, /* Description Size */ diff --git a/Userspace/libc/runtime/linux/x86_64/crt1.c b/Userspace/libc/runtime/linux/x86_64/crt1.c index 73c53e3c..f7a35e75 100644 --- a/Userspace/libc/runtime/linux/x86_64/crt1.c +++ b/Userspace/libc/runtime/linux/x86_64/crt1.c @@ -90,7 +90,7 @@ const struct Elf_Nhdr header; char name[4]; __UINT32_TYPE__ desc[4]; -} __abi_tag __attribute__((aligned(4), section(".note.ABI-tag"))) = { +} __abi_tag __attribute__((used, aligned(4), section(".note.ABI-tag"))) = { .header = { .n_namesz = 4, /* "FNX" + '\0' */ .n_descsz = sizeof(__UINT32_TYPE__) * 4, /* Description Size */ diff --git a/Userspace/libc/src/main.c b/Userspace/libc/src/main.c index d8d1161d..8e54bc73 100644 --- a/Userspace/libc/src/main.c +++ b/Userspace/libc/src/main.c @@ -67,7 +67,7 @@ const struct Elf_Nhdr header; char name[4]; __UINT8_TYPE__ desc[20]; -} __build_id __attribute__((aligned(4), section(".note.build-id"))) = { +} __build_id __attribute__((used, aligned(4), section(".note.build-id"))) = { .header = { .n_namesz = 4, /* "FNX" + '\0' */ .n_descsz = sizeof(__UINT8_TYPE__) * 20, /* Description Size */