diff --git a/cicd_testing/do-prot-bins.sh b/cicd_testing/do-prot-bins.sh index 8ac08919b4b89bb81d5e2e228447661f57538657..1bc20bd86a940ec2376cc2a77c23e6b3ee0eee5b 100755 --- a/cicd_testing/do-prot-bins.sh +++ b/cicd_testing/do-prot-bins.sh @@ -12,7 +12,7 @@ popd install_deps() { - sudo apt-get install -y binutils-aarch64-linux-gnu + sudo apt-get install -y binutils-aarch64-linux-gnu gcc-aarch64-linux-gnu } main() @@ -20,6 +20,8 @@ main() install_deps export PS_OBJDUMP=$(which aarch64-linux-gnu-objdump) export PS_READELF=$(which aarch64-linux-gnu-readelf) + export PS_GCC=$(which aarch64-linux-gnu-gcc) + export PS_OBJCOPY=$(which aarch64-linux-gnu-objcopy) mkdir -p artifacts/protected_binaries diff --git a/set_command_envs b/set_command_envs index ee97496fb68e26dd201c903ed8189a8395ab4d08..2c3491faf46e3e6f9ed2edcf6875e09242206d93 100755 --- a/set_command_envs +++ b/set_command_envs @@ -8,4 +8,5 @@ if [[ -z $PS_TAR ]] ; then export PS_TAR=tar; fi if [[ -z $PS_MD5SUM ]] ; then export PS_MD5SUM=md5sum; fi if [[ -z $PS_TIMEOUT ]] ; then export PS_TIMEOUT=timeout; fi if [[ -z $PS_GREP ]] ; then export PS_GREP=grep; fi +if [[ -z $PS_GCC ]] ; then export PS_GCC=gcc; fi diff --git a/tools/eh_frame_tools/eh_to_bin.sh b/tools/eh_frame_tools/eh_to_bin.sh index 86056d29b34ea68b72a27e76e64d80cee6670f00..7f10b67263ed06ac607685f4d3e219dcd44eea46 100755 --- a/tools/eh_frame_tools/eh_to_bin.sh +++ b/tools/eh_frame_tools/eh_to_bin.sh @@ -8,10 +8,10 @@ outfile=$3 # so then try normal gcc # and if both fail, then we exit with an error code -gcc $infile -nostdlib -Wl,--section-start -Wl,eh_frame_hdr=$addr -Wl,-e -Wl,0x1000 -Wl,--build-id=none -Wl,-T -Wl,${PEASOUP_HOME}/tools/eh_frame_tools/eh_frame.ls -o $outfile -Wl,-Map,$outfile.map -static -no-pie -fno-PIC || \ -gcc $infile -nostdlib -Wl,--section-start -Wl,eh_frame_hdr=$addr -Wl,-e -Wl,0x1000 -Wl,--build-id=none -Wl,-T -Wl,${PEASOUP_HOME}/tools/eh_frame_tools/eh_frame.ls -o $outfile -Wl,-Map,$outfile.map -static || \ +$PS_GCC $infile -nostdlib -Wl,--section-start -Wl,eh_frame_hdr=$addr -Wl,-e -Wl,0x1000 -Wl,--build-id=none -Wl,-T -Wl,${PEASOUP_HOME}/tools/eh_frame_tools/eh_frame.ls -o $outfile -Wl,-Map,$outfile.map -static -no-pie -fno-PIC || \ +$PS_GCC $infile -nostdlib -Wl,--section-start -Wl,eh_frame_hdr=$addr -Wl,-e -Wl,0x1000 -Wl,--build-id=none -Wl,-T -Wl,${PEASOUP_HOME}/tools/eh_frame_tools/eh_frame.ls -o $outfile -Wl,-Map,$outfile.map -static || \ exit 1 #eu-readelf -S ./a.out -objcopy --rename-section eh_frame_hdr=.eh_frame_hdr --rename-section eh_frame=.eh_frame --rename-section gcc_except_table=.gcc_except_table $outfile +$PS_OBJCOPY --rename-section eh_frame_hdr=.eh_frame_hdr --rename-section eh_frame=.eh_frame --rename-section gcc_except_table=.gcc_except_table $outfile #eu-readelf -S -w ./b.out