llvm-project
今年800+ commits,灌水很多,挑出一些值得一提的。
LLVM
- Deleted remnant PowerPC Darwin code.
[XRay] Support DW_TAG_call_site and delete unneeded PATCHABLE_EVENT_CALL/PATCHABLE_TYPED_EVENT_CALL lowering[ThinLTO] Add Visibility bits to GlobalValueSummary::GVFlags[yaml2obj/obj2yaml/llvm-readobj] Support SHF_GNU_RETAIN[MC] Support SHF_GNU_RETAIN as section flag 'R'- Support
.reloc *, BFD_RELOC_{NONE,16,32,64}, *for a number of targets - Support
.symver *, *, remove - Switched llvm-readelf/llvm-strings/llvm-nm/etc from llvm::cl to OptTable, modernizing the command line option syntax
[RISCV] Support machine constraint "S"[LTO] Add SelectionKind to IRSymtab and use it in ld.lld/LLVMgold[InstrProfiling][ELF] Make __profd_ private if the function does not use value profilingmakes PGO/coverage instrumentation smaller[InstrProfiling] Make CountersPtr in __profd_ relativegreatly decreases the number of dynamic relocations[X86] Default to -x86-pad-for-align=false to drop assembler difference with or w/o -g[MC] Set SHF_INFO_LINK on SHT_REL/SHT_RELA sections[llvm-objdump/llvm-readobj/obj2yaml/yaml2obj] Support STO_RISCV_VARIANT_CC and DT_RISCV_VARIANT_CCResolve {GlobalValue,GloalIndirectSymol}::getBaseObject confusion[LangRef] Update ifunc syntax[llvm-objdump] -p: Dump PE header for PE/COFF[MachineOutliner] Don't outline functions starting with PATCHABLE_FUNCTION_ENTER/FENTRL_CALL
Clang
Add -f[no-]direct-access-external-data to supersede -mpie-copy-relocationsAdd GNU attribute 'retain'Define __GCC_HAVE_DWARF2_CFI_ASM if applicable- Fixed a number of cross-compiling issues in lib/Driver. Properly supported cross-compiling using g++ files (both normal and Debian-flavored)
[Driver] Add CLANG_DEFAULT_PIE_ON_LINUX to emulate GCC --enable-default-pie-gsplit-dwarfsemantics fix-fasynchronous-unwind-tablessemantics fix- Record
-fasynchronous-unwind-tablesand CC1-mframe-pointer={non-leaf,all}in module flags metadata to affect synthesized functions - Implement
-falign-loops=N - Minor CGDebugInfo cleanup
Add -fbinutils-version= to gate ELF features on the specified binutils version
lld
[ELF] Special case --shuffle-sections=-1 to reverse input sections[ELF] Change --shuffle-sections=<seed> to --shuffle-sections=<section-glob>=<seed>[ELF] Add OVERWRITE_SECTIONS command[ELF] Add -Bsymbolic-non-weak-functions[ELF] Support copy relocation on non-default version symbolsfor glibc[ELF] Add --why-extract= to query why archive members/lazy object files are extracted[ELF] Implement TLSDESC for x86-32[ELF] Split scanRelocations into scanRelocations/postScanRelocations[ELF] Replace LazyObjFile with lazy ObjFile/BitcodeFile[ELF][PPC32] Support .got2 in an output section descriptionmay benefit someone writing WiiU in Rust[ELF][LTO] Call madvise(MADV_DONTNEED) on MemoryBuffer instances
Wrote 12.0.0 and 13.0.0 release notes for ld.lld. Made ld.lld quite a bit faster. See https://maskray.me/blog/2021-12-19-why-isnt-ld.lld-faster#new-hope.
LLDB
Makefile.rules: Avoid redundant .d generation (make restart) and inline archive rule to the only test[lldb] Add -Wl,-rpath to make tests run with fresh built libc++
compiler-rt
[sanitizer] Define SANITIZER_GLIBC to refine SANITIZER_LINUX feature detection and support musl[sanitizer] Fall back to fast unwinder[sanitizer] Improve accuracy of GetTls on x86/s390[lsan] Bump the thread limit from 1<<13 to 1<<22[InstrProfiling] Use llvm.compiler.used if applicable for Mach-O
Misc
[libunwind] Add UNW_AARCH64_* beside UNW_ARM64_*[libc++abi] Simplify __gxx_personality_v0
binutils
Reported many bugs and feature requests:
ld: Should an unversioned undefined symbol use VER_NDX_GLOBAL instead of VER_NDX_LOCAL?i386: Emit R_386_PLT32 instead of R_386_PC32 for `call/jmp foo`Ouch, a design flaw led to aWONTFIXx86-64: Omit _GLOBAL_OFFSET_TABLE_ for call foo@PLTld ppc: Emit R_PPC64_IRELATIVE instead of R_PPC64_JMP_SLOT for non-preemptible ifunc referenced by a DSOld: Don't suppress foo if foo@v1 is definedld: Add DWARF v5 sections and .debug_types to ld/scripttempl/DWARF.scld: Support SHF_LINK_ORDER self-linkreadelf: SHF_GNU_RETAIN ('R') is not listed in Key to Flags:ld: Should SHF_GNU_RETAIN/STT_GNU_IFUNC/STB_GNU_UNIQUE work for ELFOSABI_NONE object files?ld riscv: Add _fbsd emulations and riscv*-*-freebsd* triplesAdd --trace-symbols-from-file?nm: Have a way to suppress 'no symbols'ld: Provide a way to make C identifier name sections GCable under __start_/__stop_ referencesld: Support compressing arbitrary sections (generalized --compress-debug-sections=)gas: Suppress "CFI instruction used without previous .cfi_startproc" if .cfi_sections is emptynm: Add --just-symbol-namegold: Don't produce two output sections __llvm_prf_namesld: relocation R_X86_64_PC32 against undefined protected symbol `__start_xx' can not be used when making a shared objectobjcopy --weaken-symbol does not weaken undefined symbolsaddr2line: JSON outputgas: Support .reloc ., 0, targetld: Support input section description keyword: REVERSEnm riscv: Suppress empty name symbols unless --special-syms?addr2line riscv: Skip empty name symbols?ld: -z unique-symbol behavior when .1 existsld: Add -Bno-symbolic to cancel -Bsymbolic/-Bsymbolic-functionsld: Add -Bsymbolic-non-weak-functions which only applies to STB_GLOBAL STT_FUNCaarch64: Internal error in ldst_lo12_determine_real_reloc_type at ../../../gas/config/tc-aarch64.c:5657ld: Support DT_RELR relative relocation formatobjcopy --localize-hidden/--keep-global-symbol: drop GRP_COMDAT if the signature symbol becomes local?ld: Disallow ET_DYN DF_1_PIE linker input?ld x86: Allow direct access to protected function symbolsld --trace: Print the symbol which leads to archive extractionobjcopy/strip: Don't convert SHT_REL to SHT_RELAld: Make special sections in a section group GCablegas: .symver *, *@*, remove cannot be used in relocationgold: Spurious "warning: wildcard match appears in both version"gold: if .symtab order is: __free_hook, __free_hook@GLIBC_2.2.5, version script incorrectly makes the symbol default versionedld: Support # as linker script comment markerld: Assigning a non-default symbol to a different version node should warnaarch64: relocation R_AARCH64_ADR_PREL_PG_HI21 against STT_GNU_IFUNC symbol `ifunc' isn't handled by elf64_aarch64_final_link_relocateld: Move R_*_TLSDESC to .rela.dynld: unknown phdr type `PT_GNU_RELRO' (try integer literal)ld arm: R_ARM_GOTOFF32 referencing a preemptible symbol should be disallowedld riscv: R_RISCV_JAL referencing a preemptible symbol should be rejectedgold: Support DT_RELR relative relocation formatbinutils/testsuite/lib/binutils-common.exp: Support free-form shell commands and check patterns
My commits:
Add some more DWARF-5 sectionsnm: Add --quiet to suppress "no symbols" diagnosticld: Add -Bno-symbolicgold: Add -Bno-symbolicld: Add -no-pield: Add ChangeLog entry for -no-piegold: --export-dynamic-symbol: don't imply -ureadelf: Make DT_PREINIT_ARRAYSZ's output style match DT_INIT_ARRAYSZreadelf: Support RELR in -S and -d and outputreadelf: Support SHT_RELR/DT_RELR for -rbfd_section_from_shdr: Support SHT_RELR sections
GCC
Reported bugs and feature requests:
- Requested
-fuse-ld=moldon a related Support Clang 12 --ld-path= - _Unwind_ForcedUnwind going through a non-empty exception specification
- aarch64: -fpatchable-function-entry=N[,0] should place .cfi_startproc before NOPs
- Emit .cfi_sections without arguments for -fno-asynchronous-unwind-tables
- warning: ‘retain’ attribute ignored while __has_attribute(retain) is 1
- morestack.S should support .init_array.0 besides .ctors.65535
- C11: _Static_assert disallows const int operand in -O0 while allows it in higher -O
- Extend -fno-semantic-interposition to global variables
- libiberty: Support more characters for function clones
- [ELF] -fno-pic: Use GOT to take address of an external default visibility function
- Add a -fno-semantic-interposition variant which allows variable interposition
- configure: Add --enable-default-semantic-interposition Ouch, closed as WONTFIX
- [RISCV] Document the machine constraint 'S' and make it non-internal
- -Wnon-virtual-dtor shouldn't fire for protected dtor in a class with a friend declaration
- configure: Enable --enable-default-pie by default for Linux
glibc
Reported bugs and feature requests:
[meta] Build glibc with LLDImplemented!Get OUTPUT_FORMAT from objdump -f to support LLDx86-64: Support -mstack-protector-guard=global (define global __stack_chk_guard)csu/libc-start.c should not call ARCH_APPLY_IREL in static pie modeMigrate away from nested functionsMake static linking friendly with {ld.bfd,ld.lld} -z start-stop-gc: removing unused section '__libc_atexit'ld.so: Support DT_RELR relative relocation formatelf: Some tst-audit* tests need ld --audit and --depaudit which do not work with gold or ld.lldelf: clang integrated assembler and ld.lld do not support .tls_common[test] gmon/tst-gmon-gprof* may have a f3 line when built with ld.lld[test] sysdeps/x86/tst-ifunc-isa-* lazy binding failure with ld.lldDebian/Ubuntu: make check has 100+ failures due to libgcc_s.so.1 must be installed for pthread_cancel to workcompat_symbol should migrate to .symver *, *, removeaarch64: elf_machine_{load_address,dynamic} should drop _GLOBAL_OFFSET_TABLE_[0] in favor of __ehdr_start for robustnessaarch64: Skip traditional GD/LD TLS tests for Clang and LLDld.so: ifunc resolver calls a lazy PLT. When does it work?[meta] Build glibc with ClangPlease help!
26 commits:
install: Replace scripts/output-format.sed with objdump -f [BZ #26559]elf: Replace a --defsym trick with an object file to be compatible with LLDSet the retain attribute on _elf_set_element if CC supports [BZ #27492]x86_64: Remove unneeded static PIE check for undefined weak diagnosticelf: Unconditionally use __ehdr_startaarch64: Make elf_machine_{load_address,dynamic} robust [BZ #28203]elf: Drop elf/tls-macros.h in favor of __thread and tls_model attributes [BZ #28152] [BZ #28205]x86_64: Simplify elf_machine_{load_address,dynamic}Remove sysdeps/*/tls-macros.hriscv: Drop reliance on _GLOBAL_OFFSET_TABLE_[0]arm: Simplify elf_machine_{load_address,dynamic}powerpc: Use --no-tls-get-addr-optimize in test only if the linker supports itelf: Skip tst-auditlogmod-* if the linker doesn't support --depaudit [BZ #28151]configure: Allow LD to be LLD 13.0.0 or above [BZ #26558]configure: Fix check for INSERT in linker scripti386: Port elf_machine_{load_address,dynamic} from x86-64powerpc: Delete unneeded ELF_MACHINE_BEFORE_RTLD_RELOCelf: Avoid nested functions in the loader [BZ #27220]elf: Remove Intel MPX support (lazy PLT, ld.so profile, and LD_AUDIT)nss: Unnest nested function add_keyglibcextract.py: Place un-assemblable @@@ in a commentlinux: Fix a possibly non-constant expression in _Static_assertconfigure: Don't check LD -v --help for LIBC_LINKER_FEATUREriscv: Fix incorrect jal with HIDDEN_JUMPTARGETregex: Unnest nested functions in regcomp.cx86-64: Replace movzx with movzbl
Linux kernel
4 commits:
module: Ignore _GLOBAL_OFFSET_TABLE_ when warning for undefined symbolsx86/build: Treat R_386_PLT32 relocation as R_386_PC32firmware_loader: align .builtin_fw to 8powerpc: Add "-z notext" flag to disable diagnostic
Others
Wrote 28 blog posts (including this one). Quite a few discuss linkers.
Work which has/will have a large impact in the Linux world:
- promotion of
DT_RELRin GNU toolchain - build glibc with ld.lld 13.0.0
- point out the ways to build glibc with Clang (this needs maintainers' help)