Skip to content

Commit 411e8a1

Browse files
committed
fix: make stack rw
1 parent cc02292 commit 411e8a1

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

apply_patches.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,19 @@ then
4646
fi
4747
git submodule init
4848
git submodule update --init --recursive --force
49+
50+
find . -name "*.S" -o -name "*.s" -type f | while read -r file; do
51+
if ! grep -q "\.note\.GNU-stack" "$file"; then
52+
echo "Adding conditional .note.GNU-stack section to: $file"
53+
echo "" >> "$file"
54+
echo "#ifdef __linux__" >> "$file"
55+
echo ".section .note.GNU-stack,\"\",@progbits" >> "$file"
56+
echo "#endif" >> "$file"
57+
git add "$file" || true
58+
fi
59+
done
60+
git commit -m "Add .note.GNU-stack section to assembly files"
61+
4962
git am -3 <<EOF
5063
From e56dd6cd0fb1a5e55d3cb08691edf24b26d65299 Mon Sep 17 00:00:00 2001
5164
From: Czarek Nakamoto <cyjan@mrcyjanek.net>

0 commit comments

Comments
 (0)