1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 12:33:33 +02:00
llvm-mirror/include/llvm/Object
Rafael Espindola e8ff3dd7fa 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.

llvm-svn: 240176
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 Revert "[Object, ELF] Fix segmentation fault in ELFFile::getSectionName()." 2015-06-04 23:58:31 +00:00
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 [obj2yaml/yaml2obj] Add SHT_MIPS_ABIFLAGS section support 2015-05-07 15:40:48 +00:00
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