llvm-6502/include/llvm/Object
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
..
Archive.h Fixed/added namespace ending comments using clang-tidy. NFC 2015-06-19 15:57:42 +00:00
ArchiveWriter.h Fixed/added namespace ending comments using clang-tidy. NFC 2015-06-19 15:57:42 +00:00
Binary.h Fixed/added namespace ending comments using clang-tidy. NFC 2015-06-19 15:57:42 +00:00
COFF.h Make getRelocationSection MachO only. 2015-06-19 17:54:28 +00:00
COFFYAML.h Fixed/added namespace ending comments using clang-tidy. NFC 2015-06-19 15:57:42 +00:00
ELF.h
ELFObjectFile.h Improve error handling of getRelocationAddend. 2015-06-19 20:58:43 +00:00
ELFTypes.h Avoid a "always true" warning from gcc. 2015-06-15 14:49:41 +00:00
ELFYAML.h
Error.h Remove object_error::success and use std::error_code() instead 2015-06-09 15:20:42 +00:00
IRObjectFile.h Fixed/added namespace ending comments using clang-tidy. NFC 2015-06-19 15:57:42 +00:00
MachO.h Make getRelocationSection MachO only. 2015-06-19 17:54:28 +00:00
MachOUniversal.h Fixed/added namespace ending comments using clang-tidy. NFC 2015-06-19 15:57:42 +00:00
ObjectFile.h Make getRelocationSection MachO only. 2015-06-19 17:54:28 +00:00
RelocVisitor.h Improve error handling of getRelocationAddend. 2015-06-19 20:58:43 +00:00
SymbolicFile.h Fixed/added namespace ending comments using clang-tidy. NFC 2015-06-19 15:57:42 +00:00