Skip to content

Commit

Permalink
src: Add patch for .hexagon.attributes orphan section build failure
Browse files Browse the repository at this point in the history
See the patch commit message for further details. This is currently
pending acceptance on the mailing list.

Signed-off-by: Nathan Chancellor <[email protected]>
  • Loading branch information
nathanchance committed Mar 21, 2024
1 parent fe3dda2 commit 76e5c94
Showing 1 changed file with 49 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
From git@z Thu Jan 1 00:00:00 1970
Subject: [PATCH] hexagon: vmlinux.lds.S: Handle attributes section
From: Nathan Chancellor <[email protected]>
Date: Tue, 19 Mar 2024 17:37:46 -0700
Message-Id: <20240319-hexagon-handle-attributes-section-vmlinux-lds-s-v1-1-59855dab8872@kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit

After the linked LLVM change, the build fails with
CONFIG_LD_ORPHAN_WARN_LEVEL="error", which happens with allmodconfig:

ld.lld: error: vmlinux.a(init/main.o):(.hexagon.attributes) is being placed in '.hexagon.attributes'

Handle the attributes section in a similar manner as arm and riscv by
adding it after the primary ELF_DETAILS grouping in vmlinux.lds.S, which
fixes the error.

Cc: [email protected]
Fixes: 113616ec5b64 ("hexagon: select ARCH_WANT_LD_ORPHAN_WARN")
Link: https://github.com/llvm/llvm-project/commit/31f4b329c8234fab9afa59494d7f8bdaeaefeaad
Reviewed-by: Brian Cain <[email protected]>
Link: https://lore.kernel.org/r/20240319-hexagon-handle-attributes-section-vmlinux-lds-s-v1-1-59855dab8872@kernel.org
Signed-off-by: Nathan Chancellor <[email protected]>
---
arch/hexagon/kernel/vmlinux.lds.S | 1 +
1 file changed, 1 insertion(+)

diff --git a/arch/hexagon/kernel/vmlinux.lds.S b/arch/hexagon/kernel/vmlinux.lds.S
index 1140051a0c45..1150b77fa281 100644
--- a/arch/hexagon/kernel/vmlinux.lds.S
+++ b/arch/hexagon/kernel/vmlinux.lds.S
@@ -63,6 +63,7 @@ SECTIONS
STABS_DEBUG
DWARF_DEBUG
ELF_DETAILS
+ .hexagon.attributes 0 : { *(.hexagon.attributes) }

DISCARDS
}

---
base-commit: e8f897f4afef0031fe618a8e94127a0934896aba
change-id: 20240319-hexagon-handle-attributes-section-vmlinux-lds-s-2a14b14799c0

Best regards,
--
Nathan Chancellor <[email protected]>

0 comments on commit 76e5c94

Please sign in to comment.