llvm-project/lldb/source
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
..
API [CMake] Python bindings generation polishing 2019-01-04 12:47:02 +00:00
Breakpoint Change std::sort to llvm::sort to detect non-determinism. 2019-01-08 23:25:06 +00:00
Commands Revert "Add a verbose mode to "image dump line-table" and use it to write a .debug_line test" 2019-01-10 10:23:27 +00:00
Core Change SymbolFile::ParseTypes to ParseTypesForCompileUnit. 2019-01-10 20:57:50 +00:00
DataFormatters Simplify Boolean expressions 2018-12-15 00:15:33 +00:00
Expression [opaque pointer types] Remove some calls to generic Type subtype accessors. 2019-01-10 16:07:20 +00:00
Host [lldb-server] Add unnamed pipe support to PipeWindows 2019-01-10 00:46:09 +00:00
Initialization [Reproducers] Change how reproducers are initialized. 2018-12-03 17:28:29 +00:00
Interpreter Change std::sort to llvm::sort to detect non-determinism. 2019-01-08 23:25:06 +00:00
Plugins ELF: Fix base address computation code for files generated by yaml2obj 2019-01-11 10:18:40 +00:00
Symbol Change SymbolFile::ParseTypes to ParseTypesForCompileUnit. 2019-01-10 20:57:50 +00:00
Target Change std::sort to llvm::sort to detect non-determinism. 2019-01-08 23:25:06 +00:00
Utility Change std::sort to llvm::sort to detect non-determinism. 2019-01-08 23:25:06 +00:00
CMakeLists.txt Remove Plugins/Process/POSIX from include_directories 2017-04-11 12:26:25 +00:00
lldb.cpp Run clang-format on lldb.cpp 2017-11-02 16:56:52 +00:00