| commit | e976622e2d7464b09fcf0141291003bf5fe9fd6f | [log] [tgz] |
|---|---|---|
| author | Tomohiro Kashiwada <kikairoya@gmail.com> | Tue Sep 09 19:10:28 2025 +0900 |
| committer | GitHub <noreply@github.com> | Tue Sep 09 13:10:28 2025 +0300 |
| tree | d283c833eb33ca239cc9541c7f7411ce35d079d3 | |
| parent | a0b8d548fd250c92c8f9274b57e38ad3f0b215e9 [diff] |
[LLD][COFF] Prevent to emit relocations for discarded weak wrapped symbols (#156214) When a symbol is imported from a DLL, a base relocation record is normally emitted. However, if the import is pulled in via a wrapped symbol (using `--wrap`) and later dropped because it is only referenced weakly, a dangling base relocation remains in the output. At runtime, this relocation changes the symbol value from null to a garbage pointer. This patch adds checks to avoid emitting relocation records for non-`Defined` symbols, and to prevent creating an auto-import entry if an import entry for the wrapped symbol already exists. Fixes https://github.com/llvm/llvm-project/issues/150739
Welcome to the LLVM project!
This repository contains the source code for LLVM, a toolkit for the construction of highly optimized compilers, optimizers, and run-time environments.
The LLVM project has multiple components. The core of the project is itself called “LLVM”. This contains all of the tools, libraries, and header files needed to process intermediate representations and convert them into object files. Tools include an assembler, disassembler, bitcode analyzer, and bitcode optimizer.
C-like languages use the Clang frontend. This component compiles C, C++, Objective-C, and Objective-C++ code into LLVM bitcode -- and from there into object files, using LLVM.
Other components include: the libc++ C++ standard library, the LLD linker, and more.
Consult the Getting Started with LLVM page for information on building and running LLVM.
For information on how to contribute to the LLVM project, please take a look at the Contributing to LLVM guide.
Join the LLVM Discourse forums, Discord chat, LLVM Office Hours or Regular sync-ups.
The LLVM project has adopted a code of conduct for participants to all modes of communication within the project.