llvm-project/llvm/lib
Martin Storsjö b209b9e11c [COFF] Don't reject executables with data directories pointing outside of provided data
Before bb94611d65, we didn't check
that the sections in the COFF executable actually contained enough
raw data, when looking up what section contains tables pointed to
by the data directories.

That commit added checking, to avoid setting a pointer that points
out of bounds - by rejecting such executables.

It turns out that some binaries (e.g.g a "helper.exe" provided by
NSIS) contains a base relocation table data directory that points
into the wrong section. It points inside the virtual address space
allocated for that section, but the section contains much less raw
data, and the table points outside of the provided raw data.

No longer reject such binaries (to let tools operate on them and
inspect them), but don't set the table pointers (so that when
printing e.g. base relocations, we don't print anything).

This should fix the regression pointed out in
https://reviews.llvm.org/D126898#3565834.

Differential Revision: https://reviews.llvm.org/D127345
2022-06-15 16:51:20 +03:00
..
Analysis FunctionPropertiesAnalysis: handle callsite BBs that lose edges 2022-06-14 15:19:44 -07:00
AsmParser Add sanitizer-specific GlobalValue attributes. 2022-06-10 12:28:18 -07:00
BinaryFormat [Binary] Promote OffloadBinary to inherit from Binary 2022-06-01 18:40:57 -04:00
Bitcode [BitcodeReader] Remove unnecessary argument defaults (NFC) 2022-06-15 13:24:13 +02:00
Bitstream
CodeGen Add a conversion from double to bf16 2022-06-15 12:56:31 +02:00
DWARFLinker [MC] De-capitalize SwitchSection. NFC 2022-06-10 22:50:55 -07:00
DWP [MC] De-capitalize SwitchSection. NFC 2022-06-10 22:50:55 -07:00
DebugInfo Use getValueOr (NFC) 2022-06-11 11:24:57 -07:00
Debuginfod Fix buildbot failures from 7917b3c6. 2022-03-21 17:58:22 +00:00
Demangle [MicrosoftDemangle] Set error to true when returning nullptr. 2022-06-08 17:18:09 -07:00
ExecutionEngine [JITLink][ELF][AArch64] Implement R_AARCH64_MOVW_UABS_G*_NC. 2022-06-14 14:06:59 +09:00
Extensions
FileCheck [FileCheck] Catch missspelled directives. 2022-05-26 11:37:19 +01:00
Frontend [OpenMP][IRBuilder] Add final clause to task 2022-06-11 00:02:18 +05:30
FuzzMutate Reland "[FuzzMutate] Split out FuzzerCLI library that doesn't depend on IR." 2022-05-07 13:49:54 +02:00
Fuzzer
IR freeze does not change the constant property 2022-06-14 19:53:26 +03:00
IRReader
InterfaceStub Use getValueOr (NFC) 2022-06-11 11:24:57 -07:00
LTO [config] Remove vestigial LLVM_VERSION_INFO 2022-06-07 11:36:26 -07:00
LineEditor [llvm][lldb] use FindLibEdit.cmake everywhere 2022-05-12 15:59:41 -07:00
Linker Support the min of module flags when linking, use for AArch64 BTI/PAC-RET 2022-04-13 09:31:51 +02:00
MC [NFC][Alignment] Use Align in MCAlignFragment 2022-06-15 12:31:00 +00:00
MCA
ObjCopy [WebAssembly] Add WASM_SEC_LAST_KNOWN to BinaryFormat section types list [NFC] 2022-06-07 12:05:23 -07:00
Object [COFF] Don't reject executables with data directories pointing outside of provided data 2022-06-15 16:51:20 +03:00
ObjectYAML [DX][ObjYAML] Zero out unused fields that get written to the output file 2022-06-07 16:29:28 +02:00
Option [Driver] Simplify hasFlag pattern with addOptInFlag/addOptOutFlag helpers 2022-04-11 12:29:25 -07:00
Passes Remove unneeded cl::ZeroOrMore for cl::opt/cl::list options 2022-06-05 00:31:44 -07:00
ProfileData [ProfileData] Use llvm::erase_if (NFC) 2022-06-10 22:51:30 -07:00
Remarks
Support [Support] Use default member initialization (NFC) 2022-06-12 18:46:25 -07:00
TableGen [llvm] Convert for_each to range-based for loops (NFC) 2022-06-05 12:07:14 -07:00
Target [NFC][Alignment] Use Align in MCAlignFragment 2022-06-15 12:31:00 +00:00
Testing
TextAPI
ToolDrivers [llvm-lib] Ignore /LTCG option 2022-05-27 11:38:42 -07:00
Transforms [SLP] Improve reordering in presence of constant only nodes. 2022-06-15 06:17:34 -07:00
WindowsDriver
WindowsManifest [llvm] Fix typo for libxml2 detection 2022-05-17 08:45:31 +00:00
XRay
CMakeLists.txt