From 75c54406cebd9428c807994e7b7506307944e153 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Fri, 10 Aug 2018 11:37:55 +0200 Subject: [PATCH] mescc: Add objdump'able x86_64-mes scaffold. * lib/x86_64-mes/elf64-header.hex2: New file. * lib/x86_64-mes/elf64-footer-single-main.hex2: New file. * build-aux/build-x86_64-mes.sh: Enable second, objdump'able exit-42 scaffold test. --- build-aux/build-x86_64-mes.sh | 24 +- lib/x86_64-mes/elf64-footer-single-main.hex2 | 62 +++++ lib/x86_64-mes/elf64-header.hex2 | 233 +++++++++++++++++++ lib/x86_64-mes/exit-42.c | 2 +- 4 files changed, 308 insertions(+), 13 deletions(-) create mode 100644 lib/x86_64-mes/elf64-footer-single-main.hex2 create mode 100644 lib/x86_64-mes/elf64-header.hex2 diff --git a/build-aux/build-x86_64-mes.sh b/build-aux/build-x86_64-mes.sh index 2144f812..3239d351 100755 --- a/build-aux/build-x86_64-mes.sh +++ b/build-aux/build-x86_64-mes.sh @@ -46,19 +46,19 @@ trace "TEST 0exit-42" { set +e; lib/x86_64-mes/0exit-42.x86_64-out; r=$?; set -e; } [ $r != 42 ] && echo " => $r" && exit 1 -# trace "HEX2 0exit-42" $HEX2\ -# --LittleEndian\ -# --Architecture 2\ -# --BaseAddress 0x1000000\ -# -f ${srcdest}lib/x86_64-mes/elf64-header.hex2\ -# -f ${srcdest}lib/x86_64-mes/elf64-body-exit-42.hex2\ -# -f ${srcdest}lib/x86_64-mes/elf64-footer-single-main.hex2\ -# --exec_enable\ -# -o lib/x86_64-mes/exit-42.x86_64-out +trace "HEX2 0exit-42" $HEX2\ + --LittleEndian\ + --Architecture 2\ + --BaseAddress 0x1000000\ + -f ${srcdest}lib/x86_64-mes/elf64-header.hex2\ + -f ${srcdest}lib/x86_64-mes/elf64-body-exit-42.hex2\ + -f ${srcdest}lib/x86_64-mes/elf64-footer-single-main.hex2\ + --exec_enable\ + -o lib/x86_64-mes/exit-42.x86_64-out -# trace "TEST exit-42" -# { set +e; lib/x86_64-mes/exit-42.x86_64-out; r=$?; set -e; } -# [ $r != 42 ] && echo " => $r" && exit 1 +trace "TEST exit-42" +{ set +e; lib/x86_64-mes/exit-42.x86_64-out; r=$?; set -e; } +[ $r != 42 ] && echo " => $r" && exit 1 # if [ -d "$MES_SEED" ]; then # mkdir -p lib/x86_64-mes diff --git a/lib/x86_64-mes/elf64-footer-single-main.hex2 b/lib/x86_64-mes/elf64-footer-single-main.hex2 new file mode 100644 index 00000000..6caed915 --- /dev/null +++ b/lib/x86_64-mes/elf64-footer-single-main.hex2 @@ -0,0 +1,62 @@ +### Copyright (C) 2017 Jan (janneke) Nieuwenhuizen +### This file is part of stage0. +### +### stage0 is free software: you an redistribute it and/or modify +### it under the terms of the GNU General Public License as published by +### the Free Software Foundation, either version 3 of the License, or +### (at your option) any later version. +### +### stage0 is distributed in the hope that it will be useful, +### but WITHOUT ANY WARRANTY; without even the implied warranty of +### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +### GNU General Public License for more details. +### +### You should have received a copy of the GNU General Public License +### along with stage0. If not, see . + +### stage0's hex2 format for x86_64 +### !