From 85030c58eacfeb2b18b7f65870a92c2332f443a5 Mon Sep 17 00:00:00 2001 From: "Eladio D. Gutierrez" Date: Mon, 15 Feb 2021 13:58:50 +0100 Subject: [PATCH] Minor changess in README.md and ld --- README.md | 15 ++++++++------- gcc-10.2.0-ivm64/gcc/config/ivm64/ld | 6 ++---- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 0f427a955d..cec8dbc127 100644 --- a/README.md +++ b/README.md @@ -148,7 +148,7 @@ Cleaning Here you can find some figures comparing different optimization levels: - codes have been compiled and executed on a Intel Core i7-3770 @3.40GHz server -- compiler version **ivm64-2.0** based on **GCC 10.2.0** were used +- compiler version **ivm64-2.0** based on **GCC 10.2.0** was used - binaries were generated with **ivm v0.37** (be aware that ISA changed in this version) - simulations were carried out with the **yet another (fast) IVM emulator v1.17** @@ -332,10 +332,11 @@ The driver IVM64 GCC calls to the compiler itself, **cpp/cc1** (C preprocessor a - Third, the linker 'ld' combines one or several object files (inlcuding libraries) into a single executable file. With this purpose, all local labels of each object are renamed in case they are reused in different files. - The executable file is just a concatenation of: - - A shebang header, that enables its execution - - the *crt0.o* startup file, which is placed at the very beginning, - - all object files (which are really assembly files), and - - the standard C libraries. + - A shebang header, that enables its execution + - the *crt0.o* startup file, which is placed at the very beginning, + - all object files (which are really assembly files), + - the standard C libraries, and + - other libraries provided in the command line ## Extra linker feature: DCE @@ -397,8 +398,8 @@ Notice that the DCE feature can reduce the size of the output at the expense of This project contains an wide set of sample C source files, located in: ``` -./tests/examples -./tests/tcc +./misc/tests/examples +./misc/tests/tcc ``` Before continuing examples in this section, follow the steps in [Quick start](#quick) to prepare the working environment. diff --git a/gcc-10.2.0-ivm64/gcc/config/ivm64/ld b/gcc-10.2.0-ivm64/gcc/config/ivm64/ld index a16f5f09a4..727894f3f0 100755 --- a/gcc-10.2.0-ivm64/gcc/config/ivm64/ld +++ b/gcc-10.2.0-ivm64/gcc/config/ivm64/ld @@ -199,10 +199,8 @@ read -d '' IVMSHEBANG << 'EOF' ##:ivm64: # export IVM_INDIR=/tmp/in ##:ivm64: # ./a.out 1 2 3 ##:ivm64: # next lines are executed by /bin/sh -##:ivm64: if ! which ivm > /dev/null 2>/dev/null; then echo "Can't execute: application 'ivm' not found in PATH" ; exit 254; fi -##:ivm64: ivm | gawk 'BEGIN{MAJOR=0; MINOR=25} {match($0, /v([0-9]+)\.([0-9]+)/, a); if ((a[1]&2 2>&1 1>&3 # Create binary file -##:ivm64: (if which "${IVM_EMU}" > /dev/null; then echo "Simulating with IVM_EMU=$IVM_EMU"; else echo "IVM_EMU not set or simulator not found; using 'ivm run'"; fi) 3>&2 2>&1 1>&3 +##:ivm64: F="!FN!"; if [ -f "${F}.b" -a "${F}.b" -nt "${F}" ] ; then echo "Using existing ${F}.b binary"; else if ! which ivm > /dev/null 2>/dev/null; then echo "Application 'ivm' not found in PATH" ; exit 254; else ivm as --bin "${F}.b" --sym "${F}.sym" "${F}" 3>&2 2>&1 1>&3; fi; fi +##:ivm64: (if which "${IVM_EMU}" > /dev/null; then echo "Simulating with IVM_EMU=$IVM_EMU"; else echo "IVM_EMU not set or simulator not found; trying with 'ivm'"; if ! which ivm > /dev/null 2>/dev/null; then echo "Application 'ivm' not found in PATH" ; exit 254; else echo "Using 'ivm run'"; fi; fi) 3>&2 2>&1 1>&3 ##:ivm64: trap 'rm -f !FN!_cmd_' EXIT HUP INT TERM QUIT; export F="!FN!"; if ! which "${IVM_EMU}" > /dev/null; then IVM_EMU="ivm run"; fi; ARG_FILE=/proc/$PPID/cmdline; ARG_FILE_OPT=; if test -f "$ARG_FILE"; then cut -d '' -f 3- $ARG_FILE | tr -d $'\\n' > !FN!_cmd_; ARG_FILE_OPT="-a !FN!_cmd_"; fi; OUT_DIR_OPT=; test -d "$IVM_OUTDIR" && OUT_DIR_OPT="-o $IVM_OUTDIR"; IN_DIR_OPT=; test -d "$IVM_INDIR" && IN_DIR_OPT="-i $IVM_INDIR"; (echo; ${IVM_EMU} ${OUT_DIR_OPT} ${IN_DIR_OPT} ${ARG_FILE_OPT} -m ${IVM_MAXMEM:-67108864} "${F}.b") 3>&2 2>&1 1>&3; S=$?; exit $S ##:ivm64: exit 0 ##