llvm-6502/lib
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
..
Analysis Typo. NFC. 2015-06-19 17:32:57 +00:00
AsmParser Fixed/added namespace ending comments using clang-tidy. NFC 2015-06-19 15:57:42 +00:00
Bitcode Fixed/added namespace ending comments using clang-tidy. NFC 2015-06-19 15:57:42 +00:00
CodeGen MIR Parser: report an error when a basic block isn't found. 2015-06-19 20:12:03 +00:00
DebugInfo Make getRelocationSection MachO only. 2015-06-19 17:54:28 +00:00
ExecutionEngine Improve error handling of getRelocationAddend. 2015-06-19 20:58:43 +00:00
Fuzzer [lib/Fuzzer] make assertions more informative and update comments for the user-supplied mutator 2015-05-30 17:33:13 +00:00
IR Fixed/added namespace ending comments using clang-tidy. NFC 2015-06-19 15:57:42 +00:00
IRReader Return a unique_ptr from getLazyBitcodeModule and parseBitcodeFile. NFC. 2015-06-16 22:27:55 +00:00
LibDriver Fixed/added namespace ending comments using clang-tidy. NFC 2015-06-19 15:57:42 +00:00
LineEditor Use ADDITIONAL_HEADER_DIRS in all LLVM CMake projects. 2015-02-11 03:28:02 +00:00
Linker Fixed/added namespace ending comments using clang-tidy. NFC 2015-06-19 15:57:42 +00:00
LTO Return a unique_ptr from getLazyBitcodeModule and parseBitcodeFile. NFC. 2015-06-16 22:27:55 +00:00
MC Fix header path in CMake. NFC. 2015-06-19 20:49:02 +00:00
Object Make getRelocationSection MachO only. 2015-06-19 17:54:28 +00:00
Option Fixed/added namespace ending comments using clang-tidy. NFC 2015-06-19 15:57:42 +00:00
Passes [PM] Fixup for r231556 where I missed a dependency on intrinsics 2015-03-07 09:08:20 +00:00
ProfileData Fixed/added namespace ending comments using clang-tidy. NFC 2015-06-19 15:57:42 +00:00
Support Fixed/added namespace ending comments using clang-tidy. NFC 2015-06-19 15:57:42 +00:00
TableGen Fixed/added namespace ending comments using clang-tidy. NFC 2015-06-19 15:57:42 +00:00
Target Improve error handling of getRelocationAddend. 2015-06-19 20:58:43 +00:00
Transforms [LoopDist] Rename RuntimeCheckEmitter to LoopVersioning, NFC 2015-06-19 19:32:48 +00:00
CMakeLists.txt LibDriver, llvm-lib: introduce. 2015-06-09 21:50:22 +00:00
LLVMBuild.txt Wrap some long lines in LLVMBuild files. NFC 2015-06-12 18:44:57 +00:00
Makefile LibDriver, llvm-lib: introduce. 2015-06-09 21:50:22 +00:00