Path: blob/master/arch/arm/boot/compressed/vmlinux.lds.S
29268 views
/* SPDX-License-Identifier: GPL-2.0-only */1/*2* Copyright (C) 2000 Russell King3*/4#include <asm/vmlinux.lds.h>56#ifdef CONFIG_CPU_ENDIAN_BE87#define ZIMAGE_MAGIC(x) ( (((x) >> 24) & 0x000000ff) | \8(((x) >> 8) & 0x0000ff00) | \9(((x) << 8) & 0x00ff0000) | \10(((x) << 24) & 0xff000000) )11#else12#define ZIMAGE_MAGIC(x) (x)13#endif1415OUTPUT_ARCH(arm)16ENTRY(_start)17SECTIONS18{19/DISCARD/ : {20COMMON_DISCARDS21*(.ARM.exidx*)22*(.ARM.extab*)23*(.note.*)24*(.rel.*)25*(.printk_index)26/*27* Discard any r/w data - this produces a link error if we have any,28* which is required for PIC decompression. Local data generates29* GOTOFF relocations, which prevents it being relocated independently30* of the text/got segments.31*/32*(.data)33}3435. = TEXT_START;36_text = .;3738.text : {39_start = .;40*(.start)41*(.text)42*(.text.*)43ARM_STUBS_TEXT44}45.table : ALIGN(4) {46_table_start = .;47LONG(ZIMAGE_MAGIC(6))48LONG(ZIMAGE_MAGIC(0x5a534c4b))49LONG(ZIMAGE_MAGIC(__piggy_size_addr - _start))50LONG(ZIMAGE_MAGIC(_kernel_bss_size))51LONG(ZIMAGE_MAGIC(TEXT_OFFSET))52LONG(ZIMAGE_MAGIC(MALLOC_SIZE))53LONG(0)54_table_end = .;55}56.rodata : {57*(.rodata)58*(.rodata.*)59*(.data.rel.ro)60*(.data.rel.ro.*)61}62.piggydata : {63*(.piggydata)64__piggy_size_addr = . - 4;65}6667. = ALIGN(4);68_etext = .;6970.got.plt : { *(.got.plt) }71#ifndef CONFIG_EFI_STUB72_got_start = .;73.got : { *(.got) }74_got_end = .;75#endif7677/* ensure the zImage file size is always a multiple of 64 bits */78/* (without a dummy byte, ld just ignores the empty section) */79.pad : { BYTE(0); . = ALIGN(8); }8081#ifdef CONFIG_EFI_STUB82.data : ALIGN(4096) {83__pecoff_data_start = .;84_got_start = .;85*(.got)86_got_end = .;87/*88* The EFI stub always executes from RAM, and runs strictly before the89* decompressor, so we can make an exception for its r/w data, and keep it90*/91*(.data.efistub .bss.efistub)92__pecoff_data_end = .;9394/*95* PE/COFF mandates a file size which is a multiple of 512 bytes if the96* section size equals or exceeds 4 KB97*/98. = ALIGN(512);99}100__pecoff_data_rawsize = . - ADDR(.data);101#endif102103_edata = .;104105/*106* The image_end section appears after any additional loadable sections107* that the linker may decide to insert in the binary image. Having108* this symbol allows further debug in the near future.109*/110.image_end (NOLOAD) : {111/*112* EFI requires that the image is aligned to 512 bytes, and appended113* DTB requires that we know where the end of the image is. Ensure114* that both are satisfied by ensuring that there are no additional115* sections emitted into the decompressor image.116*/117_edata_real = .;118}119120_magic_sig = ZIMAGE_MAGIC(0x016f2818);121_magic_start = ZIMAGE_MAGIC(_start);122_magic_end = ZIMAGE_MAGIC(_edata);123_magic_table = ZIMAGE_MAGIC(_table_start - _start);124125. = BSS_START;126__bss_start = .;127.bss : { *(.bss .bss.*) }128_end = .;129130. = ALIGN(8); /* the stack must be 64-bit aligned */131.stack : { *(.stack) }132133PROVIDE(__pecoff_data_size = ALIGN(512) - ADDR(.data));134PROVIDE(__pecoff_end = ALIGN(512));135136STABS_DEBUG137DWARF_DEBUG138ARM_DETAILS139140ARM_ASSERTS141}142ASSERT(_edata_real == _edata, "error: zImage file size is incorrect");143144145