aarch64: loader.ld: fix ELF initial program counter offset

mixed up 1000 with 0x1000. Went undetected since the linker
adjusts to a page anyway.
Spotted by the evil all-seeing eye of Paul Mundt.

Cc: Paul Mundt <paul.mundt@huawei.com>
Reviewed-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
Signed-off-by: Claudio Fontana <claudio.fontana@huawei.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
scripts: no space allowed around keyword argument assignment

Signed-off-by: William Dauchy <william@gandi.net>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
scripts: unnecessary semicolon

Signed-off-by: William Dauchy <william@gandi.net>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
scripts: unnecessary parens after 'if' keyword

Signed-off-by: William Dauchy <william@gandi.net>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
scripts: except import error for stringIO

Signed-off-by: William Dauchy <william@gandi.net>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
images/default: Switch to new CLI by default

In preparation for v0.13, switch default image to the new CLI.

Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
remove unneeded includes of <cxxabi.h>

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
<osv/demangle.hh> - add missing include

The definitions of <osv/demangle.hh> require size_t. We should include
<stddef.h>, in case the user's file never included one of the other
header files which define size_t (I had such a case).

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
execinfo: implement backtrace_symbols*

From Linux's <execinfo.h>, we already implemented backtrace() but
not backtrace_symbols() or backtrace_symbols_fd(). This patch
implements both. These functions are used by several applications,
including MySQL, so we should have them.

Fixes #493.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
trace: make symbol resolution more efficient

Fixes two issues:

  - when addr is in cache we call the delegate instead of
    returning from cache

  - we didn't cache the delegate's result so if we didn't have the
    symbol we always had to browse through our tables (but they don't
    change).

Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Another osv::demangle() variant

Add a second osv::demangle() variant which returns a unique_ptr to a newly
allocated buffer. This will allow callers like elf.cc to stop using the
obscure and probably non-standard internal gcc API.

The reason that I return a std::unique_ptr<char> instead of std::string
is a silly concern about performance: The gcc API already allocates
memory for the demangled name, and std::string cannot "adopt" some
already-allocated memory and needs to allocate again, and copy. On the
other hand, std::unique_ptr<char> simply wraps the already allocated
memory, and has zero performance overhead when compared to the underlying
gcc demangling API.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>