From 87947712afa92d5b9db53ae04d7e3828646b9f0a Mon Sep 17 00:00:00 2001 From: Mahavir Jain Date: Fri, 28 Mar 2025 13:56:29 +0530 Subject: [PATCH] fix(tools): suppress GNU bin-utils warning about executable stack Newer GNU bin-utils version 2.39 has started emitting a warning about an executable stack region for Linux target build: /usr/bin/ld: warning: x509_crt_bundle.S.o: missing .note.GNU-stack section implies executable stack Fix the issue by adding appropriate "noexecute" attribute for stack section. --- tools/ci/ignore_build_warnings.txt | 1 - tools/cmake/scripts/data_file_embed_asm.cmake | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/ci/ignore_build_warnings.txt b/tools/ci/ignore_build_warnings.txt index 6b9fd8c2dd..ca30cdaf9b 100644 --- a/tools/ci/ignore_build_warnings.txt +++ b/tools/ci/ignore_build_warnings.txt @@ -41,4 +41,3 @@ warning: unknown kconfig symbol 'UNITY_FREERTOS_STACK_SIZE' assigned to '12288' warning: unknown kconfig symbol 'WPA3_SAE' assigned to 'y' in .*/components/wpa_supplicant/test_apps/sdkconfig.defaults ld: warning: ignoring duplicate libraries archive library: .+ the table of contents is empty -warning: x509_crt_bundle.S.o: missing .note.GNU-stack section implies executable stack diff --git a/tools/cmake/scripts/data_file_embed_asm.cmake b/tools/cmake/scripts/data_file_embed_asm.cmake index fbfaf3bedb..5d19e7a1ba 100644 --- a/tools/cmake/scripts/data_file_embed_asm.cmake +++ b/tools/cmake/scripts/data_file_embed_asm.cmake @@ -86,3 +86,7 @@ else() make_and_append_identifier("${varname}_length") endif() append_line(".long ${data_len}") +append_line("") +append_line("#if defined (__linux__)") +append_line(".section .note.GNU-stack,\"\",@progbits") +append_line("#endif")