/* SPDX-License-Identifier: GPL-2.0-or-later */1/*2* OpenRISC vmlinux.lds.S3*4* Linux architectural port borrowing liberally from similar works of5* others. All original copyrights apply as per the original source6* declaration.7*8* Modifications for the OpenRISC architecture:9* Copyright (C) 2003 Matjaz Breskvar <[email protected]>10* Copyright (C) 2010-2011 Jonas Bonn <[email protected]>11*12* ld script for OpenRISC architecture13*/1415/* TODO16* - clean up __offset & stuff17* - change all 8192 alignment to PAGE !!!18* - recheck if all alignments are really needed19*/2021# define LOAD_OFFSET PAGE_OFFSET22# define LOAD_BASE PAGE_OFFSET2324#include <asm/page.h>25#include <asm/cache.h>26#include <asm/thread_info.h>27#include <asm-generic/vmlinux.lds.h>2829#ifdef __OR1K__30#define __OUTPUT_FORMAT "elf32-or1k"31#else32#define __OUTPUT_FORMAT "elf32-or32"33#endif3435OUTPUT_FORMAT(__OUTPUT_FORMAT, __OUTPUT_FORMAT, __OUTPUT_FORMAT)36jiffies = jiffies_64 + 4;3738SECTIONS39{40/* Read-only sections, merged into text segment: */41. = LOAD_BASE ;4243_text = .;4445/* _s_kernel_ro must be page aligned */46. = ALIGN(PAGE_SIZE);47_s_kernel_ro = .;4849.text : AT(ADDR(.text) - LOAD_OFFSET)50{51_stext = .;52HEAD_TEXT53TEXT_TEXT54SCHED_TEXT55LOCK_TEXT56KPROBES_TEXT57IRQENTRY_TEXT58SOFTIRQENTRY_TEXT59*(.fixup)60*(.text.__*)61_etext = .;62}63/* TODO: Check if fixup and text.__* are really necessary64* fixup is definitely necessary65*/6667_sdata = .;6869/* Page alignment required for RO_DATA */70RO_DATA(PAGE_SIZE)71_e_kernel_ro = .;7273/* Whatever comes after _e_kernel_ro had better be page-aligend, too */7475/* 32 here is cacheline size... recheck this */76RW_DATA(32, PAGE_SIZE, PAGE_SIZE)7778_edata = .;7980EXCEPTION_TABLE(4)8182/* Init code and data */83. = ALIGN(PAGE_SIZE);84__init_begin = .;8586/* Page aligned */87INIT_TEXT_SECTION(PAGE_SIZE)8889/* Align __setup_start on 16 byte boundary */90INIT_DATA_SECTION(16)9192PERCPU_SECTION(L1_CACHE_BYTES)9394__init_end = .;9596BSS_SECTION(0, 0, 0x20)9798_end = .;99100/* Throw in the debugging sections */101STABS_DEBUG102DWARF_DEBUG103ELF_DETAILS104105/* Sections to be discarded -- must be last */106DISCARDS107}108109110