llvm-project/llvm
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
..
benchmarks
bindings [llvm-ocaml] Add and use opaque pointer compatible bindings 2022-06-02 11:42:24 +02:00
cmake Revert "[cmake] Don't export `LLVM_TOOLS_INSTALL_DIR` anymore" 2022-06-10 19:26:12 +00:00
docs Revert "Reland "[X86][RFC] Enable `_Float16` type support on X86 following the psABI"" 2022-06-15 13:24:24 +02:00
examples Remove unneeded cl::ZeroOrMore for cl::opt/cl::list options 2022-06-05 01:07:51 -07:00
include [NFC][Alignment] Use Align in MCAlignFragment 2022-06-15 12:31:00 +00:00
lib [COFF] Don't reject executables with data directories pointing outside of provided data 2022-06-15 16:51:20 +03:00
projects
resources
runtimes Revert "[runtimes] Detect changes to Tests.cmake" 2022-05-26 09:34:18 -07:00
test [COFF] Don't reject executables with data directories pointing outside of provided data 2022-06-15 16:51:20 +03:00
tools [dsymutil] Fix std::unique_ptr to llvm::Expected conversion 2022-06-14 16:10:48 -07:00
unittests FunctionPropertiesAnalysis: handle callsite BBs that lose edges 2022-06-14 15:19:44 -07:00
utils [gn build] (semi-automatically) port fb34d531af 2022-06-15 07:42:40 -04:00
.clang-format
.clang-tidy
.gitattributes
.gitignore
CMakeLists.txt [CMake] Enable LLVM_ENABLE_PER_TARGET_RUNTIME_DIR by default on Linux 2022-06-07 21:22:38 -07:00
CODE_OWNERS.TXT
CREDITS.TXT
LICENSE.TXT
README.txt
RELEASE_TESTERS.TXT
configure
llvm.spec.in

README.txt

The LLVM Compiler Infrastructure
================================

This directory and its subdirectories contain source code for LLVM,
a toolkit for the construction of highly optimized compilers,
optimizers, and runtime environments.

LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.

Please see the documentation provided in docs/ for further
assistance with LLVM, and in particular docs/GettingStarted.rst for getting
started with LLVM and docs/README.txt for an overview of LLVM's
documentation setup.

If you are writing a package for LLVM, see docs/Packaging.rst for our
suggestions.