This patch adds the majority of the work needed for writing binary ELF stub files. While only the dynamic entries are written as contents, most of this patch involves the surrounding framework of an ELF file that allows the .dynamic and .dynstr sections to exist happily.
Added:
- Writes section headers.
- Writes two program headers (PT_DYNAMIC and a PT_LOAD).
- Writes .dynstr (only containing strings from .dynamic).
- Writes .dynamic.
- Writes .shstrtab.
This patch is very large, and may later be broken down if possible.
{{.*$}} can just be omitted. Many other tests do this.
If you want to use FileCheck --match-full-lines to omit the regex in 4096{{$}}, they have to be kept.