Skip to content
Snippets Groups Projects
Commit b3bb18ec authored by Jason Hiser's avatar Jason Hiser :tractor:
Browse files

Adjust to use aarch64 tools while xforming aarch64 programs on x86

parent 7b1e386a
No related branches found
No related tags found
1 merge request!43Add libc test
...@@ -12,7 +12,7 @@ popd ...@@ -12,7 +12,7 @@ popd
install_deps() 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() main()
...@@ -20,6 +20,8 @@ main() ...@@ -20,6 +20,8 @@ main()
install_deps install_deps
export PS_OBJDUMP=$(which aarch64-linux-gnu-objdump) export PS_OBJDUMP=$(which aarch64-linux-gnu-objdump)
export PS_READELF=$(which aarch64-linux-gnu-readelf) 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 mkdir -p artifacts/protected_binaries
......
...@@ -8,4 +8,5 @@ if [[ -z $PS_TAR ]] ; then export PS_TAR=tar; fi ...@@ -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_MD5SUM ]] ; then export PS_MD5SUM=md5sum; fi
if [[ -z $PS_TIMEOUT ]] ; then export PS_TIMEOUT=timeout; fi if [[ -z $PS_TIMEOUT ]] ; then export PS_TIMEOUT=timeout; fi
if [[ -z $PS_GREP ]] ; then export PS_GREP=grep; fi if [[ -z $PS_GREP ]] ; then export PS_GREP=grep; fi
if [[ -z $PS_GCC ]] ; then export PS_GCC=gcc; fi
...@@ -8,10 +8,10 @@ outfile=$3 ...@@ -8,10 +8,10 @@ outfile=$3
# so then try normal gcc # so then try normal gcc
# and if both fail, then we exit with an error code # 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 || \ $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 || \
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 || \
exit 1 exit 1
#eu-readelf -S ./a.out #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 #eu-readelf -S -w ./b.out
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment