llvm-project/lldb/lit/Modules
Pavel Labath 43ddbc0b6c ELF: Fix base address computation code for files generated by yaml2obj
The code was assuming that the elf file will have a PT_LOAD segment
starting from the first byte of the file. While this is true for files
generated by most linkers (it's a way of saving space), it is not a
requirement. And files not satisfying this constraint can still be
perfectly executable. yaml2obj is one of the tools which produces files
like this.

This patch relaxes the check in ObjectFileELF to take the address of the
first PT_LOAD segment as the base address of the object (instead of the
one with the offset 0). Since the PT_LOAD segments are supposed to be
sorted according to the VM address, this entry will also be the one with
the lowest VM address.

If we ever run into files which don't have the PT_LOAD segments sorted,
we can easily change this code to return the lowest VM address as the
base address (if that is the correct thing to do for these files).

llvm-svn: 350923
2019-01-11 10:18:40 +00:00
..
Breakpad ObjectFileBreakpad: Implement sections 2019-01-07 11:14:08 +00:00
ELF ELF: Fix base address computation code for files generated by yaml2obj 2019-01-11 10:18:40 +00:00
MachO ELF: Don't create sections for section header index 0 2018-12-18 15:56:45 +00:00
PECOFF PECOFF: Fix section name computation 2019-01-10 10:23:19 +00:00
lit.local.cfg ELF: Replace the header-extension unit test with a lit one 2018-07-19 14:38:30 +00:00