diff options
author | Pavel Labath <labath@google.com> | 2017-01-31 23:09:46 +0000 |
---|---|---|
committer | Pavel Labath <labath@google.com> | 2017-01-31 23:09:46 +0000 |
commit | 23ccc29197fdac683e8744f7a9bc05766e6099bb (patch) | |
tree | c11ee2f9f0a15f0b6e1b4e10fc850d7436082685 /llvm/lib/CodeGen/MachineBlockPlacement.cpp | |
parent | 06fcea4cd92ecedb8ddcebbe80650d2e92baf2db (diff) | |
download | bcm5719-llvm-23ccc29197fdac683e8744f7a9bc05766e6099bb.tar.gz bcm5719-llvm-23ccc29197fdac683e8744f7a9bc05766e6099bb.zip |
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
Diffstat (limited to 'llvm/lib/CodeGen/MachineBlockPlacement.cpp')
0 files changed, 0 insertions, 0 deletions