llvm-project/lldb
Pavel Labath 23ccc29197 Open ELF core dumps with more than 64K sections
Summary:
Problem:

There are three filelds in the ELF header - e_phnum, e_shnum, and e_shstrndx -
that could be bigger than 64K and therefore do not fit in 16 bits reserved for
them in the header. If this happens, pretty often there is a special section at
index 0 which contains their real values for these fields in the section header
in the fields sh_info, sh_size, and sh_link respectively.

Fix:

- Rename original fields in the header declaration. We want to have them around
just in case.

- Reintroduce these fields as 32-bit members at the end of the header. By default
they are initialized from the header in Parse() method.

- In Parse(), detect the situation when the header might have been extended into
section info #0 and try to read it from the same data source.

- ObjectFileELF::GetModuleSpecifications accesses some of these fields but the
original parse uses too small data source. Re-parse the header if necessary
using bigger data source.

- ProcessElfCore::CreateInstance uses header with potentially sentinel values,
but it does not access these fields, so a comment here is enough.

Reviewers: labath

Reviewed By: labath

Subscribers: davidb, lldb-commits, mgorny

Differential Revision: https://reviews.llvm.org/D29095
Author: Eugene Birukov <eugenebi@hotmail.com>

llvm-svn: 293714
2017-01-31 23:09:46 +00:00
..
cmake [CMake] Add explicit dependencies to plugins 2017-01-31 22:12:59 +00:00
docs Small tweaks to the markup in StructuredDataPlugins. 2016-12-13 05:59:24 +00:00
examples Improve crashlog.py so it can handle more iOS crashlog files. 2016-12-08 00:22:45 +00:00
include/lldb Unroll r292930 due to TestCallThatThrows test fail is not fixed in reasonable time. 2017-01-27 07:51:43 +00:00
lit [CMake] Fix standalone build 2016-10-21 18:38:44 +00:00
lldb.xcodeproj Remove SymbolFilePDBTests.cpp from the list of tests to include in the 2017-01-04 00:01:25 +00:00
lldb.xcworkspace Revert r275223, which committed the wrong thing. 2016-07-12 23:31:42 +00:00
packages/Python/lldbsuite Move the stop point to somewhere before the final use of the 2017-01-31 18:26:20 +00:00
resources Bump the lldb version # in the xcode project files from 2016-03-15 04:36:11 +00:00
scripts Install lldb Python module on Windows. 2017-01-06 22:05:35 +00:00
source Open ELF core dumps with more than 64K sections 2017-01-31 23:09:46 +00:00
test [CMake] Only support LLDB_BUILD_FRAMEWORK on CMake 3.7 and later 2016-12-15 18:18:47 +00:00
third_party/Python/module *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
tools [CMake] Partial revert of r293686 2017-01-31 21:12:52 +00:00
unittests Open ELF core dumps with more than 64K sections 2017-01-31 23:09:46 +00:00
utils *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
www Fix weak symbol linkage in SBStructuredData, update docs. 2016-11-09 23:21:04 +00:00
.arcconfig Upgrade all the .arcconfigs to https. 2016-07-14 13:15:37 +00:00
.clang-format Updated .clang-format rules so bring LLDB in line with LLVM standards. 2016-09-06 17:19:00 +00:00
.gitignore test infra: clear file-charged issues on rerun of file 2016-10-01 00:17:08 +00:00
CMakeLists.txt [cmake] Make lldb build with the android ndk toolchain file 2017-01-17 11:55:00 +00:00
CODE_OWNERS.txt Removing myself from code ownership file 2016-12-12 22:42:00 +00:00
INSTALL.txt
LICENSE.TXT
use_lldb_suite_root.py *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00