1. 08 Feb, 2023 3 commits
  2. 07 Feb, 2023 1 commit
  3. 30 Jan, 2023 10 commits
  4. 26 Jan, 2023 2 commits
  5. 10 Jan, 2023 1 commit
  6. 05 Jan, 2023 3 commits
    • Michael Ellerman's avatar
      powerpc/vmlinux.lds: Don't discard .comment · be5f95c8
      Michael Ellerman authored
      Although the powerpc linker script mentions .comment in the DISCARD
      section, that has never actually caused it to be discarded, because the
      earlier ELF_DETAILS macro (previously STABS_DEBUG) explicitly includes
      .comment.
      
      However commit 99cb0d91 ("arch: fix broken BuildID for arm64 and
      riscv") introduced an earlier use of DISCARD as part of the RO_DATA
      macro. With binutils < 2.36 that causes the DISCARD directives later in
      the script to be applied earlier, causing .comment to actually be
      discarded.
      
      It's confusing to explicitly include and discard .comment, and even more
      so if the behaviour depends on the toolchain version. So don't discard
      .comment in order to maintain the existing behaviour in all cases.
      
      Fixes: 83a092cf ("powerpc: Link warning for orphan sections")
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/20230105132349.384666-3-mpe@ellerman.id.au
      be5f95c8
    • Michael Ellerman's avatar
      powerpc/vmlinux.lds: Don't discard .rela* for relocatable builds · 07b050f9
      Michael Ellerman authored
      Relocatable kernels must not discard relocations, they need to be
      processed at runtime. As such they are included for CONFIG_RELOCATABLE
      builds in the powerpc linker script (line 340).
      
      However they are also unconditionally discarded later in the
      script (line 414). Previously that worked because the earlier inclusion
      superseded the discard.
      
      However commit 99cb0d91 ("arch: fix broken BuildID for arm64 and
      riscv") introduced an earlier use of DISCARD as part of the RO_DATA
      macro (line 137). With binutils < 2.36 that causes the DISCARD
      directives later in the script to be applied earlier, causing .rela* to
      actually be discarded at link time, leading to build warnings and a
      kernel that doesn't boot:
      
        ld: warning: discarding dynamic section .rela.init.rodata
      
      Fix it by conditionally discarding .rela* only when CONFIG_RELOCATABLE
      is disabled.
      
      Fixes: 99cb0d91 ("arch: fix broken BuildID for arm64 and riscv")
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      
      Link: https://lore.kernel.org/r/20230105132349.384666-2-mpe@ellerman.id.au
      07b050f9
    • Michael Ellerman's avatar
      powerpc/vmlinux.lds: Define RUNTIME_DISCARD_EXIT · 4b9880db
      Michael Ellerman authored
      The powerpc linker script explicitly includes .exit.text, because
      otherwise the link fails due to references from __bug_table and
      __ex_table. The code is freed (discarded) at runtime along with
      .init.text and data.
      
      That has worked in the past despite powerpc not defining
      RUNTIME_DISCARD_EXIT because DISCARDS appears late in the powerpc linker
      script (line 410), and the explicit inclusion of .exit.text
      earlier (line 280) supersedes the discard.
      
      However commit 99cb0d91 ("arch: fix broken BuildID for arm64 and
      riscv") introduced an earlier use of DISCARD as part of the RO_DATA
      macro (line 136). With binutils < 2.36 that causes the DISCARD
      directives later in the script to be applied earlier [1], causing
      .exit.text to actually be discarded at link time, leading to build
      errors:
      
        '.exit.text' referenced in section '__bug_table' of crypto/algboss.o: defined in
        discarded section '.exit.text' of crypto/algboss.o
        '.exit.text' referenced in section '__ex_table' of drivers/nvdimm/core.o: defined in
        discarded section '.exit.text' of drivers/nvdimm/core.o
      
      Fix it by defining RUNTIME_DISCARD_EXIT, which causes the generic
      DISCARDS macro to not include .exit.text at all.
      
      1: https://lore.kernel.org/lkml/87fscp2v7k.fsf@igel.home/
      
      Fixes: 99cb0d91 ("arch: fix broken BuildID for arm64 and riscv")
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/20230105132349.384666-1-mpe@ellerman.id.au
      4b9880db
  7. 01 Jan, 2023 6 commits
  8. 31 Dec, 2022 2 commits
  9. 30 Dec, 2022 12 commits