[Object] Split the ELF interface into 3 parts.

* ELFTypes.h contains template magic for defining types based on endianess, size, and alignment.
* ELFFile.h defines the ELFFile class which provides low level ELF specific access.
* ELFObjectFile.h contains ELFObjectFile which uses ELFFile to implement the ObjectFile interface.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188022 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Michael J. Spencer
2013-08-08 22:27:13 +00:00
parent 491d04969d
commit 081a1941b5
17 changed files with 2845 additions and 2761 deletions

Binary file not shown.

Binary file not shown.

24
test/Object/corrupt.test Normal file
View File

@ -0,0 +1,24 @@
// Section name offset overflows section name string table.
RUN: not llvm-readobj %p/Inputs/corrupt.elf-x86-64 -sections \
RUN: 2>&1 | FileCheck --check-prefix=SECNAME %s
// Section data offset past end of file.
RUN: not llvm-readobj %p/Inputs/corrupt.elf-x86-64 -sections -section-data \
RUN: 2>&1 | FileCheck --check-prefix=SECDATA %s
// Symbol name offset overflows string table.
RUN: not llvm-readobj %p/Inputs/corrupt.elf-x86-64 -symbols \
RUN: 2>&1 | FileCheck --check-prefix=SYMNAME %s
// Version index in .gnu.version overflows the version map.
RUN: not llvm-readobj %p/Inputs/corrupt-version.elf-x86_64 -dt \
RUN: 2>&1 | FileCheck --check-prefix=VER %s
SECNAME: Error reading file: Invalid data was encountered while parsing the file.
SECDATA: Error reading file: Invalid data was encountered while parsing the file.
SECDATA: Error reading file: Invalid data was encountered while parsing the file.
SYMNAME: Error reading file: Invalid data was encountered while parsing the file.
VER: Error reading file: Invalid data was encountered while parsing the file.