[all-commits] [llvm/llvm-project] b3d5bb: [ELF] Change (NOLOAD) type mismatch to use SHT_NOB...

Fangrui Song via All-commits all-commits at lists.llvm.org
Fri May 6 07:49:54 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b3d5bb3b308f9a41022cdd30542991840b826a6b
      https://github.com/llvm/llvm-project/commit/b3d5bb3b308f9a41022cdd30542991840b826a6b
  Author: Fangrui Song <i at maskray.me>
  Date:   2022-05-06 (Fri, 06 May 2022)

  Changed paths:
    M lld/ELF/OutputSections.cpp
    M lld/test/ELF/linkerscript/custom-section-type.s
    M lld/test/ELF/linkerscript/noload.s

  Log Message:
  -----------
  [ELF] Change (NOLOAD) type mismatch to use SHT_NOBITS instead of SHT_PROGBITS

Placing a non-SHT_NOBITS input section in an output section specified with
(NOLOAD) is fishy but used by some projects. D118840 changed the output type to
SHT_PROGBITS, but using the specified type seems to make more sense and improve
GNU ld compatibility: `(NOLOAD)` seems to change the output section type
regardless of input.

I think we should keep the current type mismatch warning as it does indicate an
error-prone usage.

Reviewed By: peter.smith

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




More information about the All-commits mailing list