llvm/test/Object/Inputs
Rafael Espindola 7edd010739 Improve error handling of getRelocationAddend.
This patch changes getRelocationAddend to use ErrorOr and considers it an error
to try to get the addend of a REL section.

If, for example, a x86_64 file has a REL section, that file is corrupted and
we should reject it.

Using ErrorOr is not ideal since we check the section type once per relocation
instead of once per section.

Checking once per section would involve getRelocationAddend just asserting and
callers checking the section before iterating over the relocations.

In any case, this is an improvement and includes a test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240176 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-19 20:58:43 +00:00
..
COFF
ELF
absolute.elf-x86-64
archive-test.a-coff-i386
archive-test.a-corrupt-symbol-table
archive-test.a-empty
archive-test.a-gnu-minimal
archive-test.a-gnu-no-symtab
archive-test.a-irix6-mips64el
coff_archive_short.lib
coff_archive.lib
common.coff-i386
corrupt-archive.a
corrupt-version.elf-x86_64
corrupt.elf-x86-64
darwin-m-test1.mach0-armv7
darwin-m-test2.macho-i386
darwin-m-test3.macho-x86-64
dext-test.elf-mips64r2
elf-reloc-no-sym.x86_64
elf-versioning-test.i386
elf-versioning-test.x86_64
elfver.S
elfver.script
evenlen
GNU.a
hello-world.elf-x86-64
hello-world.macho-x86_64
invalid-bad-rel-type.elf
IsNAN.o
liblong_filenames.a
libsimple_archive.a
macho64-invalid-incomplete-load-command
macho64-invalid-incomplete-segment-load-command
macho64-invalid-no-size-for-sections
macho64-invalid-too-small-load-command
macho64-invalid-too-small-segment-load-command
macho-archive-unsorted-x86_64.a
macho-archive-x86_64.a
macho-data-in-code.macho-thumbv7
macho-empty-kext-bundle-x86-64
macho-hello-g.macho-x86_64
macho-invalid-bad-symbol-index
macho-invalid-header
macho-invalid-no-size-for-sections
macho-invalid-section-index-getSectionRawName
macho-invalid-symbol-name-past-eof
macho-invalid-too-small-load-command
macho-invalid-too-small-segment-load-command
macho-invalid-zero-ncmds
macho-no-exports.dylib
macho-rpath-x86_64
macho-text-data-bss.macho-x86_64
macho-text-sections.macho-x86_64
macho-text.thumb
macho-universal-archive.x86_64.i386
macho-universal.x86_64.i386
MacOSX.a
micro-mips.elf-mipsel
mri-crlf.mri
no-sections.elf-x86-64
no-start-symbol.elf-x86_64
oddlen
program-headers.elf-i386
program-headers.elf-x86-64
program-headers.mips
program-headers.mips64
relocatable-with-section-address.elf-x86-64
relocation-dynamic.elf-i386
relocation-relocatable.elf-i386
relocations.elf-x86-64
sectionGroup.elf.x86-64
shared-object-test.elf-i386
shared-object-test.elf-x86-64
shared.ll
SVR4.a
thin.a
thumb-symbols.elf.arm
trivial-executable-test.macho-x86-64
trivial-label-test.elf-x86-64
trivial-object-test2.elf-x86-64
trivial-object-test.coff-i386
trivial-object-test.coff-x86-64
trivial-object-test.elf-hexagon
trivial-object-test.elf-i386
trivial-object-test.elf-mips64el
trivial-object-test.elf-mipsel
trivial-object-test.elf-x86-64
trivial-object-test.macho-i386
trivial-object-test.macho-x86-64
trivial.ll
unwind-section.elf-x86-64
very_long_bytecode_file_name.bc
weak-global-symbol.macho-i386
weak.elf-x86-64
xpg4.a