[all-commits] [llvm/llvm-project] e79e80: [MC][NFCI] Factor out ELF section unique ID calcul...

tmatheson-arm via All-commits all-commits at lists.llvm.org
Wed May 26 03:52:38 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e79e8041c5ff6a611390b6c3c8484d2cc80ab21d
      https://github.com/llvm/llvm-project/commit/e79e8041c5ff6a611390b6c3c8484d2cc80ab21d
  Author: Tomas Matheson <tomas.matheson at arm.com>
  Date:   2021-05-26 (Wed, 26 May 2021)

  Changed paths:
    M llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp

  Log Message:
  -----------
  [MC][NFCI] Factor out ELF section unique ID calculation

Precursor to D100944. The logic for determining the unique ID had become
quite difficult to reason about, so I have factored this out into a
separate function.

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


  Commit: 165321b3d27de5349520b5fdb7e08cbd238c880f
      https://github.com/llvm/llvm-project/commit/165321b3d27de5349520b5fdb7e08cbd238c880f
  Author: Tomas Matheson <tomas.matheson at arm.com>
  Date:   2021-05-26 (Wed, 26 May 2021)

  Changed paths:
    M llvm/include/llvm/MC/MCContext.h
    M llvm/lib/MC/MCContext.cpp
    A llvm/test/CodeGen/Generic/elf-unique-sections-by-flags.ll
    M llvm/test/CodeGen/Mips/gpopt-explict-section.ll
    M llvm/test/CodeGen/X86/explicit-section-mergeable.ll
    M llvm/unittests/ExecutionEngine/Orc/RTDyldObjectLinkingLayerTest.cpp

  Log Message:
  -----------
  [MC][ELF] Emit unique sections for different flags

Global values imply flags such as readable, writable, executable for the
sections that they will be placed in. Currently MC places all such
entries into the same section, using the first set of flags seen. This
can lead to situations in LTO where a writable global is placed in the
same named section as a readable global from another file, and the
section may not be marked writable.

D72194 ensures that mergeable globals with explicit sections are placed
in separate sections with compatible entry size, by emitting the
`unique` assembly syntax where appropriate. This change extends that
approach to include section flags, so that globals with different
section flags are emitted in separate unique sections.

Differential revision: https://reviews.llvm.org/D100944


Compare: https://github.com/llvm/llvm-project/compare/a2d6ef587653...165321b3d27d


More information about the All-commits mailing list