a2d063ac21
A new utility function (core_kernel_data()) is used to determine if a passed in address is part of core kernel data or not. It may or may not return true for RO data, but this utility must work for RW data. Thus both _sdata and _edata must be defined and continuous, without .init sections that may later be freed and replaced by volatile memory (memory that can be freed). This utility function is used to determine if data is safe from ever being freed. Thus it should return true for all RW global data that is not in a module or has been allocated, or false otherwise. Also change core_kernel_data() back to the more precise _sdata condition and document the function. Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Acked-by: Ralf Baechle <ralf@linux-mips.org> Acked-by: Hirokazu Takata <takata@linux-m32r.org> Cc: Richard Henderson <rth@twiddle.net> Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru> Cc: Matt Turner <mattst88@gmail.com> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Roman Zippel <zippel@linux-m68k.org> Cc: linux-m68k@lists.linux-m68k.org Cc: Kyle McMartin <kyle@mcmartin.ca> Cc: Helge Deller <deller@gmx.de> Cc: JamesE.J.Bottomley <jejb@parisc-linux.org> Link: http://lkml.kernel.org/r/1305855298.1465.19.camel@gandalf.stny.rr.com Signed-off-by: Ingo Molnar <mingo@elte.hu> ---- arch/alpha/kernel/vmlinux.lds.S | 1 + arch/m32r/kernel/vmlinux.lds.S | 1 + arch/m68k/kernel/vmlinux-std.lds | 2 ++ arch/m68k/kernel/vmlinux-sun3.lds | 1 + arch/mips/kernel/vmlinux.lds.S | 1 + arch/parisc/kernel/vmlinux.lds.S | 3 +++ kernel/extable.c | 12 +++++++++++- 7 files changed, 20 insertions(+), 1 deletion(-)
175 lines
3.8 KiB
ArmAsm
175 lines
3.8 KiB
ArmAsm
/* Kernel link layout for various "sections"
|
|
*
|
|
* Copyright (C) 1999-2003 Matthew Wilcox <willy at parisc-linux.org>
|
|
* Copyright (C) 2000-2003 Paul Bame <bame at parisc-linux.org>
|
|
* Copyright (C) 2000 John Marvin <jsm at parisc-linux.org>
|
|
* Copyright (C) 2000 Michael Ang <mang with subcarrier.org>
|
|
* Copyright (C) 2002 Randolph Chung <tausq with parisc-linux.org>
|
|
* Copyright (C) 2003 James Bottomley <jejb with parisc-linux.org>
|
|
* Copyright (C) 2006 Helge Deller <deller@gmx.de>
|
|
*
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, write to the Free Software
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
*/
|
|
#include <asm-generic/vmlinux.lds.h>
|
|
/* needed for the processor specific cache alignment size */
|
|
#include <asm/cache.h>
|
|
#include <asm/page.h>
|
|
#include <asm/asm-offsets.h>
|
|
#include <asm/thread_info.h>
|
|
|
|
/* ld script to make hppa Linux kernel */
|
|
#ifndef CONFIG_64BIT
|
|
OUTPUT_FORMAT("elf32-hppa-linux")
|
|
OUTPUT_ARCH(hppa)
|
|
#else
|
|
OUTPUT_FORMAT("elf64-hppa-linux")
|
|
OUTPUT_ARCH(hppa:hppa2.0w)
|
|
#endif
|
|
|
|
ENTRY(_stext)
|
|
#ifndef CONFIG_64BIT
|
|
jiffies = jiffies_64 + 4;
|
|
#else
|
|
jiffies = jiffies_64;
|
|
#endif
|
|
SECTIONS
|
|
{
|
|
. = KERNEL_BINARY_TEXT_START;
|
|
|
|
_text = .; /* Text and read-only data */
|
|
.text ALIGN(16) : {
|
|
HEAD_TEXT
|
|
TEXT_TEXT
|
|
SCHED_TEXT
|
|
LOCK_TEXT
|
|
KPROBES_TEXT
|
|
IRQENTRY_TEXT
|
|
*(.text.do_softirq)
|
|
*(.text.sys_exit)
|
|
*(.text.do_sigaltstack)
|
|
*(.text.do_fork)
|
|
*(.text.*)
|
|
*(.fixup)
|
|
*(.lock.text) /* out-of-line lock text */
|
|
*(.gnu.warning)
|
|
} = 0
|
|
/* End of text section */
|
|
_etext = .;
|
|
|
|
/* Start of data section */
|
|
_sdata = .;
|
|
|
|
RODATA
|
|
|
|
/* writeable */
|
|
/* Make sure this is page aligned so
|
|
* that we can properly leave these
|
|
* as writable
|
|
*/
|
|
. = ALIGN(PAGE_SIZE);
|
|
data_start = .;
|
|
|
|
/* unwind info */
|
|
.PARISC.unwind : {
|
|
__start___unwind = .;
|
|
*(.PARISC.unwind)
|
|
__stop___unwind = .;
|
|
}
|
|
|
|
EXCEPTION_TABLE(16)
|
|
NOTES
|
|
|
|
/* Data */
|
|
RW_DATA_SECTION(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE)
|
|
|
|
/* PA-RISC locks requires 16-byte alignment */
|
|
. = ALIGN(16);
|
|
.data..lock_aligned : {
|
|
*(.data..lock_aligned)
|
|
}
|
|
|
|
/* End of data section */
|
|
_edata = .;
|
|
|
|
/* BSS */
|
|
__bss_start = .;
|
|
/* page table entries need to be PAGE_SIZE aligned */
|
|
. = ALIGN(PAGE_SIZE);
|
|
.data..vmpages : {
|
|
*(.data..vm0.pmd)
|
|
*(.data..vm0.pgd)
|
|
*(.data..vm0.pte)
|
|
}
|
|
.bss : {
|
|
*(.bss)
|
|
*(COMMON)
|
|
}
|
|
__bss_stop = .;
|
|
|
|
#ifdef CONFIG_64BIT
|
|
. = ALIGN(16);
|
|
/* Linkage tables */
|
|
.opd : {
|
|
*(.opd)
|
|
} PROVIDE (__gp = .);
|
|
.plt : {
|
|
*(.plt)
|
|
}
|
|
.dlt : {
|
|
*(.dlt)
|
|
}
|
|
#endif
|
|
|
|
/* reserve space for interrupt stack by aligning __init* to 16k */
|
|
. = ALIGN(16384);
|
|
__init_begin = .;
|
|
INIT_TEXT_SECTION(16384)
|
|
INIT_DATA_SECTION(16)
|
|
/* we have to discard exit text and such at runtime, not link time */
|
|
.exit.text :
|
|
{
|
|
EXIT_TEXT
|
|
}
|
|
.exit.data :
|
|
{
|
|
EXIT_DATA
|
|
}
|
|
|
|
PERCPU(L1_CACHE_BYTES, PAGE_SIZE)
|
|
. = ALIGN(PAGE_SIZE);
|
|
__init_end = .;
|
|
/* freed after init ends here */
|
|
_end = . ;
|
|
|
|
STABS_DEBUG
|
|
.note 0 : { *(.note) }
|
|
|
|
/* Sections to be discarded */
|
|
DISCARDS
|
|
/DISCARD/ : {
|
|
#ifdef CONFIG_64BIT
|
|
/* temporary hack until binutils is fixed to not emit these
|
|
* for static binaries
|
|
*/
|
|
*(.interp)
|
|
*(.dynsym)
|
|
*(.dynstr)
|
|
*(.dynamic)
|
|
*(.hash)
|
|
*(.gnu.hash)
|
|
#endif
|
|
}
|
|
}
|