Commit d6699e96 authored by Kai Germaschewski's avatar Kai Germaschewski

Consolidate read-only sections in arch/*/vmlinux.lds.S

It's annoying having to touch 20+ arch vmlinux.lds.S file for every
new section introduced, just because they all duplicate the same
statements. Since we preprocess vmlinux.lds.S anyway, let's
#include <asm-generic/vmlinux.lds.h> and share the common statements.

This is a first step in consolidating most of the read-only sections.
parent bb9fc49f
#include <linux/config.h> #include <linux/config.h>
#include <asm-generic/vmlinux.lds.h>
OUTPUT_FORMAT("elf64-alpha") OUTPUT_FORMAT("elf64-alpha")
ENTRY(__start) ENTRY(__start)
...@@ -25,30 +26,7 @@ SECTIONS ...@@ -25,30 +26,7 @@ SECTIONS
__stop___ex_table = .; __stop___ex_table = .;
} }
/* Kernel symbol table */ RODATA
__ksymtab ALIGN(8) : {
__start___ksymtab = .;
*(__ksymtab)
__stop___ksymtab = .;
}
/* Kernel symbol table: GPL only */
__gpl_ksymtab ALIGN(8) : {
__start___gpl_ksymtab = .;
*(__gpl_ksymtab)
__stop___gpl_ksymtab = .;
}
/* All kernel symbols */
__kallsyms ALIGN(8) : {
__start___kallsyms = .;
*(__kallsyms)
__stop___kallsyms = .;
}
.kstrtab : { *(.kstrtab) }
__vermagic : { *(__vermagic) }
.rodata : { *(.rodata) *(.rodata.*) }
/* Startup code */ /* Startup code */
.init.text ALIGN(8192) : { .init.text ALIGN(8192) : {
......
...@@ -2,6 +2,9 @@ ...@@ -2,6 +2,9 @@
* taken from the i386 version by Russell King * taken from the i386 version by Russell King
* Written by Martin Mares <mj@atrey.karlin.mff.cuni.cz> * Written by Martin Mares <mj@atrey.karlin.mff.cuni.cz>
*/ */
#include <asm-generic/vmlinux.lds.h>
OUTPUT_ARCH(arm) OUTPUT_ARCH(arm)
ENTRY(stext) ENTRY(stext)
jiffies = jiffies_64; jiffies = jiffies_64;
...@@ -63,9 +66,6 @@ SECTIONS ...@@ -63,9 +66,6 @@ SECTIONS
_etext = .; /* End of text section */ _etext = .; /* End of text section */
} }
.kstrtab : { *(.kstrtab) }
__vermagic : { *(__vermagic) }
. = ALIGN(16); . = ALIGN(16);
__ex_table : { /* Exception table */ __ex_table : { /* Exception table */
__start___ex_table = .; __start___ex_table = .;
...@@ -73,17 +73,7 @@ SECTIONS ...@@ -73,17 +73,7 @@ SECTIONS
__stop___ex_table = .; __stop___ex_table = .;
} }
__ksymtab : { /* Kernel symbol table */ RODATA
__start___ksymtab = .;
*(__ksymtab)
__stop___ksymtab = .;
}
__gpl_ksymtab : { /* Kernel symbol table: GPL-only */
__start___gpl_ksymtab = .;
*(__gpl_ksymtab)
__stop___gpl_ksymtab = .;
}
.data : { .data : {
/* /*
......
...@@ -2,6 +2,9 @@ ...@@ -2,6 +2,9 @@
* taken from the i386 version by Russell King * taken from the i386 version by Russell King
* Written by Martin Mares <mj@atrey.karlin.mff.cuni.cz> * Written by Martin Mares <mj@atrey.karlin.mff.cuni.cz>
*/ */
#include <asm-generic/vmlinux.lds.h>
OUTPUT_ARCH(arm) OUTPUT_ARCH(arm)
ENTRY(stext) ENTRY(stext)
jiffies = jiffies_64; jiffies = jiffies_64;
...@@ -66,9 +69,6 @@ SECTIONS ...@@ -66,9 +69,6 @@ SECTIONS
_etext = .; /* End of text section */ _etext = .; /* End of text section */
} }
.kstrtab : { *(.kstrtab) }
__vermagic : { *(__vermagic) }
. = ALIGN(16); . = ALIGN(16);
__ex_table : { /* Exception table */ __ex_table : { /* Exception table */
__start___ex_table = .; __start___ex_table = .;
...@@ -76,23 +76,7 @@ SECTIONS ...@@ -76,23 +76,7 @@ SECTIONS
__stop___ex_table = .; __stop___ex_table = .;
} }
__gpl_ksymtab : { /* GPL Kernel symbol table */ RODATA
__start___gpl_ksymtab = .;
*(__gpl_ksymtab)
__stop___gpl_ksymtab = .;
}
__ksymtab : { /* Kernel symbol table */
__start___ksymtab = .;
*(__ksymtab)
__stop___ksymtab = .;
}
__kallsyms : { /* All kernel symbols */
__start___kallsyms = .;
*(__kallsyms)
__stop___kallsyms = .;
}
. = ALIGN(8192); . = ALIGN(8192);
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
*/ */
#include <linux/config.h> #include <linux/config.h>
#include <asm-generic/vmlinux.lds.h>
jiffies = jiffies_64; jiffies = jiffies_64;
SECTIONS SECTIONS
...@@ -31,22 +32,12 @@ SECTIONS ...@@ -31,22 +32,12 @@ SECTIONS
_etext = . ; /* End of text section */ _etext = . ; /* End of text section */
__etext = .; __etext = .;
.rodata : { *(.rodata) *(.rodata.__*) }
.kstrtab : { *(.kstrtab) }
__vermagic : { *(__vermagic) }
. = ALIGN(4); /* Exception table */ . = ALIGN(4); /* Exception table */
__start___ex_table = .; __start___ex_table = .;
__ex_table : { *(__ex_table) } __ex_table : { *(__ex_table) }
__stop___ex_table = .; __stop___ex_table = .;
__start___ksymtab = .; /* Kernel symbol table */ RODATA
__ksymtab : { *(__ksymtab) }
__stop___ksymtab = .;
__start___gpl_ksymtab = .; /* Kernel symbol table: GPL-only */
__gpl_ksymtab : { *(__gpl_ksymtab) }
__stop___gpl_ksymtab = .;
. = ALIGN (4); . = ALIGN (4);
___data_start = . ; ___data_start = . ;
......
/* ld script to make i386 Linux kernel /* ld script to make i386 Linux kernel
* Written by Martin Mares <mj@atrey.karlin.mff.cuni.cz>; * Written by Martin Mares <mj@atrey.karlin.mff.cuni.cz>;
*/ */
#include <asm-generic/vmlinux.lds.h>
OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386") OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
OUTPUT_ARCH(i386) OUTPUT_ARCH(i386)
ENTRY(_start) ENTRY(_start)
...@@ -18,27 +21,12 @@ SECTIONS ...@@ -18,27 +21,12 @@ SECTIONS
_etext = .; /* End of text section */ _etext = .; /* End of text section */
.rodata : { *(.rodata) *(.rodata.*) }
.kstrtab : { *(.kstrtab) }
__vermagic : { *(__vermagic) }
. = ALIGN(16); /* Exception table */ . = ALIGN(16); /* Exception table */
__start___ex_table = .; __start___ex_table = .;
__ex_table : { *(__ex_table) } __ex_table : { *(__ex_table) }
__stop___ex_table = .; __stop___ex_table = .;
. = ALIGN(64); RODATA
__start___ksymtab = .; /* Kernel symbol table */
__ksymtab : { *(__ksymtab) }
__stop___ksymtab = .;
__start___gpl_ksymtab = .; /* Kernel symbol table: GPL-only symbols */
__gpl_ksymtab : { *(__gpl_ksymtab) }
__stop___gpl_ksymtab = .;
__start___kallsyms = .; /* All kernel symbols */
__kallsyms : { *(__kallsyms) }
__stop___kallsyms = .;
/* writeable */ /* writeable */
.data : { /* Data */ .data : { /* Data */
......
/* ld script to make m68k Linux kernel */ /* ld script to make m68k Linux kernel */
#include <asm-generic/vmlinux.lds.h>
OUTPUT_FORMAT("elf32-m68k", "elf32-m68k", "elf32-m68k") OUTPUT_FORMAT("elf32-m68k", "elf32-m68k", "elf32-m68k")
OUTPUT_ARCH(m68k) OUTPUT_ARCH(m68k)
ENTRY(_start) ENTRY(_start)
...@@ -12,22 +15,13 @@ SECTIONS ...@@ -12,22 +15,13 @@ SECTIONS
*(.fixup) *(.fixup)
*(.gnu.warning) *(.gnu.warning)
} = 0x4e75 } = 0x4e75
.rodata : { *(.rodata) *(.rodata.*) }
.kstrtab : { *(.kstrtab) }
__vermagic : { *(__vermagic) }
. = ALIGN(16); /* Exception table */ . = ALIGN(16); /* Exception table */
__start___ex_table = .; __start___ex_table = .;
__ex_table : { *(__ex_table) } __ex_table : { *(__ex_table) }
__stop___ex_table = .; __stop___ex_table = .;
__start___ksymtab = .; /* Kernel symbol table */ RODATA
__ksymtab : { *(__ksymtab) }
__stop___ksymtab = .;
__start___gpl_ksymtab = .; /* Kernel symbol table: GPL only */
__gpl_ksymtab : { *(__gpl_ksymtab) }
__stop___gpl_ksymtab = .;
_etext = .; /* End of text section */ _etext = .; /* End of text section */
......
/* ld script to make m68k Linux kernel */ /* ld script to make m68k Linux kernel */
#include <asm-generic/vmlinux.lds.h>
OUTPUT_FORMAT("elf32-m68k", "elf32-m68k", "elf32-m68k") OUTPUT_FORMAT("elf32-m68k", "elf32-m68k", "elf32-m68k")
OUTPUT_ARCH(m68k) OUTPUT_ARCH(m68k)
ENTRY(_start) ENTRY(_start)
...@@ -13,26 +16,16 @@ SECTIONS ...@@ -13,26 +16,16 @@ SECTIONS
*(.fixup) *(.fixup)
*(.gnu.warning) *(.gnu.warning)
} = 0x4e75 } = 0x4e75
.kstrtab : { *(.kstrtab) }
__vermagic : { *(__vermagic) }
_etext = .; /* End of text section */ _etext = .; /* End of text section */
.data : { /* Data */ .data : { /* Data */
*(.rodata) RODATA
*(.rodata.*)
*(.data)
CONSTRUCTORS CONSTRUCTORS
. = ALIGN(16); /* Exception table */ . = ALIGN(16); /* Exception table */
__start___ex_table = .; __start___ex_table = .;
*(__ex_table) *(__ex_table)
__stop___ex_table = .; __stop___ex_table = .;
__start___ksymtab = .; /* Kernel symbol table */
*(__ksymtab)
__stop___ksymtab = .;
__start___gpl_ksymtab = .; /* Kernel symbol table: GPL-only */
__gpl_ksymtab : { *(__gpl_ksymtab) }
__stop___gpl_ksymtab = .;
} }
/* End of data goes *here* so that freeing init code works properly. */ /* End of data goes *here* so that freeing init code works properly. */
_edata = .; _edata = .;
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
*/ */
#include <linux/config.h> #include <linux/config.h>
#include <asm-generic/vmlinux.lds.h>
/* /*
* Original Palm pilot (same for Xcopilot). * Original Palm pilot (same for Xcopilot).
...@@ -219,21 +220,13 @@ SECTIONS { ...@@ -219,21 +220,13 @@ SECTIONS {
_stext = . ; _stext = . ;
*(.text) *(.text)
*(.text.lock) *(.text.lock)
*(.rodata)
*(.rodata.*)
. = ALIGN(0x4) ;
*(.kstrtab)
*(__vermagic)
. = ALIGN(16); /* Exception table */ . = ALIGN(16); /* Exception table */
__start___ex_table = .; __start___ex_table = .;
*(__ex_table) *(__ex_table)
__stop___ex_table = .; __stop___ex_table = .;
__start___ksymtab = .; /* Kernel symbol table */ RODATA
*(__ksymtab)
__stop___ksymtab = .;
. = ALIGN(4) ; . = ALIGN(4) ;
_etext = . ; _etext = . ;
......
#include <asm-generic/vmlinux.lds.h>
OUTPUT_ARCH(mips) OUTPUT_ARCH(mips)
ENTRY(kernel_entry) ENTRY(kernel_entry)
SECTIONS SECTIONS
...@@ -9,13 +11,9 @@ SECTIONS ...@@ -9,13 +11,9 @@ SECTIONS
{ {
_ftext = . ; _ftext = . ;
*(.text) *(.text)
*(.rodata)
*(.rodata1)
/* .gnu.warning sections are handled specially by elf32.em. */ /* .gnu.warning sections are handled specially by elf32.em. */
*(.gnu.warning) *(.gnu.warning)
} =0 } =0
.kstrtab : { *(.kstrtab) }
__vermagic : { *(__vermagic) }
. = ALIGN(16); /* Exception table */ . = ALIGN(16); /* Exception table */
__start___ex_table = .; __start___ex_table = .;
...@@ -26,13 +24,7 @@ SECTIONS ...@@ -26,13 +24,7 @@ SECTIONS
__dbe_table : { *(__dbe_table) } __dbe_table : { *(__dbe_table) }
__stop___dbe_table = .; __stop___dbe_table = .;
__start___ksymtab = .; /* Kernel symbol table */ RODATA
__ksymtab : { *(__ksymtab) }
__stop___ksymtab = .;
__start___gpl_ksymtab = .; /* Kernel symbol table: GPL-only symbols */
__gpl_ksymtab : { *(__gpl_ksymtab) }
__stop___gpl_ksymtab = .;
_etext = .; _etext = .;
......
#include <asm-generic/vmlinux.lds.h>
OUTPUT_ARCH(mips) OUTPUT_ARCH(mips)
ENTRY(kernel_entry) ENTRY(kernel_entry)
SECTIONS SECTIONS
...@@ -7,14 +9,9 @@ SECTIONS ...@@ -7,14 +9,9 @@ SECTIONS
.text : .text :
{ {
*(.text) *(.text)
*(.rodata)
*(.rodata.*)
*(.rodata1)
/* .gnu.warning sections are handled specially by elf32.em. */ /* .gnu.warning sections are handled specially by elf32.em. */
*(.gnu.warning) *(.gnu.warning)
} =0 } =0
.kstrtab : { *(.kstrtab) }
__vermagic : { *(__vermagic) }
. = ALIGN(16); /* Exception table */ . = ALIGN(16); /* Exception table */
__start___ex_table = .; __start___ex_table = .;
...@@ -25,6 +22,8 @@ SECTIONS ...@@ -25,6 +22,8 @@ SECTIONS
__dbe_table : { *(__dbe_table) } __dbe_table : { *(__dbe_table) }
__stop___dbe_table = .; __stop___dbe_table = .;
RODATA
_etext = .; _etext = .;
. = ALIGN(16384); . = ALIGN(16384);
......
#include <linux/config.h> #include <linux/config.h>
#include <asm-generic/vmlinux.lds.h>
/* ld script to make hppa Linux kernel */ /* ld script to make hppa Linux kernel */
#ifndef CONFIG_PARISC64 #ifndef CONFIG_PARISC64
...@@ -31,32 +32,17 @@ SECTIONS ...@@ -31,32 +32,17 @@ SECTIONS
_etext = .; /* End of text section */ _etext = .; /* End of text section */
. = ALIGN(16);
.rodata : { *(.rodata) *(.rodata.*) }
.kstrtab : { *(.kstrtab) }
__vermagic : { *(__vermagic) }
.data BLOCK(8192) : { /* Data without special */
data_start = .;
*(.data)
}
. = ALIGN(16); /* Exception table */ . = ALIGN(16); /* Exception table */
__start___ex_table = .; __start___ex_table = .;
__ex_table : { *(__ex_table) } __ex_table : { *(__ex_table) }
__stop___ex_table = .; __stop___ex_table = .;
__start___ksymtab = .; /* Kernel symbol table */ RODATA
__ksymtab : { *(__ksymtab) }
__stop___ksymtab = .;
__start___gpl_ksymtab = .; /* Kernel symbol table: GPL-only symbols */
__gpl_ksymtab : { *(__gpl_ksymtab) }
__stop___gpl_ksymtab = .;
__start___kallsyms = .; /* All kernel symbols */ .data BLOCK(8192) : { /* Data without special */
__kallsyms : { *(__kallsyms) } data_start = .;
__stop___kallsyms = .; *(.data)
}
#ifdef CONFIG_PARISC64 #ifdef CONFIG_PARISC64
. = ALIGN(16); /* Linkage tables */ . = ALIGN(16); /* Linkage tables */
......
#include <asm-generic/vmlinux.lds.h>
OUTPUT_ARCH(powerpc) OUTPUT_ARCH(powerpc)
SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib); SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/powerpc-any-elf/lib);
/* Do we need any of these for elf? /* Do we need any of these for elf?
...@@ -40,14 +42,8 @@ SECTIONS ...@@ -40,14 +42,8 @@ SECTIONS
} }
_etext = .; _etext = .;
PROVIDE (etext = .); PROVIDE (etext = .);
.rodata :
{ RODATA
*(.rodata)
*(.rodata.*)
*(.rodata1)
}
.kstrtab : { *(.kstrtab) }
__vermagic : { *(__vermagic) }
.fini : { *(.fini) } =0 .fini : { *(.fini) } =0
.ctors : { *(.ctors) } .ctors : { *(.ctors) }
.dtors : { *(.dtors) } .dtors : { *(.dtors) }
...@@ -58,18 +54,6 @@ SECTIONS ...@@ -58,18 +54,6 @@ SECTIONS
__ex_table : { *(__ex_table) } __ex_table : { *(__ex_table) }
__stop___ex_table = .; __stop___ex_table = .;
__start___ksymtab = .; /* Kernel symbol table */
__ksymtab : { *(__ksymtab) }
__stop___ksymtab = .;
__start___gpl_ksymtab = .; /* Kernel symbol table: GPL-only symbols */
__gpl_ksymtab : { *(__gpl_ksymtab) }
__stop___gpl_ksymtab = .;
__start___kallsyms = .; /* All kernel symbols */
__kallsyms : { *(__kallsyms) }
__stop___kallsyms = .;
/* Read-write section, merged into data segment: */ /* Read-write section, merged into data segment: */
. = ALIGN(4096); . = ALIGN(4096);
.data : .data :
......
#include <asm-generic/vmlinux.lds.h>
OUTPUT_ARCH(powerpc:common64) OUTPUT_ARCH(powerpc:common64)
/* Do we need any of these for elf? /* Do we need any of these for elf?
__DYNAMIC = 0; */ __DYNAMIC = 0; */
...@@ -37,11 +39,9 @@ SECTIONS ...@@ -37,11 +39,9 @@ SECTIONS
. = ALIGN(4096); . = ALIGN(4096);
_etext = .; _etext = .;
PROVIDE (etext = .); PROVIDE (etext = .);
.rodata :
{ RODATA
*(.rodata)
*(.rodata1)
}
.fini : { *(.fini) } =0 .fini : { *(.fini) } =0
.ctors : { *(.ctors) } .ctors : { *(.ctors) }
.dtors : { *(.dtors) } .dtors : { *(.dtors) }
...@@ -65,18 +65,6 @@ SECTIONS ...@@ -65,18 +65,6 @@ SECTIONS
__ex_table : { *(__ex_table) } __ex_table : { *(__ex_table) }
__stop___ex_table = .; __stop___ex_table = .;
__start___ksymtab = .; /* Kernel symbol table */
__ksymtab : { *(__ksymtab) }
__stop___ksymtab = .;
__start___gpl_ksymtab = .; /* Kernel symbol table: GPL-only symbols */
__gpl_ksymtab : { *(__gpl_ksymtab) }
__stop___gpl_ksymtab = .;
__start___kallsyms = .; /* All kernel symbols */
__kallsyms : { *(__kallsyms) }
__stop___kallsyms = .;
. = ALIGN(16384); /* init_task */ . = ALIGN(16384); /* init_task */
.data.init_task : { *(.data.init_task) } .data.init_task : { *(.data.init_task) }
......
/* ld script to make s390 Linux kernel /* ld script to make s390 Linux kernel
* Written by Martin Schwidefsky (schwidefsky@de.ibm.com) * Written by Martin Schwidefsky (schwidefsky@de.ibm.com)
*/ */
#include <asm-generic/vmlinux.lds.h>
OUTPUT_FORMAT("elf32-s390", "elf32-s390", "elf32-s390") OUTPUT_FORMAT("elf32-s390", "elf32-s390", "elf32-s390")
OUTPUT_ARCH(s390) OUTPUT_ARCH(s390)
ENTRY(_start) ENTRY(_start)
...@@ -17,23 +20,12 @@ SECTIONS ...@@ -17,23 +20,12 @@ SECTIONS
_etext = .; /* End of text section */ _etext = .; /* End of text section */
.rodata : { *(.rodata) *(.rodata.*) }
.kstrtab : { *(.kstrtab) }
__vermagic : { *(__vermagic) }
. = ALIGN(16); /* Exception table */ . = ALIGN(16); /* Exception table */
__start___ex_table = .; __start___ex_table = .;
__ex_table : { *(__ex_table) } __ex_table : { *(__ex_table) }
__stop___ex_table = .; __stop___ex_table = .;
. = ALIGN(64); RODATA
__start___ksymtab = .; /* Kernel symbol table */
__ksymtab : { *(__ksymtab) }
__stop___ksymtab = .;
__start___gpl_ksymtab = .; /* Kernel symbol table: GPL-only symbols */
__gpl_ksymtab : { *(__gpl_ksymtab) }
__stop___gpl_ksymtab = .;
#ifdef CONFIG_SHARED_KERNEL #ifdef CONFIG_SHARED_KERNEL
. = ALIGN(1048576); /* VM shared segments are 1MB aligned */ . = ALIGN(1048576); /* VM shared segments are 1MB aligned */
......
/* /*
* Written by Martin Schwidefsky (schwidefsky@de.ibm.com) * Written by Martin Schwidefsky (schwidefsky@de.ibm.com)
*/ */
#include <asm-generic/vmlinux.lds.h>
OUTPUT_FORMAT("elf64-s390", "elf64-s390", "elf64-s390") OUTPUT_FORMAT("elf64-s390", "elf64-s390", "elf64-s390")
OUTPUT_ARCH(s390:64-bit) OUTPUT_ARCH(s390:64-bit)
ENTRY(_start) ENTRY(_start)
...@@ -17,23 +20,12 @@ SECTIONS ...@@ -17,23 +20,12 @@ SECTIONS
_etext = .; /* End of text section */ _etext = .; /* End of text section */
.rodata : { *(.rodata) *(.rodata.*) }
.kstrtab : { *(.kstrtab) }
__vermagic : { *(__vermagic) }
. = ALIGN(16); /* Exception table */ . = ALIGN(16); /* Exception table */
__start___ex_table = .; __start___ex_table = .;
__ex_table : { *(__ex_table) } __ex_table : { *(__ex_table) }
__stop___ex_table = .; __stop___ex_table = .;
. = ALIGN(64); RODATA
__start___ksymtab = .; /* Kernel symbol table */
__ksymtab : { *(__ksymtab) }
__stop___ksymtab = .;
__start___gpl_ksymtab = .; /* Kernel symbol table: GPL-only symbols */
__gpl_ksymtab : { *(__gpl_ksymtab) }
__stop___gpl_ksymtab = .;
#ifdef CONFIG_SHARED_KERNEL #ifdef CONFIG_SHARED_KERNEL
. = ALIGN(1048576); /* VM shared segments are 1MB aligned */ . = ALIGN(1048576); /* VM shared segments are 1MB aligned */
......
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
* Written by Niibe Yutaka * Written by Niibe Yutaka
*/ */
#include <linux/config.h> #include <linux/config.h>
#include <asm-generic/vmlinux.lds.h>
#ifdef CONFIG_CPU_LITTLE_ENDIAN #ifdef CONFIG_CPU_LITTLE_ENDIAN
OUTPUT_FORMAT("elf32-sh-linux", "elf32-sh-linux", "elf32-sh-linux") OUTPUT_FORMAT("elf32-sh-linux", "elf32-sh-linux", "elf32-sh-linux")
jiffies = jiffies_64; jiffies = jiffies_64;
...@@ -25,26 +27,13 @@ SECTIONS ...@@ -25,26 +27,13 @@ SECTIONS
*(.fixup) *(.fixup)
*(.gnu.warning) *(.gnu.warning)
} = 0x0009 } = 0x0009
.rodata : { *(.rodata) *(.rodata.*) }
.kstrtab : { *(.kstrtab) }
__vermagic : { *(__vermagic) }
. = ALIGN(16); /* Exception table */ . = ALIGN(16); /* Exception table */
__start___ex_table = .; __start___ex_table = .;
__ex_table : { *(__ex_table) } __ex_table : { *(__ex_table) }
__stop___ex_table = .; __stop___ex_table = .;
__start___ksymtab = .; /* Kernel symbol table */ RODATA
__ksymtab : { *(__ksymtab) }
__stop___ksymtab = .;
__start___gpl_ksymtab = .; /* Kernel symbol table: GPL-only symbols */
__gpl_ksymtab : { *(__gpl_ksymtab) }
__stop___gpl_ksymtab = .;
__start___kallsyms = .; /* All kernel symbols */
__kallsyms : { *(__kallsyms) }
__stop___kallsyms = .;
_etext = .; /* End of text section */ _etext = .; /* End of text section */
......
/* ld script to make SparcLinux kernel */ /* ld script to make SparcLinux kernel */
#include <asm-generic/vmlinux.lds.h>
OUTPUT_FORMAT("elf32-sparc", "elf32-sparc", "elf32-sparc") OUTPUT_FORMAT("elf32-sparc", "elf32-sparc", "elf32-sparc")
OUTPUT_ARCH(sparc) OUTPUT_ARCH(sparc)
ENTRY(_start) ENTRY(_start)
...@@ -13,8 +16,7 @@ SECTIONS ...@@ -13,8 +16,7 @@ SECTIONS
} =0 } =0
_etext = .; _etext = .;
PROVIDE (etext = .); PROVIDE (etext = .);
.rodata : { *(.rodata) *(.rodata.*) } RODATA
.rodata1 : { *(.rodata1) }
.data : .data :
{ {
*(.data) *(.data)
...@@ -30,19 +32,6 @@ SECTIONS ...@@ -30,19 +32,6 @@ SECTIONS
__ex_table : { *(__ex_table) } __ex_table : { *(__ex_table) }
__stop___ex_table = .; __stop___ex_table = .;
. = ALIGN(64);
__start___ksymtab = .;
__ksymtab : { *(__ksymtab) }
__stop___ksymtab = .;
__start___gpl_ksymtab = .;
__gpl_ksymtab : { *(__gpl_ksymtab) }
__stop___gpl_ksymtab = .;
__start___kallsyms = .; /* All kernel symbols */
__kallsyms : { *(__kallsyms) }
__stop___kallsyms = .;
. = ALIGN(4096); . = ALIGN(4096);
__init_begin = .; __init_begin = .;
.init.text : { *(.init.text) } .init.text : { *(.init.text) }
......
/* ld script to make UltraLinux kernel */ /* ld script to make UltraLinux kernel */
#include <asm-generic/vmlinux.lds.h>
OUTPUT_FORMAT("elf64-sparc", "elf64-sparc", "elf64-sparc") OUTPUT_FORMAT("elf64-sparc", "elf64-sparc", "elf64-sparc")
OUTPUT_ARCH(sparc:v9a) OUTPUT_ARCH(sparc:v9a)
ENTRY(_start) ENTRY(_start)
...@@ -16,8 +19,9 @@ SECTIONS ...@@ -16,8 +19,9 @@ SECTIONS
} =0 } =0
_etext = .; _etext = .;
PROVIDE (etext = .); PROVIDE (etext = .);
.rodata : { *(.rodata) *(.rodata.*) }
.rodata1 : { *(.rodata1) } RODATA
.data : .data :
{ {
*(.data) *(.data)
...@@ -35,18 +39,6 @@ SECTIONS ...@@ -35,18 +39,6 @@ SECTIONS
__ex_table : { *(__ex_table) } __ex_table : { *(__ex_table) }
__stop___ex_table = .; __stop___ex_table = .;
. = ALIGN(64);
__start___ksymtab = .;
__ksymtab : { *(__ksymtab) }
__stop___ksymtab = .;
__start___gpl_ksymtab = .;
__gpl_ksymtab : { *(__gpl_ksymtab) }
__stop___gpl_ksymtab = .;
__kstrtab : { *(.kstrtab) }
__vermagic : { *(__vermagic) }
__start___kallsyms = .; /* All kernel symbols */
__kallsyms : { *(__kallsyms) }
__stop___kallsyms = .;
. = ALIGN(8192); . = ALIGN(8192);
__init_begin = .; __init_begin = .;
.init.text : { *(.init.text) } .init.text : { *(.init.text) }
......
#include <asm-generic/vmlinux.lds.h>
OUTPUT_FORMAT(ELF_FORMAT) OUTPUT_FORMAT(ELF_FORMAT)
OUTPUT_ARCH(ELF_ARCH) OUTPUT_ARCH(ELF_ARCH)
ENTRY(_start) ENTRY(_start)
...@@ -31,21 +33,15 @@ SECTIONS ...@@ -31,21 +33,15 @@ SECTIONS
*(.gnu.warning) *(.gnu.warning)
*(.gnu.linkonce.t*) *(.gnu.linkonce.t*)
} }
.kstrtab : { *(.kstrtab) }
__vermagic : { *(__vermagic) }
. = ALIGN(16); /* Exception table */ . = ALIGN(16); /* Exception table */
__start___ex_table = .; __start___ex_table = .;
__ex_table : { *(__ex_table) } __ex_table : { *(__ex_table) }
__stop___ex_table = .; __stop___ex_table = .;
. = ALIGN(64); RODATA
__start___ksymtab = .; /* Kernel symbol table */
__ksymtab : { *(__ksymtab) }
__stop___ksymtab = .;
.fini : { *(.fini) } =0x9090 .fini : { *(.fini) } =0x9090
.rodata : { *(.rodata) *(.gnu.linkonce.r*) }
.rodata1 : { *(.rodata1) }
_etext = .; _etext = .;
PROVIDE (etext = .); PROVIDE (etext = .);
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
*/ */
#include <linux/config.h> #include <linux/config.h>
#include <asm-generic/vmlinux.lds.h>
/* The following macros contain the usual definitions for various data areas. /* The following macros contain the usual definitions for various data areas.
...@@ -38,10 +39,7 @@ ...@@ -38,10 +39,7 @@
*(.text.lock) \ *(.text.lock) \
*(.exitcall.exit) \ *(.exitcall.exit) \
__real_etext = . ; /* There may be data after here. */ \ __real_etext = . ; /* There may be data after here. */ \
*(.rodata) \ RODATA \
. = ALIGN (0x4) ; \
*(.kstrtab) \
*(__vermagic) \
. = ALIGN (4) ; \ . = ALIGN (4) ; \
*(.call_table_data) \ *(.call_table_data) \
*(.call_table_text) \ *(.call_table_text) \
...@@ -49,12 +47,6 @@ ...@@ -49,12 +47,6 @@
___start___ex_table = . ; \ ___start___ex_table = . ; \
*(__ex_table) \ *(__ex_table) \
___stop___ex_table = . ; \ ___stop___ex_table = . ; \
___start___ksymtab = . ;/* Kernel symbol table. */ \
*(__ksymtab) \
___stop___ksymtab = . ; \
___start___gpl_ksymtab = . ; /* Same for GPL symbols. */ \
*(__gpl_ksymtab) \
___stop___gpl_ksymtab = . ; \
. = ALIGN (4) ; \ . = ALIGN (4) ; \
__etext = . ; __etext = . ;
......
/* ld script to make x86-64 Linux kernel /* ld script to make x86-64 Linux kernel
* Written by Martin Mares <mj@atrey.karlin.mff.cuni.cz>; * Written by Martin Mares <mj@atrey.karlin.mff.cuni.cz>;
*/ */
#include <asm-generic/vmlinux.lds.h>
OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64") OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64")
OUTPUT_ARCH(i386:x86-64) OUTPUT_ARCH(i386:x86-64)
ENTRY(_start) ENTRY(_start)
...@@ -18,26 +21,12 @@ SECTIONS ...@@ -18,26 +21,12 @@ SECTIONS
_etext = .; /* End of text section */ _etext = .; /* End of text section */
.rodata : { *(.rodata) *(.rodata.*) }
.kstrtab : { *(.kstrtab) }
__vermagic : { *(__vermagic) }
. = ALIGN(16); /* Exception table */ . = ALIGN(16); /* Exception table */
__start___ex_table = .; __start___ex_table = .;
__ex_table : { *(__ex_table) } __ex_table : { *(__ex_table) }
__stop___ex_table = .; __stop___ex_table = .;
. = ALIGN(64); RODATA
__start___ksymtab = .; /* Kernel symbol table */
__ksymtab : { *(__ksymtab) }
__stop___ksymtab = .;
__start___gpl_ksymtab = .; /* Kernel symbol table: GPL-only symbols */
__gpl_ksymtab : { *(__gpl_ksymtab) }
__stop___gpl_ksymtab = .;
__start___kallsyms = .; /* All kernel symbols */
__kallsyms : { *(__kallsyms) }
__stop___kallsyms = .;
.data : { /* Data */ .data : { /* Data */
*(.data) *(.data)
......
#define RODATA \
.rodata : { *(.rodata) *(.rodata.*) *(.rodata1) } \
.rodata1 : { *(.rodata1) } \
\
.kstrtab : { *(.kstrtab) } \
\
/* Kernel version magic */ \
__vermagic : { *(__vermagic) } \
\
/* Kernel symbol table */ \
. = ALIGN(64); \
__start___ksymtab = .; \
__ksymtab : { *(__ksymtab) } \
__stop___ksymtab = .; \
\
/* Kernel symbol table: GPL-only symbols */ \
__start___gpl_ksymtab = .; \
__gpl_ksymtab : { *(__gpl_ksymtab) } \
__stop___gpl_ksymtab = .; \
\
/* All kernel symbols */ \
__start___kallsyms = .; \
__kallsyms : { *(__kallsyms) } \
__stop___kallsyms = .; \
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment