nuttx/cmake
leisiji 85337c0efc boards/arm/qemu: Fix KASAN global sections placement in linker script
1. The .kasan.unused and .kasan.global sections contain compiler-generated
data with the WRITE flag (.data..LASAN*), but the linker script placed
them before .text without specifying a memory region. The linker could
not put writable sections into the read-only ROM (rx) region, so it
silently placed them at 0x40000000 in RAM, creating an extra LOAD
segment that conflicts with QEMU virt's RAM layout and causes boot
failure.
2. The .kasan.global should be placed before .data because .data
patten (*(.data*)) includes .kasan.global pattern (*(.data..LASAN0)),
and it cause kasan_global.py cannot find .kasan.global section to
generate the g_global_region array.
3. Move .kasan.shadows from before .text to after .rodata. Placing it
before .text causes .text to shift when .kasan.shadows transitions
from empty (pass 1) to populated (pass 2+), preventing the multi-pass
link addresses from converging. After .rodata it does not affect any
upstream section addresses.
4. Add CMake post-build step to strip .kasan.unused and .kasan.global
sections from the final binary, matching the Makefile build behavior.

Signed-off-by: leisiji <2265215145@qq.com>
2026-07-03 07:51:11 +02:00
..
menuconfig.cmake cmake: add olddefconfig target for CMake builds 2026-04-02 13:16:54 +08:00
nuttx_3rdparty.cmake cmake: Moved the creation of the nxtmpdir folder to the root CMake file 2026-04-22 06:22:36 +08:00
nuttx_add_application.cmake build/fix: remove nonexistent target in cmake 2026-06-08 16:03:21 +08:00
nuttx_add_dependencies.cmake style: fix spelling in code comments and strings 2025-05-23 10:48:41 +08:00
nuttx_add_library.cmake cmake(feat):define elf option and enable apps module build 2026-01-19 14:45:37 +08:00
nuttx_add_module.cmake cmake: migrate to SPDX identifier 2024-09-10 11:34:40 +08:00
nuttx_add_romfs.cmake !build: add build-time password generation with mkpasswd tool. 2026-04-14 16:06:30 +08:00
nuttx_add_subdirectory.cmake cmake: pass exclusion list to nuttx_add_subdirectory 2025-10-03 11:34:56 +08:00
nuttx_add_symtab.cmake style: fix spelling in code comments and strings 2025-05-23 10:48:41 +08:00
nuttx_create_symlink.cmake cmake: nuttx_create_symlink: Remove warning for CMP0205 2026-05-26 15:11:35 -03:00
nuttx_export_header.cmake cmake: migrate to SPDX identifier 2024-09-10 11:34:40 +08:00
nuttx_extensions.cmake cmake(enhance):cmake support DYNLIB build 2026-01-19 14:45:37 +08:00
nuttx_generate_headers.cmake style: Fix "the the" typo across the codebase. 2026-03-23 11:07:49 +01:00
nuttx_generate_outputs.cmake arch/tricore: Remove tasking compiler tool specific code from 2025-09-26 13:26:31 +02:00
nuttx_generate_sim_ld.cmake cmake:bugfix refine gen sim link script to independent cmake module 2024-09-15 10:01:07 +08:00
nuttx_kconfig.cmake cmake: Fix SIM_TOOLCHAIN using CMake on macOS. 2026-05-25 14:32:48 +02:00
nuttx_mkconfig.cmake cmake: Enhance .config handling and comparison logic 2026-02-26 09:46:02 -03:00
nuttx_mkversion.cmake cmake(bugfix):fix VERSION genarator strip error in CMake build 2025-06-18 15:45:30 -04:00
nuttx_multiple_link.cmake boards/arm/qemu: Fix KASAN global sections placement in linker script 2026-07-03 07:51:11 +02:00
nuttx_overrides.cmake cmake(bugfix):change default compile obj extension to .o 2026-01-27 20:54:26 +08:00
nuttx_parse_function_args.cmake cmake: migrate to SPDX identifier 2024-09-10 11:34:40 +08:00
nuttx_process_config.cmake cmake(enhance):include-style defconfig can modified via menuconfig 2026-01-15 15:42:17 -03:00
nuttx_redefine_symbols.cmake cmake: migrate to SPDX identifier 2024-09-10 11:34:40 +08:00
nuttx_remove_compile_options.cmake style: fix spelling in code comments and strings 2025-05-23 10:48:41 +08:00
nuttx_sethost.cmake tools/rust: Fix aarch64 NuttX Rust target specs 2026-05-29 10:25:10 +02:00
nuttx_source_file_properties.cmake cmake: migrate to SPDX identifier 2024-09-10 11:34:40 +08:00
nuttx_toolchain.cmake cmake/nuttx_toolchain.cmake: track preprocessed include deps 2026-06-04 17:22:43 +08:00
savedefconfig.cmake !build: add build-time password generation with mkpasswd tool. 2026-04-14 16:06:30 +08:00
symtab.c.in cmake: migrate to SPDX identifier 2024-09-10 11:34:40 +08:00