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 profiling
makes PGO/coverage instrumentation smaller[InstrProfiling] Make CountersPtr in __profd_ relative
greatly 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_CC
Resolve {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-relocations
Add 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-dwarf
semantics fix-fasynchronous-unwind-tables
semantics fix- Record
-fasynchronous-unwind-tables
and 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 symbols
for 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 description
may 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 aWONTFIX
x86-64: Omit _GLOBAL_OFFSET_TABLE_ for call foo@PLT
ld ppc: Emit R_PPC64_IRELATIVE instead of R_PPC64_JMP_SLOT for non-preemptible ifunc referenced by a DSO
ld: Don't suppress foo if foo@v1 is defined
ld: Add DWARF v5 sections and .debug_types to ld/scripttempl/DWARF.sc
ld: Support SHF_LINK_ORDER self-link
readelf: 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* triples
Add --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_ references
ld: Support compressing arbitrary sections (generalized --compress-debug-sections=)
gas: Suppress "CFI instruction used without previous .cfi_startproc" if .cfi_sections is empty
nm: Add --just-symbol-name
gold: Don't produce two output sections __llvm_prf_names
ld: relocation R_X86_64_PC32 against undefined protected symbol `__start_xx' can not be used when making a shared object
objcopy --weaken-symbol does not weaken undefined symbols
addr2line: JSON output
gas: Support .reloc ., 0, target
ld: Support input section description keyword: REVERSE
nm riscv: Suppress empty name symbols unless --special-syms?
addr2line riscv: Skip empty name symbols?
ld: -z unique-symbol behavior when .1 exists
ld: Add -Bno-symbolic to cancel -Bsymbolic/-Bsymbolic-functions
ld: Add -Bsymbolic-non-weak-functions which only applies to STB_GLOBAL STT_FUNC
aarch64: Internal error in ldst_lo12_determine_real_reloc_type at ../../../gas/config/tc-aarch64.c:5657
ld: Support DT_RELR relative relocation format
objcopy --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 symbols
ld --trace: Print the symbol which leads to archive extraction
objcopy/strip: Don't convert SHT_REL to SHT_RELA
ld: Make special sections in a section group GCable
gas: .symver *, *@*, remove cannot be used in relocation
gold: 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 versioned
ld: Support # as linker script comment marker
ld: Assigning a non-default symbol to a different version node should warn
aarch64: relocation R_AARCH64_ADR_PREL_PG_HI21 against STT_GNU_IFUNC symbol `ifunc' isn't handled by elf64_aarch64_final_link_relocate
ld: Move R_*_TLSDESC to .rela.dyn
ld: unknown phdr type `PT_GNU_RELRO' (try integer literal)
ld arm: R_ARM_GOTOFF32 referencing a preemptible symbol should be disallowed
ld riscv: R_RISCV_JAL referencing a preemptible symbol should be rejected
gold: Support DT_RELR relative relocation format
binutils/testsuite/lib/binutils-common.exp: Support free-form shell commands and check patterns
My commits:
Add some more DWARF-5 sections
nm: Add --quiet to suppress "no symbols" diagnostic
ld: Add -Bno-symbolic
gold: Add -Bno-symbolic
ld: Add -no-pie
ld: Add ChangeLog entry for -no-pie
gold: --export-dynamic-symbol: don't imply -u
readelf: Make DT_PREINIT_ARRAYSZ's output style match DT_INIT_ARRAYSZ
readelf: Support RELR in -S and -d and output
readelf: Support SHT_RELR/DT_RELR for -r
bfd_section_from_shdr: Support SHT_RELR sections
GCC
Reported bugs and feature requests:
- Requested
-fuse-ld=mold
on 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 LLD
Implemented!Get OUTPUT_FORMAT from objdump -f to support LLD
x86-64: Support -mstack-protector-guard=global (define global __stack_chk_guard)
csu/libc-start.c should not call ARCH_APPLY_IREL in static pie mode
Migrate away from nested functions
Make static linking friendly with {ld.bfd,ld.lld} -z start-stop-gc: removing unused section '__libc_atexit'
ld.so: Support DT_RELR relative relocation format
elf: Some tst-audit* tests need ld --audit and --depaudit which do not work with gold or ld.lld
elf: 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.lld
Debian/Ubuntu: make check has 100+ failures due to libgcc_s.so.1 must be installed for pthread_cancel to work
compat_symbol should migrate to .symver *, *, remove
aarch64: elf_machine_{load_address,dynamic} should drop _GLOBAL_OFFSET_TABLE_[0] in favor of __ehdr_start for robustness
aarch64: Skip traditional GD/LD TLS tests for Clang and LLD
ld.so: ifunc resolver calls a lazy PLT. When does it work?
[meta] Build glibc with Clang
Please 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 LLD
Set the retain attribute on _elf_set_element if CC supports [BZ #27492]
x86_64: Remove unneeded static PIE check for undefined weak diagnostic
elf: Unconditionally use __ehdr_start
aarch64: 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.h
riscv: 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 it
elf: 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 script
i386: Port elf_machine_{load_address,dynamic} from x86-64
powerpc: Delete unneeded ELF_MACHINE_BEFORE_RTLD_RELOC
elf: 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_key
glibcextract.py: Place un-assemblable @@@ in a comment
linux: Fix a possibly non-constant expression in _Static_assert
configure: Don't check LD -v --help for LIBC_LINKER_FEATURE
riscv: Fix incorrect jal with HIDDEN_JUMPTARGET
regex: Unnest nested functions in regcomp.c
x86-64: Replace movzx with movzbl
Linux kernel
4 commits:
module: Ignore _GLOBAL_OFFSET_TABLE_ when warning for undefined symbols
x86/build: Treat R_386_PLT32 relocation as R_386_PC32
firmware_loader: align .builtin_fw to 8
powerpc: 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_RELR
in GNU toolchain - build glibc with ld.lld 13.0.0
- point out the ways to build glibc with Clang (this needs maintainers' help)