1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 12:43:36 +01:00
llvm-mirror/test/Object
Georgii Rymar 0e596f45f4 [llvm-readelf/obj] - Allow dumping of ELF header even if some elements are corrupt.
For creating `ELFObjectFile` instances we have the factory method
`ELFObjectFile<ELFT>::create(MemoryBufferRef Object)`.

The problem of this method is that it scans the section header to locate some sections.
When a file is truncated or has broken fields in the ELF header, this approach does
not allow us to create the `ELFObjectFile` and dump the ELF header.

This is https://bugs.llvm.org/show_bug.cgi?id=40804

This patch suggests a solution - it allows to delay scaning sections in the
`ELFObjectFile<ELFT>::create`. It now allows user code to call an object
initialization (`initContent()`) later. With that it is possible,
for example, for dumpers just to dump the file header and exit.
By default initialization is still performed as before, what helps to keep
the logic of existent callers untouched.

I've experimented with different approaches when worked on this patch.
I think this approach is better than doing initialization of sections (i.e. scan of them)
on demand, because normally users of `ELFObjectFile` API expect to work with a valid object.
In most cases when a section header table can't be read (because of an error), we don't
have to continue to work with object. So we probably don't need to implement a more complex API.

Differential revision: https://reviews.llvm.org/D90903
2020-11-09 11:27:07 +03:00
..
AArch64
AMDGPU [AMDGPU] Add gfx1033 target 2020-11-03 16:27:48 +00:00
ARM
Inputs
Lanai
Mips
RISCV
X86
ar-create.test
ar-error.test
archive-darwin-duplicates.test
archive-delete.test
archive-error-tmp.txt
archive-extract-dir.test
archive-extract.test
archive-format.test
archive-long-filenames-no-null-terminator.test
archive-long-index.test
archive-malformed-object.test
archive-move.test
archive-pad.test
archive-replace-pos.test
archive-symtab.test [llvm-ar][Object] Fix detection of need for 64-bit archive symbol tables 2020-10-26 12:29:28 +00:00
archive-thin-create.test
archive-thin-paths.test
archive-thin-read.test
archive-toc.test
archive-unknown-filetype.test
archive-update.test
check_binary_output.ll
coff-archive-short.test
coff-archive.test
coff-empty-drectve.test
coff-invalid.test
coff-weak-externals.test
directory.ll
dllimport-globalref.ll
dllimport.ll
dyn-rel-relocation.test
dynamic-reloc.test
elf-unknown-type.test
invalid-alignment.test
invalid.test [llvm-readelf/obj] - Allow dumping of ELF header even if some elements are corrupt. 2020-11-09 11:27:07 +03:00
kext.test
macho-invalid.test
mangle-ir.ll
multi-module.ll
multiple-sections.yaml
nm-archive.test
nm-bitcode.test
nm-darwin-m.test
nm-error.test
nm-irix6.test
nm-pe-image.test
nm-shared-object.test
nm-tapi-invalids.test
nm-tapi.test
nm-trivial-object.test
nm-universal-binary.test
nm-weak-global-macho.test
obj2yaml.test
objc-imageinfo-coff.ll
objc-imageinfo-elf.ll
objc-imageinfo-macho.ll
objc-swift-mixed-imageinfo-macho.ll
objdump-export-list.test
objdump-no-sectionheaders.test
objdump-private-headers.test
objdump-relocations.test
objdump-section-content.test
objdump-sectionheaders.test
objdump-symbol-table.test
pr25877.test
relocation-executable.test
simple-archive.test
size-trivial-macho.test
stackmap-dump.test
wasm-bad-metadata-version.yaml
wasm-duplicate-name.test
wasm-invalid-file.yaml
wasm-invalid-section-order.test
wasm-invalid-start.test
wasm-missing-version.test
wasm-relocs-and-producers.yaml [WebAssembly] Added .tabletype to asm and multiple table support in obj files 2020-10-13 07:52:23 -07:00
wasm-string-outside-section.test
yaml2obj-elf-rel-noref.yaml
yaml2obj-elf-rel.yaml
yaml2obj-readobj.test