lld 22 ELF changes
好的,我现在要帮用户总结这篇文章的内容。用户的要求是用中文,控制在100字以内,不需要特定的开头,直接写描述即可。 首先,我快速浏览一下文章内容。文章主要介绍了LLVM 22版本中lld/ELF的一些更新和改进。里面提到了很多具体的变更点,比如新增了--print-gc-sections参数,优化了版本脚本解析器,修复了一些针对AArch64、ARM、LoongArch和RISC-V架构的问题,还增加了对一些新重定位类型的处理。 接下来,我需要把这些信息浓缩到100字以内。要抓住主要的改进点和新增功能,同时涵盖各个架构的支持情况。比如提到新增功能、优化、修复以及多架构的支持。 然后,我组织语言,确保简洁明了。可能的结构是先说版本更新和改进内容,然后列举关键点:新增功能、优化、修复问题以及支持的架构类型。 最后检查一下字数是否符合要求,并确保没有遗漏重要信息。这样用户就能快速了解LLVM 22在lld/ELF方面的更新内容了。 </think> LLVM 22版本中lld/ELF进行了多项改进和修复,包括新增垃圾收集部分输出重定向功能、优化版本脚本解析器、修复AArch64、ARM、LoongArch和RISC-V架构相关问题,并增加对多种新重定位类型的处理支持。 2026-1-31 08:0:0 Author: maskray.me(查看原文) 阅读量:4 收藏

LLVM 22 will be released. As usual, I maintain lld/ELF and have added some notes to https://github.com/llvm/llvm-project/blob/release/22.x/lld/docs/ReleaseNotes.rst. I've meticulously reviewed nearly all the patches that are not authored by me. I'll delve into some of the key changes.

  • --print-gc-sections=<file> has been added to redirect garbage collection section listing to a file, avoiding contamination of stdout with other linker output. (#159706)
  • A VersionNode lexer state has been added for better version script parsing. This brings the lexer behavior closer to GNU ld. (#174530)
  • Unversioned undefined symbols now use version index 0, aligning with GNU ld 2.46 behavior. (#168189)
  • .data.rel.ro.hot and .data.rel.ro.unlikely are now recognized as RELRO sections, allowing profile-guided static data partitioning. (#148920)
  • DTLTO now supports archive members and bitcode members of thin archives. (#157043)
  • For DTLTO, --thinlto-remote-compiler-prepend-arg=<arg> has been added to prepend an argument to the remote compiler's command line. (#162456)
  • Balanced Partitioning (BP) section ordering now skips input sections with null data, and filters out section symbols. (#149265) (#151685)
  • For AArch64, fixed a crash when using --fix-cortex-a53-843419 with synthetic sections and improved handling when patched code is far from the short jump. (#170495)
  • For AArch64, added support for the R_AARCH64_FUNCINIT64 dynamic relocation type for relocating word-sized data using the return value of a function. (#156564)
  • For AArch64, added support for the R_AARCH64_PATCHINST relocation type to support deactivation symbols. (#133534)
  • For AArch64, added support for reading AArch64 Build Attributes and converting them into GNU Properties. (#147970)
  • For ARM, fixed incorrect veneer generation for wraparound branches at the high end of the 32-bit address space branching to the low end. (#165263)
  • For LoongArch, -r now synthesizes R_LARCH_ALIGN at input section start to preserve alignment information. (#153935)
  • For LoongArch, added relocation types for LA32R/LA32S. (#172618) (#176312)
  • For RISC-V, added infrastructure for handling vendor-specific relocations. (#159987)
  • For RISC-V, added support for statically resolved vendor-specific relocations. (#169273)
  • For RISC-V, -r now synthesizes R_RISCV_ALIGN at input section start to preserve alignment information during two-stage linking. (#151639)

Link: lld 21 ELF changes


文章来源: https://maskray.me/blog/2026-01-31-lld-22-elf-changes
如有侵权请联系:admin#unsafe.sh