Go to file
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
clang Fix modules codegen to be compatible with modules-ts 2017-01-31 21:28:19 +00:00
clang-tools-extra Revert "Implement a new clang-tidy check that suggests users replace dynamic exception specifications with noexcept exception specifications." 2017-01-27 07:19:22 +00:00
compiler-rt [sanitizer] Fix interface tests when SANITIZER_CAN_USE_CXXABI is true. 2017-01-31 22:57:55 +00:00
debuginfo-tests New round of fixes for "Always compile debuginfo-tests for the host triple" 2014-10-18 23:47:59 +00:00
libclc math: Add logb builtin 2017-01-18 03:14:10 +00:00
libcxx Fix up some no-exception compile failures 2017-01-31 13:12:32 +00:00
libcxxabi Add support for demangling C++11 thread_local variables. In clang, the grammar for mangling for these names are "<special-name> ::= TW <object name>" for wrapper variables or "<special-name> ::= TH <object name>" for initialization variables. 2017-01-31 15:18:56 +00:00
libunwind Revert "DWARF: convert error logs to _LIBUNWIND_LOG" 2017-01-27 02:26:52 +00:00
lld Print alignment in decimal instead of hexadecimal. 2017-01-31 20:42:34 +00:00
lldb Open ELF core dumps with more than 64K sections 2017-01-31 23:09:46 +00:00
llgo [llgo] Remove support for LLVM attributes 2016-12-06 19:22:04 +00:00
llvm [NVPTX] Compute approx sqrt as 1/rsqrt(x) rather than x*rsqrt(x). 2017-01-31 23:08:57 +00:00
openmp Correct wrong comment in bug_nested_proxy_task.c 2017-01-30 09:51:02 +00:00
parallel-libs [Axccel] Remove -Wno-missing-braces in build 2016-12-19 21:34:07 +00:00
polly Update the documentation on how the packing transformation is implemented 2017-01-29 10:37:50 +00:00