| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
[ELF] Rewrite R_RISCV_ALIGN nops when r.addend%4 != 0 For RVC, GNU assembler and LLVM integrated assembler add c.nop followed by a sequence of 4-byte nops. Even if remove % 4 == 0, we have to split one 4-byte nop and therefore need to write the code sequence, otherwise we create an incorrect c.unimp. (cherry picked from commit 78084d9e77b9a2017e2215491b71b37c2671c292) | 3 年前 | |
[ELF] Move InputFiles global variables (memoryBuffers, objectFiles, etc) into Ctx. NFC | 3 年前 | |
[ELF] AArch64ErrataFix: replace std::map with DenseMap. NFC There is now no <map> in lld/ELF. | 4 年前 | |
[ELF] Move InputFiles global variables (memoryBuffers, objectFiles, etc) into Ctx. NFC | 3 年前 | |
[ELF] Clean up headers. NFC | 4 年前 | |
Revert "[llvm] cmake config groundwork to have ZSTD in LLVM" This reverts commit f07caf20b9d35e45501c9d5d903fa182b3bdb95a which seems to break upstream https://lab.llvm.org/buildbot/#/builders/109/builds/42253. | 3 年前 | |
[ELF] Don't rely on Symbols.h's transitive inclusion of InputFiles.h. NFC | 4 年前 | |
Update the file headers across all of the LLVM projects in the monorepo to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636 | 7 年前 | |
[ELF] Support --package-metadata This was recently introduced in GNU linkers and it makes sense for ld.lld to have the same support. This implementation omits checking if the input string is valid json to reduce size bloat. Differential Revision: https://reviews.llvm.org/D131439 (cherry picked from commit dbd04b853b680b0a383e5f58edf3643364f67bdf) | 3 年前 | |
[ELF] Clean up headers. NFC | 4 年前 | |
[ELF] --gdb-index: skip SHF_GROUP .debug_info -gdwarf-5 -fdebug-types-section may produce multiple .debug_info sections. All except one are type units (.debug_types before DWARF v5). When constructing .gdb_index, we should ignore these type units. We use a simple heuristic: the compile unit does not have the SHF_GROUP flag. (This needs to be revisited if people place compile unit .debug_info in COMDAT groups.) This issue manifests as a data race: because an object file may have multiple .debug_info sections, we may concurrently construct LLDDwarfObj for the same file in multiple threads. The threads may access InputSectionBase::data() concurrently on the same input section. InputSectionBase::data() does a lazy uncompress() and rewrites the member variable rawData. A thread running zlib inflate() (transitively called by uncompress()) on a buffer with rawData tampered by another thread may fail with uncompress failed: zlib error: Z_DATA_ERROR. Even if no data race occurred in an optimistic run, if there are N .debug_info, one CU entry and its address ranges will be replicated N times. The result .gdb_index can be much larger than a correct one. The new test gdb-index-dwarf5-type-unit.s actually has two compile units. This cannot be produced with regular approaches (it can be produced with -r --unique). This is used to demonstrate that the .gdb_index construction code only considers the last non-SHF_GROUP .debug_info Reviewed By: grimar Differential Revision: https://reviews.llvm.org/D85579 | 5 年前 | |
fix: all visible packdges Signed-off-by: wzy_00889928 <1322947566@qq.com> | 1 个月前 | |
feat: support compile-as-exe Signed-off-by: L_lipo <lipeisheng1@huawei.com> | 8 个月前 | |
[ELF] --reproduce: support --export-dynamic-symbol-list | 3 年前 | |
[ELF] Support 'G' in .eh_frame Reviewed By: MaskRay, eugenis Differential Revision: https://reviews.llvm.org/D127148 | 3 年前 | |
[ELF] Simplify/optimize EhInputSection::split and change some fatal to errorOrWarn. EhFrame.cpp is a helper file. We don't place all .eh_frame implementation there, so the code move is fine. | 4 年前 | |
[ELF] Move InputFiles global variables (memoryBuffers, objectFiles, etc) into Ctx. NFC | 3 年前 | |
Update the file headers across all of the LLVM projects in the monorepo to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636 | 7 年前 | |
fix: keep visibility of llvmused symbols Signed-off-by: wangyang594 <wangyang594@huawei.com> | 1 个月前 | |
feat: support compile-as-exe Signed-off-by: L_lipo <lipeisheng1@huawei.com> | 8 个月前 | |
[Support] Change compression::zlib::{compress,uncompress} to use uint8_t * It's more natural to use uint8_t * (std::byte needs C++17 and llvm has too much uint8_t *) and most callers use uint8_t * instead of char *. The functions are recently moved into llvm::compression::zlib::, so downstream projects need to make adaption anyway. | 3 年前 | |
[ELF] Relax R_RISCV_ALIGN Alternative to D125036. Implement R_RISCV_ALIGN relaxation so that we can handle -mrelax object files (i.e. -mno-relax is no longer needed) and creates a framework for future relaxation. relaxAux is placed in a union with InputSectionBase::jumpInstrMod, storing auxiliary information for relaxation. In the first pass, relaxAux is allocated. The main data structure is relocDeltas: when referencing relocations[i], the actual offset is r_offset - (i ? relocDeltas[i-1] : 0). relaxOnce performs one relaxation pass. It computes relocDeltas for all text section. Then, adjust st_value/st_size for symbols relative to this section based on SymbolAnchor. bytesDropped is set so that assignAddresses knows that the size has changed. Run relaxOnce in the finalizeAddressDependentContent loop to wait for convergence of text sections and other address dependent sections (e.g. SHT_RELR). Note: extrating relaxOnce into a separate loop works for many cases but has issues in some linker script edge cases. After convergence, compute section contents: shrink the NOP sequence of each R_RISCV_ALIGN as appropriate. Instead of deleting bytes, we run a sequence of memcpy on the content delimitered by relocation locations. For R_RISCV_ALIGN let the next memcpy skip the desired number of bytes. Section content computation is parallelizable, but let's ensure the implementation is mature before optimizations. Technically we can save a copy if we interleave some code with OutputSection::writeTo, but let's not pollute the generic code (we don't have templated relocation resolving, so using conditions can impose overhead to non-RISCV.) Tested: make ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- LLVM=1 defconfig all built Linux kernel using -mrelax is bootable. FreeBSD RISCV64 system using -mrelax is bootable. bash/curl/firefox/libevent/vim/tmux using -mrelax works. Differential Revision: https://reviews.llvm.org/D127581 | 3 年前 | |
[ELF] Simplify createObjectFile/createLazyFile. NFC And avoid redundant identify_magic test. | 3 年前 | |
[Coding style change] Rename variables so that they start with a lowercase letter This patch is mechanically generated by clang-llvm-rename tool that I wrote using Clang Refactoring Engine just for creating this patch. You can see the source code of the tool at https://reviews.llvm.org/D64123. There's no manual post-processing; you can generate the same patch by re-running the tool against lld's code base. Here is the main discussion thread to change the LLVM coding style: https://lists.llvm.org/pipermail/llvm-dev/2019-February/130083.html In the discussion thread, I proposed we use lld as a testbed for variable naming scheme change, and this patch does that. I chose to rename variables so that they are in camelCase, just because that is a minimal change to make variables to start with a lowercase letter. Note to downstream patch maintainers: if you are maintaining a downstream lld repo, just rebasing ahead of this commit would cause massive merge conflicts because this patch essentially changes every line in the lld subdirectory. But there's a remedy. clang-llvm-rename tool is a batch tool, so you can rename variables in your downstream repo with the tool. Given that, here is how to rebase your repo to a commit after the mass renaming: 1. rebase to the commit just before the mass variable renaming, 2. apply the tool to your downstream repo to mass-rename variables locally, and 3. rebase again to the head. Most changes made by the tool should be identical for a downstream repo and for the head, so at the step 3, almost all changes should be merged and disappear. I'd expect that there would be some lines that you need to merge by hand, but that shouldn't be too many. Differential Revision: https://reviews.llvm.org/D64121 llvm-svn: 365595 | 6 年前 | |
Init project. | 10 个月前 | |
[ELF] Don't use multiple inheritance for OutputSection. NFC Add an OutputDesc class inheriting from SectionCommand. An OutputDesc wraps an OutputSection. This change allows InputSection::getParent to be inlined. Differential Revision: https://reviews.llvm.org/D120650 | 4 年前 | |
[ELF] Move InputFiles global variables (memoryBuffers, objectFiles, etc) into Ctx. NFC | 3 年前 | |
[ELF] Move --print-archive-stats= and --why-extract= beside --warn-backrefs report So that early errors don't suppress their output. | 4 年前 | |
[ELF] Move InputFiles global variables (memoryBuffers, objectFiles, etc) into Ctx. NFC | 3 年前 | |
Update the file headers across all of the LLVM projects in the monorepo to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636 | 7 年前 | |
feat: packdge visibility opt Signed-off-by: wzy_00889928 <1322947566@qq.com> | 1 个月前 | |
[ELF] Optimize getInputSections. NFC In the majority of cases (e.g. orphan sections), an OutputSection has at most one InputSectionDescription (isd). By changing the return type to ArrayRef<InputSection *> we can just reference the isd->sections. For OutputSections with more than one InputSectionDescription we use a caller provided SmallVector to copy the elements as before. Reviewed By: peter.smith Differential Revision: https://reviews.llvm.org/D129111 | 3 年前 | |
[ELF] Optimize getInputSections. NFC In the majority of cases (e.g. orphan sections), an OutputSection has at most one InputSectionDescription (isd). By changing the return type to ArrayRef<InputSection *> we can just reference the isd->sections. For OutputSections with more than one InputSectionDescription we use a caller provided SmallVector to copy the elements as before. Reviewed By: peter.smith Differential Revision: https://reviews.llvm.org/D129111 | 3 年前 | |
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 年前 | |
[ELF] mergeCmp: work around irreflexivity bug Some tests (e.g. aarch64-feature-pac.s) segfault in libstdc++ _GLIBCXX_DEBUG builds (enabled by LLVM_ENABLE_EXPENSIVE_CHECKS). dyn_cast<ThunkSection> is incorrectly true for any SyntheticSection. std::merge transitively calls mergeCmp(x, x) (due to __glibcxx_requires_irreflexive_pred) and will segfault in ta->getTargetInputSection(). The dyn_cast<ThunkSection> issue should be eventually fixed properly, bug a != b is robust enough for now. (cherry picked from commit abd9807590fc10eb92eb22aea7b50dbf08db7e9d) | 3 年前 | |
[ELF] Relax R_RISCV_ALIGN Alternative to D125036. Implement R_RISCV_ALIGN relaxation so that we can handle -mrelax object files (i.e. -mno-relax is no longer needed) and creates a framework for future relaxation. relaxAux is placed in a union with InputSectionBase::jumpInstrMod, storing auxiliary information for relaxation. In the first pass, relaxAux is allocated. The main data structure is relocDeltas: when referencing relocations[i], the actual offset is r_offset - (i ? relocDeltas[i-1] : 0). relaxOnce performs one relaxation pass. It computes relocDeltas for all text section. Then, adjust st_value/st_size for symbols relative to this section based on SymbolAnchor. bytesDropped is set so that assignAddresses knows that the size has changed. Run relaxOnce in the finalizeAddressDependentContent loop to wait for convergence of text sections and other address dependent sections (e.g. SHT_RELR). Note: extrating relaxOnce into a separate loop works for many cases but has issues in some linker script edge cases. After convergence, compute section contents: shrink the NOP sequence of each R_RISCV_ALIGN as appropriate. Instead of deleting bytes, we run a sequence of memcpy on the content delimitered by relocation locations. For R_RISCV_ALIGN let the next memcpy skip the desired number of bytes. Section content computation is parallelizable, but let's ensure the implementation is mature before optimizations. Technically we can save a copy if we interleave some code with OutputSection::writeTo, but let's not pollute the generic code (we don't have templated relocation resolving, so using conditions can impose overhead to non-RISCV.) Tested: make ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- LLVM=1 defconfig all built Linux kernel using -mrelax is bootable. FreeBSD RISCV64 system using -mrelax is bootable. bash/curl/firefox/libevent/vim/tmux using -mrelax works. Differential Revision: https://reviews.llvm.org/D127581 | 3 年前 | |
[ELF] Support -= *= /= <<= >>= &= |= in symbol assignments | 3 年前 | |
[ELF] Clean up headers. NFC | 4 年前 | |
[ELF] Optimize some non-constant alignTo with alignToPowerOf2. NFC My x86-64 lld executable is 2KiB smaller. .eh_frame writing gets faster as there were lots of divisions. | 3 年前 | |
[ELF] Clean up headers. NFC | 4 年前 | |
[ELF] Drop unused original symbol after wrapping if not defined We were previously only omitting the original of a wrapped symbol if it was not used by an object file and undefined. We can tighten the second condition to drop any symbol that isn't defined instead, which lets us drop a previous check (added in https://reviews.llvm.org/D118756) that was only covering some such symbols. Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D124065 | 4 年前 | |
[ELF] Symbols.h: remove #include "InputFiles.h" | 4 年前 | |
[ELF] Move whyExtract/backwardReferences from LinkerDriver to Ctx. NFC Ctx was recently added as a more suitable place for such singletons. | 3 年前 | |
[ELF] Move whyExtract/backwardReferences from LinkerDriver to Ctx. NFC Ctx was recently added as a more suitable place for such singletons. | 3 年前 | |
[ELF] Support --package-metadata This was recently introduced in GNU linkers and it makes sense for ld.lld to have the same support. This implementation omits checking if the input string is valid json to reduce size bloat. Differential Revision: https://reviews.llvm.org/D131439 (cherry picked from commit dbd04b853b680b0a383e5f58edf3643364f67bdf) | 3 年前 | |
[ELF] Support --package-metadata This was recently introduced in GNU linkers and it makes sense for ld.lld to have the same support. This implementation omits checking if the input string is valid json to reduce size bloat. Differential Revision: https://reviews.llvm.org/D131439 (cherry picked from commit dbd04b853b680b0a383e5f58edf3643364f67bdf) | 3 年前 | |
[ELF] De-template getErrorPlace. NFC | 4 年前 | |
[ELF] Relax R_RISCV_ALIGN Alternative to D125036. Implement R_RISCV_ALIGN relaxation so that we can handle -mrelax object files (i.e. -mno-relax is no longer needed) and creates a framework for future relaxation. relaxAux is placed in a union with InputSectionBase::jumpInstrMod, storing auxiliary information for relaxation. In the first pass, relaxAux is allocated. The main data structure is relocDeltas: when referencing relocations[i], the actual offset is r_offset - (i ? relocDeltas[i-1] : 0). relaxOnce performs one relaxation pass. It computes relocDeltas for all text section. Then, adjust st_value/st_size for symbols relative to this section based on SymbolAnchor. bytesDropped is set so that assignAddresses knows that the size has changed. Run relaxOnce in the finalizeAddressDependentContent loop to wait for convergence of text sections and other address dependent sections (e.g. SHT_RELR). Note: extrating relaxOnce into a separate loop works for many cases but has issues in some linker script edge cases. After convergence, compute section contents: shrink the NOP sequence of each R_RISCV_ALIGN as appropriate. Instead of deleting bytes, we run a sequence of memcpy on the content delimitered by relocation locations. For R_RISCV_ALIGN let the next memcpy skip the desired number of bytes. Section content computation is parallelizable, but let's ensure the implementation is mature before optimizations. Technically we can save a copy if we interleave some code with OutputSection::writeTo, but let's not pollute the generic code (we don't have templated relocation resolving, so using conditions can impose overhead to non-RISCV.) Tested: make ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- LLVM=1 defconfig all built Linux kernel using -mrelax is bootable. FreeBSD RISCV64 system using -mrelax is bootable. bash/curl/firefox/libevent/vim/tmux using -mrelax works. Differential Revision: https://reviews.llvm.org/D127581 | 3 年前 | |
[PowerPC][LLD] Change PPC64R2SaveStub to only use non-PC-relative code Currently the PPC64R2SaveStub thunk will produce Power 10 code by default. This produced an issue when linking older code that made use of the st_other=1 bit but was never meant to be linked or run on Power 10. This patch makes it so that only the R_PPC64_REL24_NOTOC relocation can produce Power 10 code. Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D129580 | 3 年前 | |
[lld] Add missing includes (NFC) Fix lld build after 983565a6fe4a9f40c7caf82b65c650c20dbcc104. | 4 年前 | |
Init project. | 10 个月前 | |
[ELF] Clean up headers. NFC | 4 年前 |
See docs/NewLLD.rst