`unknownPC` is an extern function we expect to be linked to the output
which is called when we have to crash due to an unexpected jump target.
* Remove unused references to register variables, now only need the
stack pointer
* Fix bug in how the auxiliary values were pushed on the stack.
* Push 0 HW_CAPs
* Implement some glib's functions
* Create 3 constant global variables (`phdr_address`, `e_phentsize` and
`e_phnum`) in the IR which will be used to populate the auxiliary
vectors at run-time.
* Update compile options for `support.c` to ignore useless warnings and
enable debug information
* Implement in `support.c` some functions required by QEMU run-time and
other cleanups to make it compatible with programs translated from
`_start`, not `root`
* Implement in `support.c` the `prepare_stack` function, which
initializes the base of the stack with environment variables,
arguments and auxiliary vectors
* Improve syscall support
* s/`importGlobalData`/`parseELF`/
* Save the entry point specified in the ELF header, which will be used
if the user doesn't provide an address.
* Let parse `parseELF` take care of informing libtinycode about what
has to be mmap'd and where.
* Remove some support scripts used during testing, now no longer
necessary.
* Various cleanups
The main aim of these changes is to support `ret` instructions (that are
indirect jumps), so that function calls can now work properly.
* Emit a dummy call to a `@newPC` function to record where a new
instruction in the original assembly started, what is its PC and its
size. The `Size` parameter for these function call is initially zero,
and it's updated later when a new instruction is met or the current
basic block is terminated. All these calls, before the final emission
of the IR are removed `InstructionTranslator::removeNewPCMarkers`.
* Transform translateMoveToPC into an LLVM pass
(`TranslateDirectBranchesPass`).
* Implement `getNextPC`, which returns the next program counter by
looking for a call to `@newpc` in the current basic block, and,
recursively, in all the basic blocks dominating the current one. This
function is used to force exploration of the basic block coming after
a direct jump, which is paritcularly useful in case of a function call.
* Introduce `translateIndirectJumps`, which translates all the leftover
writes to the PC, i.e. all the indirect ones, by diverting execution
to a large switch statement mapping addresses in the original program
to the corresponding basic blocks in the translated program.
* Introduce `function_call`, a simple test for function calls.
* Other minor changes and whitespace fixes.
* mmap on the PTC side before doing any translation
* Update usages of virtual addresses
* Refactor options to have --load-at and --entry
* Update tests according to the changes