| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
[LLD/COFF] Fix link failure due to missing component. This was broken by https://github.com/llvm/llvm-project/commit/3923e61b96cf90123762f0e0381504efaba2d77a We should link BitWriter into LLD/COFF since now it uses WriteBitcodeToFile. | 2 年前 | |
[lld] Remove unused includes (NFC) (#141421) | 1 年前 | |
[LLD][COFF] Make /summary work when /debug isn't provided (#157476) Previously, /summary was meant to print some PDB information. Now move handling of /summary to Writer.cpp so that it can have an effect when /debug isn't provided. This will also provide grounds for extending with more general information. | 11 个月前 | |
[lld] Remove unused includes (NFC) (#141421) | 1 年前 | |
[lld-link] Replace error(...) with Err | 1 年前 | |
[LLD][COFF] Align EC code ranges to page boundaries (#168222) We already ensure that code for different architectures is always placed in different pages in assignAddresses. We represent those ranges using their first and last chunks. However, the RVAs of those chunks may not be page-aligned, for example, due to extra padding for entry-thunk offsets. Align the chunk RVAs to the page boundary so that the emitted ranges correctly include the entire region. This change affects an existing test that checks corner cases triggered by merging a data section into a code section. We may now include such data in the code range. This differs from MSVC’s behavior, but it should not cause practical issues, and the new behavior is arguably more correct. Fixes #168119. | 8 个月前 | |
[LLD][COFF] Deduplicate common chunks when linking COFF files. (#162553) This fixes [issue 162148](https://github.com/llvm/llvm-project/issues/162148). Common symbols are intended to have only a single version of the data present in the final executable. The MSVC linker is able to successfully deduplicate these chunks. If you have an application with a large number of translation units with a large block of common data (this is possible, for example, with Fortran code), then failing to deduplicate these chunks can make the data size so large that the resulting executable fails to load. The logic in this patch doesn't catch all of the potential cases for deduplication, but it should catch the most common ones. | 9 个月前 | |
[DTLTO][Clang][LLD] Fix DTLTO for multi-call LLVM driver toolchain (#162456) Add DTLTO linker option --thinlto-remote-compiler-prepend-arg to enable support for the multi-call LLVM driver that requires an additional option to specify the subcommand, e.g. "llvm clang ...". Fixes https://github.com/llvm/llvm-project/issues/159125. | 9 个月前 | |
[LLD] [COFF] Fix aarch64 delayimport of sret arguments (#163096) For sret arguments on aarch64, the x8 register is used as input parameter to functions, even though x8 normally isn't an input parameter register. When delayloading a DLL, the first call of a delayloaded function ends up calling a helper which resolves the function. Therefore, any input arguments to the actual function to be called need to be backed up and restored - this also includes x8. This matches how MS link.exe also changed its delayloading trampoline, between MSVC 2019 16.7 and 16.8 (between link.exe 14.27.29110.0 and 14.28.29333.0). This fixes running LLDB on aarch64 mingw, after ec28b95b7491bc2fbb6ec66cdbfd939e71255c42 and 93d326038959fd87fb666a8bf97d774d0abb3591. Those commits make LLDB load liblldb.dll with delayloading, and the first function to be called, SBDebugger::InitializeWithErrorHandling(), returns an SBError, which in the itanium C++ ABI is returned as an sret via a pointer in x8. | 9 个月前 | |
| 1 年前 | ||
[lld] Remove unused includes (NFC) (#141421) | 1 年前 | |
[LLD][COFF] Survive empty and invalid PCH signature Solve two issues that showed up when using LLD with Unreal Engine & FASTBuild: 1. It seems the S_OBJNAME record doesn't always record the "precomp signature". We were relying on that to match the PCH.OBJ with their dependent-OBJ. 2. MSVC link.exe is able to link a PCH.OBJ when the "precomp signatureÈ doesn't match, but LLD was failing. This was occuring since the Unreal Engine Build Tool was compiling the PCH.OBJ, but the dependent-OBJ were compiled & cached through FASTBuild. Upon a clean rebuild, the PCH.OBJs were recompiled by the Unreal Build Tool, thus the "precomp signatures" were changing; however the OBJs were already cached by FASTBuild, thus having an old "precomp signatures". We now ignore "precomp signatures" and properly fallback to cmd-line name lookup, like MSVC link.exe does, and only fail if the PCH.OBJ type stream doesn't match the count expected by the dependent-OBJ. Differential Revision: https://reviews.llvm.org/D136762 | 3 年前 | |
[DTLTO][Clang][LLD] Fix DTLTO for multi-call LLVM driver toolchain (#162456) Add DTLTO linker option --thinlto-remote-compiler-prepend-arg to enable support for the multi-call LLVM driver that requires an additional option to specify the subcommand, e.g. "llvm clang ...". Fixes https://github.com/llvm/llvm-project/issues/159125. | 9 个月前 | |
[LLD][COFF] Add support for custom section layout (#152779) MS link.exe provides the /sectionlayout:@ option to specify the order of output sections at the granularity of individual sections. LLD/COFF currently does not have capability for user-controlled ordering of one or more output sections (as LLD/COFF does not support linker scripts), and this PR adds the option to align with MS link.exe. The option accepts only a file that specifies the order of sections, one per line. For example, mylayout.txt could emit the .text section after all other sections while preserving the original relative order of the remaining sections. .data .rdata .pdata .rsrc .reloc .text bash echo 'int main() { return 0; }' > main.c cl main.c /link /entry:main /sectionlayout:@mylayout.txt llvm-readobj --sections main.exe | 11 个月前 | |
[lld] Add (ignored) /link flag to lld-link for compatibility with MSVC link.exe (#168364) Various build tools may produce command lines invoking clang-cl and lld-link which contain /link twice like so: e.g. clang-cl.exe sanitycheckcpp.cc /Fesanitycheckcpp.exe .... /link /link ... If link.exe is used, it ignores the extra /link and just issues a warning, however lld-link tries to treat /link as a file name. This PR adds a flag which is ignored in order to improve compatibility with link.exe There's some extra context including an "in-the-wild" example and reproducer of the problem here: https://github.com/frankier/meson_clang_win_activation Co-authored-by: Frankie Robertson <frankie@robertson.name> | 8 个月前 | |
[lld] Remove unused includes (NFC) (#141421) | 1 年前 | |
[LLD] Remove global state in lld/COFF Remove globals from the lldCOFF library, by moving globals into a context class. This patch mostly moves the config object into COFFLinkerContext. See https://lists.llvm.org/pipermail/llvm-dev/2021-June/151184.html for context about removing globals from LLD. Reviewed By: aganea Differential Revision: https://reviews.llvm.org/D110450 | 3 年前 | |
[LLD][COFF] Discard .llvmbc and .llvmcmd sections (#150897) Those sections are generated by -fembed-bitcode and do not need to be kept in executable files. | 1 年前 | |
[LLD][COFF] Implement support for hybrid IAT on ARM64X (#124189) In hybrid images, the PE header references a single IAT for both native and EC views, merging entries where possible. When merging isn't feasible, different imports are grouped together, and ARM64X relocations are emitted as needed. | 1 年前 | |
[lld] Use llvm::stable_sort (NFC) (#140488) | 1 年前 | |
[lld/win] Use C++17 nested namespace syntax in most places Like D131354, but for COFF. No behavior change. Differential Revision: https://reviews.llvm.org/D131405 | 3 年前 | |
[DTLTO][Clang][LLD] Fix DTLTO for multi-call LLVM driver toolchain (#162456) Add DTLTO linker option --thinlto-remote-compiler-prepend-arg to enable support for the multi-call LLVM driver that requires an additional option to specify the subcommand, e.g. "llvm clang ...". Fixes https://github.com/llvm/llvm-project/issues/159125. | 9 个月前 | |
[LLD] Remove global state in lld/COFF Remove globals from the lldCOFF library, by moving globals into a context class. This patch mostly moves the config object into COFFLinkerContext. See https://lists.llvm.org/pipermail/llvm-dev/2021-June/151184.html for context about removing globals from LLD. Reviewed By: aganea Differential Revision: https://reviews.llvm.org/D110450 | 3 年前 | |
[lld] Remove unused includes (NFC) (#141421) | 1 年前 | |
[lld/win] Use C++17 nested namespace syntax in most places Like D131354, but for COFF. No behavior change. Differential Revision: https://reviews.llvm.org/D131405 | 3 年前 | |
[LLD][COFF] Add support for ARM64X same-address thunks (#151255) Fixes MSVC CRT thread-local constructors support on hybrid ARM64X targets. -arm64xsameaddress is an undocumented option that ensures the specified function has the same address in both native and EC views of hybrid images. To achieve this, the linker emits additional thunks and replaces the symbols of those functions with the thunk symbol (the same thunk is used in both views). The thunk code jumps to the native function (similar to range extension thunks), but additional ARM64X relocations are emitted to replace the target with the EC function in the EC view. MSVC appears to generate thunks even for non-hybrid ARM64EC images. As a side effect, the native symbol is pulled in. Since this is used in the CRT for thread-local constructors, it results in the image containing unnecessary native code. Because these thunks do not appear to be useful in that context, we limit this behavior to actual hybrid targets. This may change if compatibility requires it. The tricky part is that thunks should be skipped if the symbol is not live in either view, and symbol replacement must be reflected in weak aliases. This requires thunk generation to happen before resolving weak aliases but after the GC pass. To enable this, the markLive call was moved earlier, and the final weak alias resolution was postponed until afterward. This requires more code to be aware of weak aliases, which previously could assume they were already resolved. | 1 年前 | |
[lld/win] Use C++17 nested namespace syntax in most places Like D131354, but for COFF. No behavior change. Differential Revision: https://reviews.llvm.org/D131405 | 3 年前 | |
[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 | 11 个月前 | |
[LLD][MinGW] Add support for wrapped symbols on ARM64X (#126296) Apply -wrap arguments to both symbol tables. | 1 年前 | |
[lld] Add (ignored) /link flag to lld-link for compatibility with MSVC link.exe (#168364) Various build tools may produce command lines invoking clang-cl and lld-link which contain /link twice like so: e.g. clang-cl.exe sanitycheckcpp.cc /Fesanitycheckcpp.exe .... /link /link ... If link.exe is used, it ignores the extra /link and just issues a warning, however lld-link tries to treat /link as a file name. This PR adds a flag which is ignored in order to improve compatibility with link.exe There's some extra context including an "in-the-wild" example and reproducer of the problem here: https://github.com/frankier/meson_clang_win_activation Co-authored-by: Frankie Robertson <frankie@robertson.name> | 8 个月前 | |
[LLD][COFF] Make /summary work when /debug isn't provided (#157476) Previously, /summary was meant to print some PDB information. Now move handling of /summary to Writer.cpp so that it can have an effect when /debug isn't provided. This will also provide grounds for extending with more general information. | 11 个月前 | |
[LLD][COFF] Make /summary work when /debug isn't provided (#157476) Previously, /summary was meant to print some PDB information. Now move handling of /summary to Writer.cpp so that it can have an effect when /debug isn't provided. This will also provide grounds for extending with more general information. | 11 个月前 | |
Update the documents of the new LLD. This patch merges the documents for ELF and COFF into one and puts it into docs directory. llvm-svn: 263336 | 10 年前 | |
[LLD][COFF] Add more --time-trace tags for ThinLTO linking (#156471) In order to better see what's going on during ThinLTO linking, this PR adds more profile tags when using --time-trace on a lld-link.exe invocation. After PR, linking clang.exe: <img width="3839" height="2026" alt="Capture d’écran 2025-09-02 082021" src="https://github.com/user-attachments/assets/bf0c85ba-2f85-4bbf-a5c1-800039b56910" /> Linking a custom (Unreal Engine game) binary gives a completly different picture, probably because of using Unity files, and the sheer amount of input files (here, providing over 60 GB of .OBJs/.LIBs). <img width="1940" height="1008" alt="Capture d’écran 2025-09-02 102048" src="https://github.com/user-attachments/assets/60b28630-7995-45ce-9e8c-13f3cb5312e0" /> | 11 个月前 | |
[LLD][COFF] Add support for ARM64X same-address thunks (#151255) Fixes MSVC CRT thread-local constructors support on hybrid ARM64X targets. -arm64xsameaddress is an undocumented option that ensures the specified function has the same address in both native and EC views of hybrid images. To achieve this, the linker emits additional thunks and replaces the symbols of those functions with the thunk symbol (the same thunk is used in both views). The thunk code jumps to the native function (similar to range extension thunks), but additional ARM64X relocations are emitted to replace the target with the EC function in the EC view. MSVC appears to generate thunks even for non-hybrid ARM64EC images. As a side effect, the native symbol is pulled in. Since this is used in the CRT for thread-local constructors, it results in the image containing unnecessary native code. Because these thunks do not appear to be useful in that context, we limit this behavior to actual hybrid targets. This may change if compatibility requires it. The tricky part is that thunks should be skipped if the symbol is not live in either view, and symbol replacement must be reflected in weak aliases. This requires thunk generation to happen before resolving weak aliases but after the GC pass. To enable this, the markLive call was moved earlier, and the final weak alias resolution was postponed until afterward. This requires more code to be aware of weak aliases, which previously could assume they were already resolved. | 1 年前 | |
[LLD][COFF] Introduce Symbol::getDefined helper. (NFC) (#151253) | 1 年前 | |
[LLD][COFF] Deduplicate common chunks when linking COFF files. (#162553) This fixes [issue 162148](https://github.com/llvm/llvm-project/issues/162148). Common symbols are intended to have only a single version of the data present in the final executable. The MSVC linker is able to successfully deduplicate these chunks. If you have an application with a large number of translation units with a large block of common data (this is possible, for example, with Fortran code), then failing to deduplicate these chunks can make the data size so large that the resulting executable fails to load. The logic in this patch doesn't catch all of the potential cases for deduplication, but it should catch the most common ones. | 9 个月前 | |
[lld] Add missing includes. (#143453) Some inline methods in these headers require a complete type but the corresponding include was missing. | 1 年前 | |
[LLD][COFF] Deduplicate common chunks when linking COFF files. (#162553) This fixes [issue 162148](https://github.com/llvm/llvm-project/issues/162148). Common symbols are intended to have only a single version of the data present in the final executable. The MSVC linker is able to successfully deduplicate these chunks. If you have an application with a large number of translation units with a large block of common data (this is possible, for example, with Fortran code), then failing to deduplicate these chunks can make the data size so large that the resulting executable fails to load. The logic in this patch doesn't catch all of the potential cases for deduplication, but it should catch the most common ones. | 9 个月前 | |
[LLD][COFF] Split native and EC .CRT chunks on ARM64X (#127203) | 1 年前 |
See docs/NewLLD.rst