2020年总结

2017年10月第一次给LLVM提交patch,到2020年底已经贡献三年多了。今年~1000 commits,灌水很多,挑出一些值得一提的。

LLVM

  • llvm-objdump -d:display addresses instead of PC-relative offsets
  • Fix llvm-objdump --syms
  • llvm-objcopy ELF:Fix -O binary
  • llvm-objcopy --only-keep-debug: support Android PT_TLS hack
  • llvm-readelf --all: make output order compatible with GNU readelf
  • Clean up MC, fix .symver visibility, fix redirection for undefined symbol
  • Improve DebugInfo
  • Fix some new pass manager issues
  • Clean up x86 MCDisassembler
  • Fix x86 FastISel, negative offset folding into global address, R_X86_64_[REX_]GOTPCRELX problems
  • Fix x86/PowerPC integrated assembler issues
  • Fix PowerPC combineVectorShuffle
  • Support R_X86_64_PLTOFF64
  • Implement -fpic -fno-semantic-interposition local alias for x86
  • Implement .reloc directive for arbitrary relocation types on many targets
  • Clean up/fix exception/call frame information
  • Delete remnant PowerPC Mach-O code
  • XRay: use PC-relative addresses, support big-endian
  • Rewrite llvm-cov gcov, support all known GCC gcov versions (3.4~10), optimize/clean up (Kirichoff's circult law) gcov instrumentation
  • Clean up bugpoint
  • Clean up dso_local
  • PGOFix critical edge split, use COMDAT, work around non-determinism
  • Split .gcc_except_table
  • Fix StackColoring, BranchRelaxation, JumpThreading

Clang

  • Clean up -fuse-init-array
  • Add -mbranches-within-32B-boundaries
  • Add -flegacy-pass-manager -fno-legacy-pass-manager -gno-split-dwarf
  • Implement -fpatchable-function-entry= and its associated function attribute
  • Implement -march=x86-64-v[234]
  • Fix builtin function asm label
  • Implement -fprofile-update={atomic,prefer-atomic,single}
  • Use PowerPC ELFv2 on linux-musl and FreeBSD>=13
  • Improve -B COMPILER_PATH compatibility with GCC

lld

  • Help implement -z force-ibt and -z shstk for Intel Control-flow Enforcement Technology
  • Handle .debug_*
  • Implement -z rel and -z rela(not meaningful)
  • Implement R_PPC_COPYR_PPC64_COPY
  • Implement PPC32 canonical PLT
  • Clean up -z pac-plt and -z force-bti
  • Implement Mach-O X86_64_RELOC_SIGNED_{1,2,4}
  • Improve diagnostics
  • Detect missing R_PPC64_TLSGD/R_PPC64_TLSLD and disable TLS relaxation
  • Fix --wrap
  • Improve --warn-backrefs, implement --warn-backrefs-exclude=
  • Fix --gdb-index
  • Implement --print-archive-stats
  • Implement --rosegment
  • Support -r --gc-sections
  • Improve SHF_LINK_ORDER
  • Fix --icf for C++ exceptions (language-specific data area)

Misc

  • Clean up compiler-rt builtins、libunwind
  • Make sanitizers(asan/cfi/lsan/msan/tsan/ubsan) support musl

GCC

3 commits

  • Align __patchable_function_entries to POINTER_SIZE [PR93194]
  • libstdc++: Fix the return type of __cxa_finalize
  • Because stakeholders agreed: Don't make -gsplit-dwarf imply -g

binutils

Reported many bugs and feature requests:

Fixed

My commits:

  • Allow objcopy's --set-section-flags options to add or remove the SHF_EXCLUDE flag of ELF sections.
  • Add support for --no-rosegment option.
  • The assembler only supports 32-bit stabs. So set sh_entsize unconditionally to 12.
  • Unify the behaviour of ld.bfd and ld.gold with respect to warning about unresolved symbol references. (PR 24613)
  • ld: For relative paths in INPUT() and GROUP(), search the directory of the current linker script before searching other paths.
  • objcopy: Allow --dump-section to dump an empty SEC_HAS_CONTENTS section
  • ld: Handle --dynamic-list* before -Bsymbolic -Bsymbolic-functions
  • ld: Add --export-dynamic-symbol and --export-dynamic-symbol-list
  • gold: Set DF_1_PIE for -pie
  • gdb: Recognize -1 as a tombstone value in .debug_line

Linux kernel

  • First commit bpf: Support llvm-objcopy for vmlinux BTF
  • .weak fixes
  • LLVM integrated assembler related fixes

Others