[all-commits] [llvm/llvm-project] 962b29: ELFObjectWriter: Don't sort non-local symbols

Fangrui Song via All-commits all-commits at lists.llvm.org
Sat Feb 13 10:32:47 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 962b29d7162c8b470ea70540c48d11c2f35d7561
      https://github.com/llvm/llvm-project/commit/962b29d7162c8b470ea70540c48d11c2f35d7561
  Author: Fangrui Song <i at maskray.me>
  Date:   2021-02-13 (Sat, 13 Feb 2021)

  Changed paths:
    M lld/test/ELF/aarch64-gnu-ifunc.s
    M lld/test/ELF/aarch64-nopic-plt.s
    M lld/test/ELF/amdgpu-relocs.s
    M lld/test/ELF/arm-gnu-ifunc.s
    M lld/test/ELF/arm-static-defines.s
    M lld/test/ELF/assignment-archive.s
    M lld/test/ELF/cgprofile-icf.s
    M lld/test/ELF/cgprofile-obj.s
    M lld/test/ELF/cgprofile-txt.s
    M lld/test/ELF/copy-rel-abs.s
    M lld/test/ELF/copy-rel.s
    M lld/test/ELF/cref.s
    M lld/test/ELF/dynamic-list-preempt.s
    M lld/test/ELF/export-symbols.s
    M lld/test/ELF/gnu-ifunc-dso.s
    M lld/test/ELF/gnu-ifunc-empty.s
    M lld/test/ELF/gnu-ifunc-i386.s
    M lld/test/ELF/gnu-ifunc-noplt-i386.s
    M lld/test/ELF/gnu-ifunc-noplt.s
    M lld/test/ELF/gnu-ifunc.s
    M lld/test/ELF/icf-symbol-type.s
    M lld/test/ELF/interconnected-lazy.s
    M lld/test/ELF/just-symbols-cref.s
    M lld/test/ELF/just-symbols.s
    M lld/test/ELF/linkerscript/common-filespec.test
    M lld/test/ELF/linkerscript/map-file2.test
    M lld/test/ELF/linkerscript/symbol-alias-relocation.s
    M lld/test/ELF/linkerscript/symbol-assignexpr.s
    M lld/test/ELF/linkerscript/synthetic-symbols1.test
    M lld/test/ELF/linkerscript/version-linker-symbol.s
    M lld/test/ELF/many-alloc-sections.s
    M lld/test/ELF/mips-got-extsym.s
    M lld/test/ELF/mips-micro-cross-calls.s
    M lld/test/ELF/mips-tls-64.s
    M lld/test/ELF/mips-tls-static.s
    M lld/test/ELF/mips-tls.s
    M lld/test/ELF/output-section.s
    M lld/test/ELF/partition-notes.s
    M lld/test/ELF/partition-synthetic-sections.s
    M lld/test/ELF/partitions.s
    M lld/test/ELF/ppc64-local-entry.s
    M lld/test/ELF/ppc64-pcrel-call-to-extern.s
    M lld/test/ELF/ppc64-tls-ie.s
    M lld/test/ELF/ppc64-tls-pcrel-gd.s
    M lld/test/ELF/pre_init_fini_array.s
    M lld/test/ELF/relocatable-gc.s
    M lld/test/ELF/relocatable-rel-iplt.s
    M lld/test/ELF/relocatable-symbols.s
    M lld/test/ELF/resolution.s
    M lld/test/ELF/retain-symbols-file.s
    M lld/test/ELF/start-lib.s
    M lld/test/ELF/startstop.s
    M lld/test/ELF/symbol-ordering-file-warnings.s
    M lld/test/ELF/symbols.s
    M lld/test/ELF/undef-with-plt-addr.s
    M lld/test/ELF/verdef-defaultver.s
    M lld/test/ELF/version-script-complex-wildcards.s
    M lld/test/ELF/version-script-extern-exact.s
    M lld/test/ELF/version-script-extern-wildcards-anon.s
    M lld/test/ELF/version-script-extern-wildcards.s
    M lld/test/ELF/version-script-extern.s
    M lld/test/ELF/version-script-glob.s
    M lld/test/ELF/version-script-locals.s
    M lld/test/ELF/version-script-symver2.s
    M lld/test/ELF/version-script.s
    M lld/test/ELF/vs-diagnostics-duplicate.s
    M lld/test/ELF/wrap-no-real.s
    M lld/test/ELF/x86-64-gotpc-relax-und-dso.s
    M lld/test/ELF/x86-64-tls-ie.s
    M llvm/lib/MC/ELFObjectWriter.cpp
    M llvm/test/CodeGen/AMDGPU/lds-relocs.ll
    M llvm/test/LTO/Resolution/X86/not-prevailing-alias.ll
    M llvm/test/LTO/Resolution/X86/not-prevailing.ll
    M llvm/test/MC/AArch64/size-directive.s
    M llvm/test/MC/AMDGPU/elf-lds.s
    M llvm/test/MC/ARM/arm-elf-symver.s
    M llvm/test/MC/ARM/elf-thumbfunc.s
    M llvm/test/MC/ELF/ARM/clang-section.s
    M llvm/test/MC/ELF/cgprofile.s
    M llvm/test/MC/ELF/file.s
    M llvm/test/MC/ELF/pr9292.s
    M llvm/test/MC/ELF/relocation-alias.s
    M llvm/test/MC/ELF/strtab-suffix-opt.s
    M llvm/test/MC/ELF/symver-visibility.s
    M llvm/test/MC/ELF/symver.s
    M llvm/test/MC/ELF/type.s
    M llvm/test/MC/ELF/undef.s
    M llvm/test/MC/ELF/weak.s
    M llvm/test/MC/ELF/weakref.s
    M llvm/test/MC/Mips/elf_st_other.s
    M llvm/test/MC/Mips/insn-directive.s
    M llvm/test/MC/PowerPC/ppc64-localentry-symbols.s

  Log Message:
  -----------
  ELFObjectWriter: Don't sort non-local symbols

As we don't sort local symbols, don't sort non-local symbols.  This makes
non-local symbols appear in their register order, which matches GNU as. The
register order is nice in that you can write tests with interleaved CHECK
prefixes, e.g.

```
// CHECK: something about foo
.globl foo
foo:
// CHECK: something about bar
.globl bar
bar:
```

With the lexicographical order, the user needs to place lexicographical smallest
symbol first or keep CHECK prefixes in one place.




More information about the All-commits mailing list