linux-stable/arch/hexagon/kernel/vmlinux.lds.S
Nathan Chancellor 51c99c6795 hexagon: vmlinux.lds.S: handle attributes section
commit 549aa9678a upstream.

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.

Link: https://lkml.kernel.org/r/20240319-hexagon-handle-attributes-section-vmlinux-lds-s-v1-1-59855dab8872@kernel.org
Fixes: 113616ec5b ("hexagon: select ARCH_WANT_LD_ORPHAN_WARN")
Link: 31f4b329c8
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Brian Cain <bcain@quicinc.com>
Cc: Bill Wendling <morbo@google.com>
Cc: Justin Stitt <justinstitt@google.com>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-04-13 12:59:04 +02:00

70 lines
1.3 KiB
ArmAsm

/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Linker script for Hexagon kernel
*
* Copyright (c) 2010-2014, The Linux Foundation. All rights reserved.
*/
#include <asm-generic/vmlinux.lds.h>
#include <asm/asm-offsets.h> /* Most of the kernel defines are here */
#include <asm/mem-layout.h> /* except for page_offset */
#include <asm/cache.h> /* and now we're pulling cache line size */
#include <asm/thread_info.h> /* and we need THREAD_SIZE too */
OUTPUT_ARCH(hexagon)
ENTRY(stext)
jiffies = jiffies_64;
/*
See asm-generic/vmlinux.lds.h for expansion of some of these macros.
See asm-generic/sections.h for seemingly required labels.
*/
#define PAGE_SIZE _PAGE_SIZE
SECTIONS
{
. = PAGE_OFFSET;
__init_begin = .;
HEAD_TEXT_SECTION
INIT_TEXT_SECTION(PAGE_SIZE)
PERCPU_SECTION(L1_CACHE_BYTES)
__init_end = .;
. = ALIGN(_PAGE_SIZE);
_stext = .;
.text : AT(ADDR(.text)) {
_text = .;
TEXT_TEXT
IRQENTRY_TEXT
SOFTIRQENTRY_TEXT
SCHED_TEXT
CPUIDLE_TEXT
LOCK_TEXT
KPROBES_TEXT
*(.fixup)
}
_etext = .;
INIT_DATA_SECTION(PAGE_SIZE)
_sdata = .;
RW_DATA(32,PAGE_SIZE,_THREAD_SIZE)
RO_DATA(PAGE_SIZE)
_edata = .;
EXCEPTION_TABLE(16)
BSS_SECTION(_PAGE_SIZE, _PAGE_SIZE, _PAGE_SIZE)
_end = .;
STABS_DEBUG
DWARF_DEBUG
ELF_DETAILS
.hexagon.attributes 0 : { *(.hexagon.attributes) }
DISCARDS
}