[all-commits] [llvm/llvm-project] 2324c2: [LLD] Two tweaks to symbol ordering scheme

yozhu via All-commits all-commits at lists.llvm.org
Tue Jul 12 11:36:43 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2324c2e3c3110cd077bb537eaa5b686a6b97c8e7
      https://github.com/llvm/llvm-project/commit/2324c2e3c3110cd077bb537eaa5b686a6b97c8e7
  Author: YongKang Zhu <yongzhu at fb.com>
  Date:   2022-07-12 (Tue, 12 Jul 2022)

  Changed paths:
    M lld/ELF/Writer.cpp
    M lld/test/ELF/arm-symbol-ordering-file.s

  Log Message:
  -----------
  [LLD] Two tweaks to symbol ordering scheme

When `--symbol-ordering-file` is specified, the linker today will always put
hot contributions in the middle of cold ones when targeting RISC machine, so
to minimize the chances that branch thunks need be generated for hot code
calling into cold code. This is not necessary when user specifies an ordering
of read-only data (vs. function) symbols, or when output section is small such
that no branch thunk would ever be required. The latter is common for mobile
apps. For example, among all the native ARM64 libraries in Facebook Instagram
App for Android, 80% of them have text section smaller than 64KB and the
largest text section seen is less than 8MB, well below the distance that a
BRANCH26 can reach.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D128382




More information about the All-commits mailing list