mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-04 16:25:34 +00:00

In a previous patch, we have eliminated GOT entries from the decompressor binary and added an assertion that the .got section is empty. This means that the GOT fixup routines that exist in both the 32-bit and 64-bit startup routines have become dead code, and can be removed. While at it, drop the KEEP() from the linker script, as it has no effect on the contents of output sections that are created by the linker itself. Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Signed-off-by: Arvind Sankar <nivedita@alum.mit.edu> Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Ingo Molnar <mingo@kernel.org> Tested-by: Nick Desaulniers <ndesaulniers@google.com> Tested-by: Sedat Dilek <sedat.dilek@gmail.com> Reviewed-by: Kees Cook <keescook@chromium.org> Acked-by: Arvind Sankar <nivedita@alum.mit.edu> Link: https://lore.kernel.org/r/20200731230820.1742553-4-keescook@chromium.org
87 lines
1.4 KiB
ArmAsm
87 lines
1.4 KiB
ArmAsm
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#include <asm-generic/vmlinux.lds.h>
|
|
|
|
OUTPUT_FORMAT(CONFIG_OUTPUT_FORMAT)
|
|
|
|
#undef i386
|
|
|
|
#include <asm/cache.h>
|
|
#include <asm/page_types.h>
|
|
|
|
#ifdef CONFIG_X86_64
|
|
OUTPUT_ARCH(i386:x86-64)
|
|
ENTRY(startup_64)
|
|
#else
|
|
OUTPUT_ARCH(i386)
|
|
ENTRY(startup_32)
|
|
#endif
|
|
|
|
SECTIONS
|
|
{
|
|
/* Be careful parts of head_64.S assume startup_32 is at
|
|
* address 0.
|
|
*/
|
|
. = 0;
|
|
.head.text : {
|
|
_head = . ;
|
|
HEAD_TEXT
|
|
_ehead = . ;
|
|
}
|
|
.rodata..compressed : {
|
|
*(.rodata..compressed)
|
|
}
|
|
.text : {
|
|
_text = .; /* Text */
|
|
*(.text)
|
|
*(.text.*)
|
|
_etext = . ;
|
|
}
|
|
.rodata : {
|
|
_rodata = . ;
|
|
*(.rodata) /* read-only data */
|
|
*(.rodata.*)
|
|
_erodata = . ;
|
|
}
|
|
.got : {
|
|
*(.got)
|
|
}
|
|
.got.plt : {
|
|
*(.got.plt)
|
|
}
|
|
|
|
.data : {
|
|
_data = . ;
|
|
*(.data)
|
|
*(.data.*)
|
|
*(.bss.efistub)
|
|
_edata = . ;
|
|
}
|
|
. = ALIGN(L1_CACHE_BYTES);
|
|
.bss : {
|
|
_bss = . ;
|
|
*(.bss)
|
|
*(.bss.*)
|
|
*(COMMON)
|
|
. = ALIGN(8); /* For convenience during zeroing */
|
|
_ebss = .;
|
|
}
|
|
#ifdef CONFIG_X86_64
|
|
. = ALIGN(PAGE_SIZE);
|
|
.pgtable : {
|
|
_pgtable = . ;
|
|
*(.pgtable)
|
|
_epgtable = . ;
|
|
}
|
|
#endif
|
|
. = ALIGN(PAGE_SIZE); /* keep ZO size page aligned */
|
|
_end = .;
|
|
|
|
DISCARDS
|
|
}
|
|
|
|
ASSERT(SIZEOF(.got) == 0, "Unexpected GOT entries detected!")
|
|
#ifdef CONFIG_X86_64
|
|
ASSERT(SIZEOF(.got.plt) == 0 || SIZEOF(.got.plt) == 0x18, "Unexpected GOT/PLT entries detected!")
|
|
#else
|
|
ASSERT(SIZEOF(.got.plt) == 0 || SIZEOF(.got.plt) == 0xc, "Unexpected GOT/PLT entries detected!")
|
|
#endif
|