Merge 34eb62d868 ("Merge tag 'core-build-2020-10-12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip") into android-mainline
Steps on the way to 5.10-rc1 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Change-Id: Ic605c3794555d23d61243eb344002827e7089076
This commit is contained in:
@@ -72,6 +72,7 @@ SECTIONS
|
||||
|
||||
STABS_DEBUG
|
||||
DWARF_DEBUG
|
||||
ELF_DETAILS
|
||||
|
||||
DISCARDS
|
||||
}
|
||||
|
||||
@@ -122,6 +122,7 @@ SECTIONS
|
||||
_end = . ;
|
||||
|
||||
STABS_DEBUG
|
||||
ELF_DETAILS
|
||||
DISCARDS
|
||||
|
||||
.arcextmap 0 : {
|
||||
|
||||
@@ -16,6 +16,10 @@ LDFLAGS_vmlinux += --be8
|
||||
KBUILD_LDFLAGS_MODULE += --be8
|
||||
endif
|
||||
|
||||
# We never want expected sections to be placed heuristically by the
|
||||
# linker. All sections should be explicitly named in the linker script.
|
||||
LDFLAGS_vmlinux += $(call ld-option, --orphan-handling=warn)
|
||||
|
||||
ifeq ($(CONFIG_ARM_MODULE_PLTS),y)
|
||||
KBUILD_LDS_MODULE += $(srctree)/arch/arm/kernel/module.lds
|
||||
endif
|
||||
|
||||
@@ -123,6 +123,8 @@ endif
|
||||
LDFLAGS_vmlinux += --no-undefined
|
||||
# Delete all temporary local symbols
|
||||
LDFLAGS_vmlinux += -X
|
||||
# Report orphan sections
|
||||
LDFLAGS_vmlinux += $(call ld-option, --orphan-handling=warn)
|
||||
# Next argument is a linker script
|
||||
LDFLAGS_vmlinux += -T
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
/*
|
||||
* Copyright (C) 2000 Russell King
|
||||
*/
|
||||
#include <asm/vmlinux.lds.h>
|
||||
|
||||
#ifdef CONFIG_CPU_ENDIAN_BE8
|
||||
#define ZIMAGE_MAGIC(x) ( (((x) >> 24) & 0x000000ff) | \
|
||||
@@ -17,8 +18,11 @@ ENTRY(_start)
|
||||
SECTIONS
|
||||
{
|
||||
/DISCARD/ : {
|
||||
COMMON_DISCARDS
|
||||
*(.ARM.exidx*)
|
||||
*(.ARM.extab*)
|
||||
*(.note.*)
|
||||
*(.rel.*)
|
||||
/*
|
||||
* Discard any r/w data - this produces a link error if we have any,
|
||||
* which is required for PIC decompression. Local data generates
|
||||
@@ -36,9 +40,7 @@ SECTIONS
|
||||
*(.start)
|
||||
*(.text)
|
||||
*(.text.*)
|
||||
*(.gnu.warning)
|
||||
*(.glue_7t)
|
||||
*(.glue_7)
|
||||
ARM_STUBS_TEXT
|
||||
}
|
||||
.table : ALIGN(4) {
|
||||
_table_start = .;
|
||||
@@ -128,12 +130,10 @@ SECTIONS
|
||||
PROVIDE(__pecoff_data_size = ALIGN(512) - ADDR(.data));
|
||||
PROVIDE(__pecoff_end = ALIGN(512));
|
||||
|
||||
.stab 0 : { *(.stab) }
|
||||
.stabstr 0 : { *(.stabstr) }
|
||||
.stab.excl 0 : { *(.stab.excl) }
|
||||
.stab.exclstr 0 : { *(.stab.exclstr) }
|
||||
.stab.index 0 : { *(.stab.index) }
|
||||
.stab.indexstr 0 : { *(.stab.indexstr) }
|
||||
.comment 0 : { *(.comment) }
|
||||
STABS_DEBUG
|
||||
DWARF_DEBUG
|
||||
ARM_DETAILS
|
||||
|
||||
ARM_ASSERTS
|
||||
}
|
||||
ASSERT(_edata_real == _edata, "error: zImage file size is incorrect");
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
#include <asm-generic/vmlinux.lds.h>
|
||||
|
||||
#ifdef CONFIG_HOTPLUG_CPU
|
||||
#define ARM_CPU_DISCARD(x)
|
||||
@@ -49,8 +50,29 @@
|
||||
EXIT_CALL \
|
||||
ARM_MMU_DISCARD(*(.text.fixup)) \
|
||||
ARM_MMU_DISCARD(*(__ex_table)) \
|
||||
*(.discard) \
|
||||
*(.discard.*)
|
||||
COMMON_DISCARDS
|
||||
|
||||
/*
|
||||
* Sections that should stay zero sized, which is safer to explicitly
|
||||
* check instead of blindly discarding.
|
||||
*/
|
||||
#define ARM_ASSERTS \
|
||||
.plt : { \
|
||||
*(.iplt) *(.rel.iplt) *(.iplt) *(.igot.plt) \
|
||||
} \
|
||||
ASSERT(SIZEOF(.plt) == 0, \
|
||||
"Unexpected run-time procedure linkages detected!")
|
||||
|
||||
#define ARM_DETAILS \
|
||||
ELF_DETAILS \
|
||||
.ARM.attributes 0 : { *(.ARM.attributes) }
|
||||
|
||||
#define ARM_STUBS_TEXT \
|
||||
*(.gnu.warning) \
|
||||
*(.glue_7) \
|
||||
*(.glue_7t) \
|
||||
*(.vfp11_veneer) \
|
||||
*(.v4_bx)
|
||||
|
||||
#define ARM_TEXT \
|
||||
IDMAP_TEXT \
|
||||
@@ -64,9 +86,7 @@
|
||||
CPUIDLE_TEXT \
|
||||
LOCK_TEXT \
|
||||
KPROBES_TEXT \
|
||||
*(.gnu.warning) \
|
||||
*(.glue_7) \
|
||||
*(.glue_7t) \
|
||||
ARM_STUBS_TEXT \
|
||||
. = ALIGN(4); \
|
||||
*(.got) /* Global offset table */ \
|
||||
ARM_CPU_KEEP(PROC_INFO)
|
||||
@@ -9,15 +9,13 @@
|
||||
|
||||
#include <linux/sizes.h>
|
||||
|
||||
#include <asm-generic/vmlinux.lds.h>
|
||||
#include <asm/vmlinux.lds.h>
|
||||
#include <asm/cache.h>
|
||||
#include <asm/thread_info.h>
|
||||
#include <asm/memory.h>
|
||||
#include <asm/mpu.h>
|
||||
#include <asm/page.h>
|
||||
|
||||
#include "vmlinux.lds.h"
|
||||
|
||||
OUTPUT_ARCH(arm)
|
||||
ENTRY(stext)
|
||||
|
||||
@@ -152,6 +150,10 @@ SECTIONS
|
||||
_end = .;
|
||||
|
||||
STABS_DEBUG
|
||||
DWARF_DEBUG
|
||||
ARM_DETAILS
|
||||
|
||||
ARM_ASSERTS
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -9,15 +9,13 @@
|
||||
#else
|
||||
|
||||
#include <linux/pgtable.h>
|
||||
#include <asm-generic/vmlinux.lds.h>
|
||||
#include <asm/vmlinux.lds.h>
|
||||
#include <asm/cache.h>
|
||||
#include <asm/thread_info.h>
|
||||
#include <asm/memory.h>
|
||||
#include <asm/mpu.h>
|
||||
#include <asm/page.h>
|
||||
|
||||
#include "vmlinux.lds.h"
|
||||
|
||||
OUTPUT_ARCH(arm)
|
||||
ENTRY(stext)
|
||||
|
||||
@@ -151,6 +149,10 @@ SECTIONS
|
||||
_end = .;
|
||||
|
||||
STABS_DEBUG
|
||||
DWARF_DEBUG
|
||||
ARM_DETAILS
|
||||
|
||||
ARM_ASSERTS
|
||||
}
|
||||
|
||||
#ifdef CONFIG_STRICT_KERNEL_RWX
|
||||
|
||||
+8
-1
@@ -28,6 +28,10 @@ LDFLAGS_vmlinux += --fix-cortex-a53-843419
|
||||
endif
|
||||
endif
|
||||
|
||||
# We never want expected sections to be placed heuristically by the
|
||||
# linker. All sections should be explicitly named in the linker script.
|
||||
LDFLAGS_vmlinux += $(call ld-option, --orphan-handling=warn)
|
||||
|
||||
ifeq ($(CONFIG_ARM64_USE_LSE_ATOMICS), y)
|
||||
ifneq ($(CONFIG_ARM64_LSE_ATOMICS), y)
|
||||
$(warning LSE atomics not supported by binutils)
|
||||
@@ -46,13 +50,16 @@ endif
|
||||
|
||||
KBUILD_CFLAGS += -mgeneral-regs-only \
|
||||
$(compat_vdso) $(cc_has_k_constraint)
|
||||
KBUILD_CFLAGS += -fno-asynchronous-unwind-tables
|
||||
KBUILD_CFLAGS += $(call cc-disable-warning, psabi)
|
||||
KBUILD_AFLAGS += $(compat_vdso)
|
||||
|
||||
KBUILD_CFLAGS += $(call cc-option,-mabi=lp64)
|
||||
KBUILD_AFLAGS += $(call cc-option,-mabi=lp64)
|
||||
|
||||
# Avoid generating .eh_frame* sections.
|
||||
KBUILD_CFLAGS += -fno-asynchronous-unwind-tables -fno-unwind-tables
|
||||
KBUILD_AFLAGS += -fno-asynchronous-unwind-tables -fno-unwind-tables
|
||||
|
||||
ifeq ($(CONFIG_STACKPROTECTOR_PER_TASK),y)
|
||||
prepare: stack_protector_prepare
|
||||
stack_protector_prepare: prepare0
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
#include <asm/assembler.h>
|
||||
|
||||
.macro SMCCC instr
|
||||
.cfi_startproc
|
||||
\instr #0
|
||||
ldr x4, [sp]
|
||||
stp x0, x1, [x4, #ARM_SMCCC_RES_X0_OFFS]
|
||||
@@ -21,7 +20,6 @@
|
||||
b.ne 1f
|
||||
str x6, [x4, ARM_SMCCC_QUIRK_STATE_OFFS]
|
||||
1: ret
|
||||
.cfi_endproc
|
||||
.endm
|
||||
|
||||
/*
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
*/
|
||||
|
||||
#define RO_EXCEPTION_TABLE_ALIGN 8
|
||||
#define RUNTIME_DISCARD_EXIT
|
||||
|
||||
#include <asm-generic/vmlinux.lds.h>
|
||||
#include <asm/cache.h>
|
||||
@@ -96,13 +97,10 @@ SECTIONS
|
||||
* matching the same input section name. There is no documented
|
||||
* order of matching.
|
||||
*/
|
||||
DISCARDS
|
||||
/DISCARD/ : {
|
||||
EXIT_CALL
|
||||
*(.discard)
|
||||
*(.discard.*)
|
||||
*(.interp .dynamic)
|
||||
*(.dynsym .dynstr .hash .gnu.hash)
|
||||
*(.eh_frame)
|
||||
}
|
||||
|
||||
. = KIMAGE_VADDR;
|
||||
@@ -131,6 +129,14 @@ SECTIONS
|
||||
*(.got) /* Global offset table */
|
||||
}
|
||||
|
||||
/*
|
||||
* Make sure that the .got.plt is either completely empty or it
|
||||
* contains only the lazy dispatch entries.
|
||||
*/
|
||||
.got.plt : { *(.got.plt) }
|
||||
ASSERT(SIZEOF(.got.plt) == 0 || SIZEOF(.got.plt) == 0x18,
|
||||
"Unexpected GOT/PLT entries detected!")
|
||||
|
||||
. = ALIGN(SEGMENT_ALIGN);
|
||||
_etext = .; /* End of text section */
|
||||
|
||||
@@ -249,8 +255,22 @@ SECTIONS
|
||||
_end = .;
|
||||
|
||||
STABS_DEBUG
|
||||
DWARF_DEBUG
|
||||
ELF_DETAILS
|
||||
|
||||
HEAD_SYMBOLS
|
||||
|
||||
/*
|
||||
* Sections that should stay zero sized, which is safer to
|
||||
* explicitly check instead of blindly discarding.
|
||||
*/
|
||||
.plt : {
|
||||
*(.plt) *(.plt.*) *(.iplt) *(.igot)
|
||||
}
|
||||
ASSERT(SIZEOF(.plt) == 0, "Unexpected run-time procedure linkages detected!")
|
||||
|
||||
.data.rel.ro : { *(.data.rel.ro) }
|
||||
ASSERT(SIZEOF(.data.rel.ro) == 0, "Unexpected RELRO detected!")
|
||||
}
|
||||
|
||||
#include "image-vars.h"
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@
|
||||
u64 idmap_t0sz = TCR_T0SZ(VA_BITS);
|
||||
u64 idmap_ptrs_per_pgd = PTRS_PER_PGD;
|
||||
|
||||
u64 __section(".mmuoff.data.write") vabits_actual;
|
||||
u64 __section(.mmuoff.data.write) vabits_actual;
|
||||
EXPORT_SYMBOL(vabits_actual);
|
||||
|
||||
u64 kimage_voffset __ro_after_init;
|
||||
|
||||
@@ -109,6 +109,7 @@ SECTIONS
|
||||
|
||||
STABS_DEBUG
|
||||
DWARF_DEBUG
|
||||
ELF_DETAILS
|
||||
|
||||
DISCARDS
|
||||
}
|
||||
|
||||
@@ -67,5 +67,6 @@ SECTIONS
|
||||
|
||||
STABS_DEBUG
|
||||
DWARF_DEBUG
|
||||
ELF_DETAILS
|
||||
|
||||
}
|
||||
|
||||
@@ -218,6 +218,7 @@ SECTIONS {
|
||||
|
||||
STABS_DEBUG
|
||||
DWARF_DEBUG
|
||||
ELF_DETAILS
|
||||
|
||||
/* Default discards */
|
||||
DISCARDS
|
||||
|
||||
@@ -202,6 +202,7 @@ SECTIONS
|
||||
|
||||
STABS_DEBUG
|
||||
DWARF_DEBUG
|
||||
ELF_DETAILS
|
||||
|
||||
/* These must appear regardless of . */
|
||||
.gptab.sdata : {
|
||||
|
||||
@@ -64,6 +64,7 @@ SECTIONS
|
||||
|
||||
STABS_DEBUG
|
||||
DWARF_DEBUG
|
||||
ELF_DETAILS
|
||||
|
||||
DISCARDS
|
||||
}
|
||||
|
||||
@@ -58,6 +58,7 @@ SECTIONS
|
||||
|
||||
STABS_DEBUG
|
||||
DWARF_DEBUG
|
||||
ELF_DETAILS
|
||||
|
||||
DISCARDS
|
||||
}
|
||||
|
||||
@@ -103,6 +103,7 @@ SECTIONS
|
||||
/* Throw in the debugging sections */
|
||||
STABS_DEBUG
|
||||
DWARF_DEBUG
|
||||
ELF_DETAILS
|
||||
|
||||
/* Sections to be discarded -- must be last */
|
||||
DISCARDS
|
||||
|
||||
@@ -84,6 +84,7 @@ SECTIONS
|
||||
}
|
||||
|
||||
STABS_DEBUG
|
||||
ELF_DETAILS
|
||||
.note 0 : { *(.note) }
|
||||
|
||||
/* Sections to be discarded */
|
||||
|
||||
@@ -164,6 +164,7 @@ SECTIONS
|
||||
_end = . ;
|
||||
|
||||
STABS_DEBUG
|
||||
ELF_DETAILS
|
||||
.note 0 : { *(.note) }
|
||||
|
||||
/* Sections to be discarded */
|
||||
|
||||
@@ -360,8 +360,8 @@ SECTIONS
|
||||
PROVIDE32 (end = .);
|
||||
|
||||
STABS_DEBUG
|
||||
|
||||
DWARF_DEBUG
|
||||
ELF_DETAILS
|
||||
|
||||
DISCARDS
|
||||
/DISCARD/ : {
|
||||
|
||||
@@ -98,6 +98,7 @@ SECTIONS
|
||||
|
||||
STABS_DEBUG
|
||||
DWARF_DEBUG
|
||||
ELF_DETAILS
|
||||
|
||||
DISCARDS
|
||||
}
|
||||
|
||||
@@ -181,6 +181,7 @@ SECTIONS
|
||||
/* Debugging sections. */
|
||||
STABS_DEBUG
|
||||
DWARF_DEBUG
|
||||
ELF_DETAILS
|
||||
|
||||
/* Sections to be discarded */
|
||||
DISCARDS
|
||||
|
||||
@@ -76,6 +76,7 @@ SECTIONS
|
||||
|
||||
STABS_DEBUG
|
||||
DWARF_DEBUG
|
||||
ELF_DETAILS
|
||||
|
||||
DISCARDS
|
||||
}
|
||||
|
||||
@@ -187,6 +187,7 @@ SECTIONS
|
||||
|
||||
STABS_DEBUG
|
||||
DWARF_DEBUG
|
||||
ELF_DETAILS
|
||||
|
||||
DISCARDS
|
||||
}
|
||||
|
||||
@@ -164,8 +164,8 @@ SECTIONS
|
||||
PROVIDE (end = .);
|
||||
|
||||
STABS_DEBUG
|
||||
|
||||
DWARF_DEBUG
|
||||
ELF_DETAILS
|
||||
|
||||
DISCARDS
|
||||
}
|
||||
|
||||
@@ -108,8 +108,8 @@ SECTIONS
|
||||
PROVIDE (end = .);
|
||||
|
||||
STABS_DEBUG
|
||||
|
||||
DWARF_DEBUG
|
||||
ELF_DETAILS
|
||||
|
||||
DISCARDS
|
||||
}
|
||||
|
||||
@@ -209,6 +209,10 @@ ifdef CONFIG_X86_64
|
||||
LDFLAGS_vmlinux += -z max-page-size=0x200000
|
||||
endif
|
||||
|
||||
# We never want expected sections to be placed heuristically by the
|
||||
# linker. All sections should be explicitly named in the linker script.
|
||||
LDFLAGS_vmlinux += $(call ld-option, --orphan-handling=warn)
|
||||
|
||||
archscripts: scripts_basic
|
||||
$(Q)$(MAKE) $(build)=arch/x86/tools relocs
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ targets := vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma \
|
||||
vmlinux.bin.xz vmlinux.bin.lzo vmlinux.bin.lz4 vmlinux.bin.zst
|
||||
|
||||
KBUILD_CFLAGS := -m$(BITS) -O2
|
||||
KBUILD_CFLAGS += -fno-strict-aliasing $(call cc-option, -fPIE, -fPIC)
|
||||
KBUILD_CFLAGS += -fno-strict-aliasing -fPIE
|
||||
KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING
|
||||
cflags-$(CONFIG_X86_32) := -march=i386
|
||||
cflags-$(CONFIG_X86_64) := -mcmodel=small
|
||||
@@ -43,18 +43,20 @@ KBUILD_CFLAGS += -Wno-pointer-sign
|
||||
KBUILD_CFLAGS += $(call cc-option,-fmacro-prefix-map=$(srctree)/=)
|
||||
KBUILD_CFLAGS += -fno-asynchronous-unwind-tables
|
||||
KBUILD_CFLAGS += -D__DISABLE_EXPORTS
|
||||
KBUILD_CFLAGS += -include $(srctree)/$(src)/hidden.h
|
||||
# Disable relocation relaxation in case the link is not PIE.
|
||||
KBUILD_CFLAGS += $(call as-option,-Wa$(comma)-mrelax-relocations=no)
|
||||
KBUILD_CFLAGS += -include $(srctree)/include/linux/hidden.h
|
||||
|
||||
KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__
|
||||
GCOV_PROFILE := n
|
||||
UBSAN_SANITIZE :=n
|
||||
|
||||
KBUILD_LDFLAGS := -m elf_$(UTS_MACHINE)
|
||||
KBUILD_LDFLAGS += $(call ld-option,--no-ld-generated-unwind-info)
|
||||
# Compressed kernel should be built as PIE since it may be loaded at any
|
||||
# address by the bootloader.
|
||||
LDFLAGS_vmlinux := -pie $(call ld-option, --no-dynamic-linker)
|
||||
LDFLAGS_vmlinux += $(call ld-option, --orphan-handling=warn)
|
||||
LDFLAGS_vmlinux += -T
|
||||
|
||||
hostprogs := mkpiggy
|
||||
|
||||
@@ -42,19 +42,6 @@ SECTIONS
|
||||
*(.rodata.*)
|
||||
_erodata = . ;
|
||||
}
|
||||
.rel.dyn : {
|
||||
*(.rel.*)
|
||||
}
|
||||
.rela.dyn : {
|
||||
*(.rela.*)
|
||||
}
|
||||
.got : {
|
||||
*(.got)
|
||||
}
|
||||
.got.plt : {
|
||||
*(.got.plt)
|
||||
}
|
||||
|
||||
.data : {
|
||||
_data = . ;
|
||||
*(.data)
|
||||
@@ -82,14 +69,49 @@ SECTIONS
|
||||
. = ALIGN(PAGE_SIZE); /* keep ZO size page aligned */
|
||||
_end = .;
|
||||
|
||||
STABS_DEBUG
|
||||
DWARF_DEBUG
|
||||
ELF_DETAILS
|
||||
|
||||
DISCARDS
|
||||
}
|
||||
/DISCARD/ : {
|
||||
*(.dynamic) *(.dynsym) *(.dynstr) *(.dynbss)
|
||||
*(.hash) *(.gnu.hash)
|
||||
*(.note.*)
|
||||
}
|
||||
|
||||
ASSERT(SIZEOF(.got) == 0, "Unexpected GOT entries detected!")
|
||||
.got.plt (INFO) : {
|
||||
*(.got.plt)
|
||||
}
|
||||
ASSERT(SIZEOF(.got.plt) == 0 ||
|
||||
#ifdef CONFIG_X86_64
|
||||
ASSERT(SIZEOF(.got.plt) == 0 || SIZEOF(.got.plt) == 0x18, "Unexpected GOT/PLT entries detected!")
|
||||
SIZEOF(.got.plt) == 0x18,
|
||||
#else
|
||||
ASSERT(SIZEOF(.got.plt) == 0 || SIZEOF(.got.plt) == 0xc, "Unexpected GOT/PLT entries detected!")
|
||||
SIZEOF(.got.plt) == 0xc,
|
||||
#endif
|
||||
"Unexpected GOT/PLT entries detected!")
|
||||
|
||||
ASSERT(SIZEOF(.rel.dyn) == 0 && SIZEOF(.rela.dyn) == 0, "Unexpected run-time relocations detected!")
|
||||
/*
|
||||
* Sections that should stay zero sized, which is safer to
|
||||
* explicitly check instead of blindly discarding.
|
||||
*/
|
||||
.got : {
|
||||
*(.got)
|
||||
}
|
||||
ASSERT(SIZEOF(.got) == 0, "Unexpected GOT entries detected!")
|
||||
|
||||
.plt : {
|
||||
*(.plt) *(.plt.*)
|
||||
}
|
||||
ASSERT(SIZEOF(.plt) == 0, "Unexpected run-time procedure linkages detected!")
|
||||
|
||||
.rel.dyn : {
|
||||
*(.rel.*) *(.rel_*)
|
||||
}
|
||||
ASSERT(SIZEOF(.rel.dyn) == 0, "Unexpected run-time relocations (.rel) detected!")
|
||||
|
||||
.rela.dyn : {
|
||||
*(.rela.*) *(.rela_*)
|
||||
}
|
||||
ASSERT(SIZEOF(.rela.dyn) == 0, "Unexpected run-time relocations (.rela) detected!")
|
||||
}
|
||||
|
||||
@@ -141,11 +141,15 @@
|
||||
# define _ASM_EXTABLE_FAULT(from, to) \
|
||||
_ASM_EXTABLE_HANDLE(from, to, ex_handler_fault)
|
||||
|
||||
# define _ASM_NOKPROBE(entry) \
|
||||
# ifdef CONFIG_KPROBES
|
||||
# define _ASM_NOKPROBE(entry) \
|
||||
.pushsection "_kprobe_blacklist","aw" ; \
|
||||
_ASM_ALIGN ; \
|
||||
_ASM_PTR (entry); \
|
||||
.popsection
|
||||
# else
|
||||
# define _ASM_NOKPROBE(entry)
|
||||
# endif
|
||||
|
||||
#else /* ! __ASSEMBLY__ */
|
||||
# define _EXPAND_EXTABLE_HANDLE(x) #x
|
||||
|
||||
@@ -411,10 +411,47 @@ SECTIONS
|
||||
|
||||
STABS_DEBUG
|
||||
DWARF_DEBUG
|
||||
ELF_DETAILS
|
||||
|
||||
DISCARDS
|
||||
}
|
||||
|
||||
/*
|
||||
* Make sure that the .got.plt is either completely empty or it
|
||||
* contains only the lazy dispatch entries.
|
||||
*/
|
||||
.got.plt (INFO) : { *(.got.plt) }
|
||||
ASSERT(SIZEOF(.got.plt) == 0 ||
|
||||
#ifdef CONFIG_X86_64
|
||||
SIZEOF(.got.plt) == 0x18,
|
||||
#else
|
||||
SIZEOF(.got.plt) == 0xc,
|
||||
#endif
|
||||
"Unexpected GOT/PLT entries detected!")
|
||||
|
||||
/*
|
||||
* Sections that should stay zero sized, which is safer to
|
||||
* explicitly check instead of blindly discarding.
|
||||
*/
|
||||
.got : {
|
||||
*(.got) *(.igot.*)
|
||||
}
|
||||
ASSERT(SIZEOF(.got) == 0, "Unexpected GOT entries detected!")
|
||||
|
||||
.plt : {
|
||||
*(.plt) *(.plt.*) *(.iplt)
|
||||
}
|
||||
ASSERT(SIZEOF(.plt) == 0, "Unexpected run-time procedure linkages detected!")
|
||||
|
||||
.rel.dyn : {
|
||||
*(.rel.*) *(.rel_*)
|
||||
}
|
||||
ASSERT(SIZEOF(.rel.dyn) == 0, "Unexpected run-time relocations (.rel) detected!")
|
||||
|
||||
.rela.dyn : {
|
||||
*(.rela.*) *(.rela_*)
|
||||
}
|
||||
ASSERT(SIZEOF(.rela.dyn) == 0, "Unexpected run-time relocations (.rela) detected!")
|
||||
}
|
||||
|
||||
#ifdef CONFIG_X86_32
|
||||
/*
|
||||
|
||||
@@ -18,7 +18,8 @@ cflags-$(CONFIG_X86) += -m$(BITS) -D__KERNEL__ \
|
||||
# arm64 uses the full KBUILD_CFLAGS so it's necessary to explicitly
|
||||
# disable the stackleak plugin
|
||||
cflags-$(CONFIG_ARM64) := $(subst $(CC_FLAGS_FTRACE),,$(KBUILD_CFLAGS)) \
|
||||
-fpie $(DISABLE_STACKLEAK_PLUGIN)
|
||||
-fpie $(DISABLE_STACKLEAK_PLUGIN) \
|
||||
$(call cc-option,-mbranch-protection=none)
|
||||
cflags-$(CONFIG_ARM) := $(subst $(CC_FLAGS_FTRACE),,$(KBUILD_CFLAGS)) \
|
||||
-fno-builtin -fpic \
|
||||
$(call cc-option,-mno-single-pic-base)
|
||||
@@ -26,7 +27,7 @@ cflags-$(CONFIG_ARM) := $(subst $(CC_FLAGS_FTRACE),,$(KBUILD_CFLAGS)) \
|
||||
cflags-$(CONFIG_EFI_GENERIC_STUB) += -I$(srctree)/scripts/dtc/libfdt
|
||||
|
||||
KBUILD_CFLAGS := $(cflags-y) -Os -DDISABLE_BRANCH_PROFILING \
|
||||
-include $(srctree)/drivers/firmware/efi/libstub/hidden.h \
|
||||
-include $(srctree)/include/linux/hidden.h \
|
||||
-D__NO_FORTIFY \
|
||||
-ffreestanding \
|
||||
-fno-stack-protector \
|
||||
@@ -65,6 +66,12 @@ lib-$(CONFIG_ARM64) += arm64-stub.o
|
||||
lib-$(CONFIG_X86) += x86-stub.o
|
||||
CFLAGS_arm32-stub.o := -DTEXT_OFFSET=$(TEXT_OFFSET)
|
||||
|
||||
# Even when -mbranch-protection=none is set, Clang will generate a
|
||||
# .note.gnu.property for code-less object files (like lib/ctype.c),
|
||||
# so work around this by explicitly removing the unwanted section.
|
||||
# https://bugs.llvm.org/show_bug.cgi?id=46480
|
||||
STUBCOPY_FLAGS-y += --remove-section=.note.gnu.property
|
||||
|
||||
#
|
||||
# For x86, bootloaders like systemd-boot or grub-efi do not zero-initialize the
|
||||
# .bss section, so the .bss section of the EFI stub needs to be included in the
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
/*
|
||||
* To prevent the compiler from emitting GOT-indirected (and thus absolute)
|
||||
* references to any global symbols, override their visibility as 'hidden'
|
||||
*/
|
||||
#pragma GCC visibility push(hidden)
|
||||
@@ -34,6 +34,7 @@
|
||||
*
|
||||
* STABS_DEBUG
|
||||
* DWARF_DEBUG
|
||||
* ELF_DETAILS
|
||||
*
|
||||
* DISCARDS // must be the last
|
||||
* }
|
||||
@@ -581,7 +582,10 @@
|
||||
*/
|
||||
#define TEXT_TEXT \
|
||||
ALIGN_FUNCTION(); \
|
||||
*(.text.hot TEXT_MAIN .text.fixup .text.unlikely) \
|
||||
*(.text.hot .text.hot.*) \
|
||||
*(TEXT_MAIN .text.fixup) \
|
||||
*(.text.unlikely .text.unlikely.*) \
|
||||
*(.text.unknown .text.unknown.*) \
|
||||
NOINSTR_TEXT \
|
||||
*(.text..refcount) \
|
||||
*(.ref.text) \
|
||||
@@ -812,15 +816,21 @@
|
||||
.debug_macro 0 : { *(.debug_macro) } \
|
||||
.debug_addr 0 : { *(.debug_addr) }
|
||||
|
||||
/* Stabs debugging sections. */
|
||||
/* Stabs debugging sections. */
|
||||
#define STABS_DEBUG \
|
||||
.stab 0 : { *(.stab) } \
|
||||
.stabstr 0 : { *(.stabstr) } \
|
||||
.stab.excl 0 : { *(.stab.excl) } \
|
||||
.stab.exclstr 0 : { *(.stab.exclstr) } \
|
||||
.stab.index 0 : { *(.stab.index) } \
|
||||
.stab.indexstr 0 : { *(.stab.indexstr) } \
|
||||
.comment 0 : { *(.comment) }
|
||||
.stab.indexstr 0 : { *(.stab.indexstr) }
|
||||
|
||||
/* Required sections not related to debugging. */
|
||||
#define ELF_DETAILS \
|
||||
.comment 0 : { *(.comment) } \
|
||||
.symtab 0 : { *(.symtab) } \
|
||||
.strtab 0 : { *(.strtab) } \
|
||||
.shstrtab 0 : { *(.shstrtab) }
|
||||
|
||||
#ifdef CONFIG_GENERIC_BUG
|
||||
#define BUG_TABLE \
|
||||
@@ -955,13 +965,38 @@
|
||||
EXIT_DATA
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Clang's -fsanitize=kernel-address and -fsanitize=thread produce
|
||||
* unwanted sections (.eh_frame and .init_array.*), but
|
||||
* CONFIG_CONSTRUCTORS wants to keep any .init_array.* sections.
|
||||
* https://bugs.llvm.org/show_bug.cgi?id=46478
|
||||
*/
|
||||
#if defined(CONFIG_KASAN_GENERIC) || defined(CONFIG_KCSAN)
|
||||
# ifdef CONFIG_CONSTRUCTORS
|
||||
# define SANITIZER_DISCARDS \
|
||||
*(.eh_frame)
|
||||
# else
|
||||
# define SANITIZER_DISCARDS \
|
||||
*(.init_array) *(.init_array.*) \
|
||||
*(.eh_frame)
|
||||
# endif
|
||||
#else
|
||||
# define SANITIZER_DISCARDS
|
||||
#endif
|
||||
|
||||
#define COMMON_DISCARDS \
|
||||
SANITIZER_DISCARDS \
|
||||
*(.discard) \
|
||||
*(.discard.*) \
|
||||
*(.modinfo) \
|
||||
/* ld.bfd warns about .gnu.version* even when not emitted */ \
|
||||
*(.gnu.version*) \
|
||||
|
||||
#define DISCARDS \
|
||||
/DISCARD/ : { \
|
||||
EXIT_DISCARDS \
|
||||
EXIT_CALL \
|
||||
*(.discard) \
|
||||
*(.discard.*) \
|
||||
*(.modinfo) \
|
||||
COMMON_DISCARDS \
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
/*
|
||||
* When building position independent code with GCC using the -fPIC option,
|
||||
* (or even the -fPIE one on older versions), it will assume that we are
|
||||
* building a dynamic object (either a shared library or an executable) that
|
||||
* may have symbol references that can only be resolved at load time. For a
|
||||
* variety of reasons (ELF symbol preemption, the CoW footprint of the section
|
||||
* that is modified by the loader), this results in all references to symbols
|
||||
* with external linkage to go via entries in the Global Offset Table (GOT),
|
||||
* which carries absolute addresses which need to be fixed up when the
|
||||
* executable image is loaded at an offset which is different from its link
|
||||
* time offset.
|
||||
*
|
||||
* Fortunately, there is a way to inform the compiler that such symbol
|
||||
* references will be satisfied at link time rather than at load time, by
|
||||
* giving them 'hidden' visibility.
|
||||
*/
|
||||
|
||||
#pragma GCC visibility push(hidden)
|
||||
Reference in New Issue
Block a user