From 0ed7fadef894762300d62d65e81462abf378239b Mon Sep 17 00:00:00 2001 From: teoberi Date: Thu, 23 May 2024 09:32:10 +0300 Subject: [PATCH] Update build_binaries.sh (Fortify) Added a warning about the need to install the NASM assembler Generating test files for Fortify (nolibc*, fszero*) --- tests/binaries/build_binaries.sh | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/tests/binaries/build_binaries.sh b/tests/binaries/build_binaries.sh index 047c9fa..a7ab7b5 100755 --- a/tests/binaries/build_binaries.sh +++ b/tests/binaries/build_binaries.sh @@ -50,12 +50,15 @@ clang -m32 -o output/none_cl32 test.c -w -D_FORTIFY_SOURCE=0 -fno-stack-protecto clang -m32 -c test.c -o output/rel_cl32.o clang -m32 -shared -fPIC -o output/dso_cl32.so test.c -w -D_FORTIFY_SOURCE=2 -fstack-protector-strong -O2 -z relro -z now -z noexecstack -s -gcc -o output/nolibc main.c start.S hello.S -w -nostdlib -no-pie -s -clang -o output/nolibc_cl main.c start.S hello.S -w -nostdlib -no-pie -s -gcc -m32 -o output/nolibc32 main.c start.S hello.S -w -nostdlib -no-pie -s -clang -m32 -o output/nolibc_cl32 main.c start.S hello.S -w -nostdlib -no-pie -s +# Fortify source (NASM assembler installation is required) +nasm -f elf64 -o nolibc.o nolibc.asm +nasm -f elf32 -o nolibc32.o nolibc32.asm +gcc -o output/nolibc nolibc.o -w -nostdlib -no-pie -s +clang -o output/nolibc_cl nolibc.o -w -nostdlib -no-pie -s +gcc -m32 -o output/nolibc32 nolibc32.o -w -nostdlib -no-pie -s +clang -m32 -o output/nolibc_cl32 nolibc32.o -w -nostdlib -no-pie -s -gcc -o output/fszero helloworld.c -w -D_FORTIFY_SOURCE=0 -O2 -s -clang -o output/fszero_cl helloworld.c -w -D_FORTIFY_SOURCE=0 -O2 -s -gcc -m32 -o output/fszero32 helloworld.c -w -D_FORTIFY_SOURCE=0 -O2 -s -clang -m32 -o output/fszero_cl32 helloworld.c -w -D_FORTIFY_SOURCE=0 -O2 -s +gcc -o output/fszero fszero.c -w -D_FORTIFY_SOURCE=0 -O2 -s +clang -o output/fszero_cl fszero.c -w -D_FORTIFY_SOURCE=0 -O2 -s +gcc -m32 -o output/fszero32 fszero.c -w -D_FORTIFY_SOURCE=0 -O2 -s +clang -m32 -o output/fszero_cl32 fszero.c -w -D_FORTIFY_SOURCE=0 -O2 -s