Skip to content

Commit

Permalink
Minor changess in README.md and ld
Browse files Browse the repository at this point in the history
  • Loading branch information
elnv committed Feb 15, 2021
1 parent 3e1b281 commit 85030c5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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**

Expand Down Expand Up @@ -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 <a name="dce">

Expand Down Expand Up @@ -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.
Expand Down
6 changes: 2 additions & 4 deletions gcc-10.2.0-ivm64/gcc/config/ivm64/ld
Original file line number Diff line number Diff line change
Expand Up @@ -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]<MAJOR) || (a[1]==MAJOR && a[2]<MINOR)) {print "ivm v" MAJOR "." MINOR " or greater required"; exit 254} }'
##:ivm64: F="!FN!"; ivm as --bin "${F}.b" --sym "${F}.sym" "${F}" 3>&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
##
Expand Down

0 comments on commit 85030c5

Please sign in to comment.