From abd021539dd8e2a2d11fd9833d9fa2a2dddc2ad8 Mon Sep 17 00:00:00 2001 From: Erik Lundell Date: Thu, 13 Aug 2026 12:24:31 +0200 Subject: [PATCH] Arm backend: Add .bss prefix to bss sections Even though the .ld file ensured the final elf did not include a large chunk of 0 data, the object file did. By prefixing sections with .bss, the compiler will pick it up and fix it already when compiling the object file. Signed-off-by: Erik Lundell Change-Id: I885893cb59e6444644978fb452ac8323e4024259 --- examples/arm/executor_runner/Corstone-300.ld | 4 ++-- examples/arm/executor_runner/Corstone-320.ld | 2 ++ examples/arm/executor_runner/arm_executor_runner.cpp | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/examples/arm/executor_runner/Corstone-300.ld b/examples/arm/executor_runner/Corstone-300.ld index 3901d080000..e09cbb6f1ac 100644 --- a/examples/arm/executor_runner/Corstone-300.ld +++ b/examples/arm/executor_runner/Corstone-300.ld @@ -278,8 +278,8 @@ SECTIONS .ddr.bss (NOLOAD) : { . = ALIGN(16); - *(input_file_allocator_sec) - *(method_allocator_sec) + *(.bss.input_file_allocator_sec) + *(.bss.method_allocator_sec) #if (ETHOSU_ARENA == 1) . = ALIGN(32); *(.bss.tensor_arena) diff --git a/examples/arm/executor_runner/Corstone-320.ld b/examples/arm/executor_runner/Corstone-320.ld index 4edbe8d536b..8949113ee61 100644 --- a/examples/arm/executor_runner/Corstone-320.ld +++ b/examples/arm/executor_runner/Corstone-320.ld @@ -264,6 +264,8 @@ SECTIONS .ddr.bss (NOLOAD) : { . = ALIGN(16); + *(.bss.input_file_allocator_sec) + *(.bss.method_allocator_sec) *(input_file_allocator_sec) *(method_allocator_sec) #if (ETHOSU_ARENA == 1) diff --git a/examples/arm/executor_runner/arm_executor_runner.cpp b/examples/arm/executor_runner/arm_executor_runner.cpp index 904d3650fc6..bf6ac16506b 100644 --- a/examples/arm/executor_runner/arm_executor_runner.cpp +++ b/examples/arm/executor_runner/arm_executor_runner.cpp @@ -164,7 +164,7 @@ using printf_size_t = unsigned long; const size_t input_file_allocation_pool_size = ET_ARM_BAREMETAL_SEMIHOSTING_FILE_ALLOCATOR_POOL_SIZE; unsigned char __attribute__(( - section("input_file_allocator_sec"), + section(".bss.input_file_allocator_sec"), aligned(16))) input_file_allocation_pool[input_file_allocation_pool_size]; #endif @@ -232,7 +232,7 @@ using torch::executor::etdump_result; const size_t method_allocation_pool_size = ET_ARM_BAREMETAL_METHOD_ALLOCATOR_POOL_SIZE; unsigned char __attribute__(( - section("method_allocator_sec"), + section(".bss.method_allocator_sec"), aligned(16))) method_allocation_pool[method_allocation_pool_size]; #if defined(ET_BUNDLE_IO)