llvm-project/llvm/lib/Object
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
..
Archive.cpp [Object][Archive] Support a new archive member /<ECSYMBOLS>/ 2022-06-06 17:20:56 -07:00
ArchiveWriter.cpp [Object] Fix updating darwin archives 2022-05-19 10:56:26 -07:00
Binary.cpp [Binary] Promote OffloadBinary to inherit from Binary 2022-06-01 18:40:57 -04:00
CMakeLists.txt [Object][DX] Initial DXContainer parsing support 2022-05-02 13:56:33 -05:00
COFFImportFile.cpp Cleanup LLVMObject headers 2022-02-10 21:13:44 +01:00
COFFModuleDefinition.cpp Cleanup LLVMObject headers 2022-02-10 21:13:44 +01:00
COFFObjectFile.cpp [COFF] Don't reject executables with data directories pointing outside of provided data 2022-06-15 16:51:20 +03:00
DXContainer.cpp [DX][ObjYAML] Support for parsing DXIL part 2022-06-06 18:46:19 -05:00
Decompressor.cpp Cleanup LLVMObject headers 2022-02-10 21:13:44 +01:00
ELF.cpp [llvm-objdump] --private-headers: change errors to warnings for dynamic section dumping 2022-03-28 01:00:43 -07:00
ELFObjectFile.cpp [llvm-objdump] Let --symbolize-operands symbolize basic block addresses based on the SHT_LLVM_BB_ADDR_MAP section. 2022-05-16 10:11:11 -07:00
Error.cpp [COFF] Check table ptr more thoroughly and ignore empty sections 2022-06-03 18:31:01 +03:00
FaultMapParser.cpp
IRObjectFile.cpp Cleanup includes: DebugInfo & CodeGen 2022-03-12 17:26:40 +01:00
IRSymtab.cpp Cleanup LLVMObject headers 2022-02-10 21:13:44 +01:00
MachOObjectFile.cpp [dsymutil] Apply relocations present in Swift reflection sections 2022-03-17 14:23:20 -03:00
MachOUniversal.cpp Cleanup LLVMObject headers 2022-02-10 21:13:44 +01:00
MachOUniversalWriter.cpp Apply clang-tidy fixes for readability-redundant-smartptr-get in MachOUniversalWriter.cpp (NFC) 2022-03-28 09:18:35 -07:00
Minidump.cpp
ModuleSymbolTable.cpp Cleanup LLVMObject headers 2022-02-10 21:13:44 +01:00
Object.cpp [Binary] Promote OffloadBinary to inherit from Binary 2022-06-01 18:40:57 -04:00
ObjectFile.cpp [Binary] Promote OffloadBinary to inherit from Binary 2022-06-01 18:40:57 -04:00
OffloadBinary.cpp [Binary] Make the OffloadingImage type own the memory 2022-06-07 15:56:09 -04:00
RecordStreamer.cpp
RecordStreamer.h [MC] De-capitalize MCStreamer functions 2022-06-07 00:31:02 -07:00
RelocationResolver.cpp [Object] Support relocation resolver for CSKY 2022-05-13 13:38:17 +08:00
SymbolSize.cpp [llvm-objdump][XCOFF] Enable the -l (--line-numbers) option. 2021-06-10 04:37:06 +00:00
SymbolicFile.cpp Cleanup includes: DebugInfo & CodeGen 2022-03-12 17:26:40 +01:00
TapiFile.cpp Cleanup LLVMObject headers 2022-02-10 21:13:44 +01:00
TapiUniversal.cpp Apply clang-tidy fixes for readability-redundant-smartptr-get in TapiUniversal.cpp (NFC) 2022-03-28 09:18:36 -07:00
WasmObjectFile.cpp [WebAssembly] Add WASM_SEC_LAST_KNOWN to BinaryFormat section types list [NFC] 2022-06-07 12:05:23 -07:00
WindowsMachineFlag.cpp
WindowsResource.cpp Cleanup LLVMObject headers 2022-02-10 21:13:44 +01:00
XCOFFObjectFile.cpp [llvm-objcopy] Initial XCOFF32 support. 2022-02-28 04:59:46 -05:00