From cee46e5da82c1958ba170980bbb0cd147b5d260f Mon Sep 17 00:00:00 2001 From: Czarek Nakamoto Date: Fri, 10 Oct 2025 11:50:04 +0200 Subject: fix: make stack rw --- apply_patches.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/apply_patches.sh b/apply_patches.sh index 8013c9d..be83bfb 100755 --- a/apply_patches.sh +++ b/apply_patches.sh @@ -46,6 +46,19 @@ then fi git submodule init git submodule update --init --recursive --force + +find . -name "*.S" -o -name "*.s" -type f | while read -r file; do + if ! grep -q "\.note\.GNU-stack" "$file"; then + echo "Adding conditional .note.GNU-stack section to: $file" + echo "" >> "$file" + echo "#ifdef __linux__" >> "$file" + echo ".section .note.GNU-stack,\"\",@progbits" >> "$file" + echo "#endif" >> "$file" + git add "$file" || true + fi +done +git commit -m "Add .note.GNU-stack section to assembly files" + git am -3 < -- cgit v1.2.3