Skip to content
Langston Barrett edited this page Jun 24, 2020 · 3 revisions

Overview

The renovate library provides a general facility for rewriting binaries for multiple architectures.

Debugging Tools and Strategies

ELF Loading Problems

Crashes in the TLS setup code in glibc early in execution (before main) usually indicate that the structure of the ELF file we have created is not acceptable to some combination of glibc or the kernel ELF loader. Crashes before _start are similar and indicate that the kernel ELF loader gave up before even starting our binary due to it being malformed. In the first case, the kernel communicates some basic load parameters to the program being run through what is known as the “aux” vector (which is processed by `_dl_aux_init` in glibc). There are two strategies for this type of problem:

  1. If execution reaches the program at all, stepping through the code in the TLS setup functions can be informative
  2. Ultimately, adding tracing statements (e.g., printk) in the kernel ELF loader (fs/binfmt_elf.c) is usually the most informative

Tracing your running kernel is not advised. Qemu can support all of the platforms we target, and is convenient. See the page Qemu Kernel Tracing for details.

Clone this wiki locally