[all-commits] [llvm/llvm-project] b6ccc8: [ELF][test] Rename SHF_LINK_ORDER related "metadat...

Fangrui Song via All-commits all-commits at lists.llvm.org
Tue Apr 14 22:36:27 PDT 2020


  Branch: refs/heads/release/10.x
  Home:   https://github.com/llvm/llvm-project
  Commit: b6ccc88d575c78cb6cfebf545ef2c8d159cbdf3c
      https://github.com/llvm/llvm-project/commit/b6ccc88d575c78cb6cfebf545ef2c8d159cbdf3c
  Author: Fangrui Song <maskray at google.com>
  Date:   2020-04-14 (Tue, 14 Apr 2020)

  Changed paths:
    A lld/test/ELF/gc-sections-linkorder-err.s
    A lld/test/ELF/gc-sections-linkorder.s
    A lld/test/ELF/gc-sections-linkorder2.s
    R lld/test/ELF/gc-sections-metadata-err.s
    R lld/test/ELF/gc-sections-metadata.s
    R lld/test/ELF/gc-sections-metadata2.s
    A lld/test/ELF/linkerscript/discard-linkorder.s
    R lld/test/ELF/linkerscript/discard-section-metadata.s
    A lld/test/ELF/linkerscript/linkorder.s
    A lld/test/ELF/linkerscript/linkorder2.s
    R lld/test/ELF/linkerscript/section-metadata.s
    R lld/test/ELF/linkerscript/section-metadata2.s
    A lld/test/ELF/linkorder-err.s
    A lld/test/ELF/linkorder-err2.s
    A lld/test/ELF/linkorder-err3.s
    R lld/test/ELF/section-metadata-err.s
    R lld/test/ELF/section-metadata-err2.s
    R lld/test/ELF/section-metadata-err3.s

  Log Message:
  -----------
  [ELF][test] Rename SHF_LINK_ORDER related "metadata" to "linkorder"

Test cleanups.

(cherry picked from commit b305b8a256eade076bb13f52668a6015631ac0e5)


  Commit: b2881de649ca27bd00942a4dc6b0e3a0f7e7f32f
      https://github.com/llvm/llvm-project/commit/b2881de649ca27bd00942a4dc6b0e3a0f7e7f32f
  Author: Fangrui Song <maskray at google.com>
  Date:   2020-04-14 (Tue, 14 Apr 2020)

  Changed paths:
    M lld/test/ELF/linkerscript/linkorder.s

  Log Message:
  -----------
  [ELF][test] Improve linkerscript/linkorder.s

(cherry picked from commit 2d19270efcf01672c8eaab1ccb0e5b89ea953cc9)


  Commit: 71c3f57326cf956330f47f9061104e0f299cb7cf
      https://github.com/llvm/llvm-project/commit/71c3f57326cf956330f47f9061104e0f299cb7cf
  Author: Fangrui Song <maskray at google.com>
  Date:   2020-04-14 (Tue, 14 Apr 2020)

  Changed paths:
    M lld/ELF/OutputSections.cpp
    M lld/ELF/Writer.cpp
    M lld/test/ELF/linkerscript/linkorder.s
    R lld/test/ELF/linkorder-err3.s

  Log Message:
  -----------
  [ELF] Allow SHF_LINK_ORDER and non-SHF_LINK_ORDER to be mixed

Currently, `error: incompatible section flags for .rodata` is reported
when we mix SHF_LINK_ORDER and non-SHF_LINK_ORDER sections in an output section.

This is overconstrained. This patch allows mixed flags with the
requirement that SHF_LINK_ORDER sections must be contiguous. Mixing
flags is used by Linux aarch64 (https://github.com/ClangBuiltLinux/linux/issues/953)

  .init.data : { ... KEEP(*(__patchable_function_entries)) ... }

When the integrated assembler is enabled, clang's -fpatchable-function-entry=N[,M]
implementation sets the SHF_LINK_ORDER flag (D72215) to fix a number of
garbage collection issues.

Strictly speaking, the ELF specification does not require contiguous
SHF_LINK_ORDER sections but for many current uses of SHF_LINK_ORDER like
.ARM.exidx/__patchable_function_entries there has been a requirement for
the sections to be contiguous on top of the requirements of the ELF
specification.

This patch also imposes one restriction: SHF_LINK_ORDER sections cannot
be separated by a symbol assignment or a BYTE command. Not allowing BYTE
is a natural extension that a non-SHF_LINK_ORDER cannot be a separator.
Symbol assignments can delimiter the contents of SHF_LINK_ORDER
sections.  Allowing SHF_LINK_ORDER sections across symbol assignments
(especially __start_/__stop_) can make things hard to explain. The
restriction should not be a problem for practical use cases.

Reviewed By: psmith

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

(cherry picked from commit 673e81eee4fa3ffa38736f1063e6c4fa2d9278b0)


Compare: https://github.com/llvm/llvm-project/compare/e3ac79a64905...71c3f57326cf


More information about the All-commits mailing list