llvm-project/lldb
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
..
cmake [CMake] In standalone builds, LLVM_BINARY_DIR should point to LLVM's binary directory 2019-01-09 16:25:37 +00:00
docs Add a description of the similar packets defined in the 2018-12-16 18:44:54 +00:00
examples Fix lldb's macosx/heap.py cstr command. 2018-12-17 18:21:51 +00:00
include/lldb Change SymbolFile::ParseTypes to ParseTypesForCompileUnit. 2019-01-10 20:57:50 +00:00
lit ELF: Fix base address computation code for files generated by yaml2obj 2019-01-11 10:18:40 +00:00
lldb.xcodeproj Remove Range.* from Xcode project 2019-01-02 22:23:51 +00:00
lldb.xcworkspace Fix a typo in the gtest build target for Debug configuration. 2018-04-10 17:49:56 +00:00
packages/Python/lldbsuite lldbtest.py: try to fix a runtime exception 2019-01-10 19:06:46 +00:00
resources [CMake] Revised LLDB.framework builds 2019-01-04 12:46:50 +00:00
scripts [Python] Update PyString_FromString() to work for python 2 and 3. 2019-01-09 22:52:47 +00:00
source ELF: Fix base address computation code for files generated by yaml2obj 2019-01-11 10:18:40 +00:00
test [CMake] Revised LLDB.framework builds 2019-01-04 12:46:50 +00:00
third_party/Python/module [dotest] Consider unexpected passes as failures. 2018-12-20 20:44:23 +00:00
tools Implement ObjectFileELF::GetBaseAddress 2019-01-10 09:32:31 +00:00
unittests [Scalar] Simplify comparison operators and add coverage. 2019-01-04 19:23:52 +00:00
utils Fix typos. 2018-10-04 22:33:39 +00:00
www [CMake] Fix standalone builds: workaround the cxx target not getting imported yet (unlike clang target) 2019-01-09 16:25:31 +00:00
.arcconfig
.clang-format
.gitignore [dotest] Remove crashinfo hook 2018-01-10 10:18:47 +00:00
CMakeLists.txt [CMake] In standalone builds, LLVM_BINARY_DIR should point to LLVM's binary directory 2019-01-09 16:25:37 +00:00
CODE_OWNERS.txt Fix/unify the spelling of Objective-C. 2018-06-13 16:21:24 +00:00
INSTALL.txt Changed builld-llvm.py to use .json files 2017-02-23 02:21:34 +00:00
LICENSE.TXT
use_lldb_suite_root.py