Commit a58b228f authored by Linus Torvalds's avatar Linus Torvalds

Merge http://linux-isdn.bkbits.net/linux-2.5.make

into penguin.transmeta.com:/home/penguin/torvalds/repositories/kernel/linux
parents 8bdf7c39 d6699e96
...@@ -394,6 +394,17 @@ $(SUBDIRS): .hdepend prepare ...@@ -394,6 +394,17 @@ $(SUBDIRS): .hdepend prepare
prepare: include/linux/version.h include/asm include/config/MARKER prepare: include/linux/version.h include/asm include/config/MARKER
@echo ' Starting the build. KBUILD_BUILTIN=$(KBUILD_BUILTIN) KBUILD_MODULES=$(KBUILD_MODULES)' @echo ' Starting the build. KBUILD_BUILTIN=$(KBUILD_BUILTIN) KBUILD_MODULES=$(KBUILD_MODULES)'
# We need to build init/vermagic.o before descending since all modules
# (*.ko) need it already
ifdef CONFIG_MODULES
prepare: init/vermagic.o
init/vermagic.o: include/linux/version.h
endif
# This can be used by arch/$ARCH/Makefile to preprocess # This can be used by arch/$ARCH/Makefile to preprocess
# their vmlinux.lds.S file # their vmlinux.lds.S file
......
#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,29 +26,7 @@ SECTIONS ...@@ -25,29 +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) }
.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,8 +66,6 @@ SECTIONS ...@@ -63,8 +66,6 @@ SECTIONS
_etext = .; /* End of text section */ _etext = .; /* End of text section */
} }
.kstrtab : { *(.kstrtab) }
. = ALIGN(16); . = ALIGN(16);
__ex_table : { /* Exception table */ __ex_table : { /* Exception table */
__start___ex_table = .; __start___ex_table = .;
...@@ -72,17 +73,7 @@ SECTIONS ...@@ -72,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,8 +69,6 @@ SECTIONS ...@@ -66,8 +69,6 @@ SECTIONS
_etext = .; /* End of text section */ _etext = .; /* End of text section */
} }
.kstrtab : { *(.kstrtab) }
. = ALIGN(16); . = ALIGN(16);
__ex_table : { /* Exception table */ __ex_table : { /* Exception table */
__start___ex_table = .; __start___ex_table = .;
...@@ -75,23 +76,7 @@ SECTIONS ...@@ -75,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,21 +32,12 @@ SECTIONS ...@@ -31,21 +32,12 @@ SECTIONS
_etext = . ; /* End of text section */ _etext = . ; /* End of text section */
__etext = .; __etext = .;
.rodata : { *(.rodata) *(.rodata.__*) }
.kstrtab : { *(.kstrtab) }
. = 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,26 +21,12 @@ SECTIONS ...@@ -18,26 +21,12 @@ SECTIONS
_etext = .; /* End of text section */ _etext = .; /* End of text section */
.rodata : { *(.rodata) *(.rodata.*) }
.kstrtab : { *(.kstrtab) }
. = 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 */
......
...@@ -90,6 +90,8 @@ SECTIONS ...@@ -90,6 +90,8 @@ SECTIONS
{ *(.rodata) *(.rodata.*) } { *(.rodata) *(.rodata.*) }
.kstrtab : AT(ADDR(.kstrtab) - PAGE_OFFSET) .kstrtab : AT(ADDR(.kstrtab) - PAGE_OFFSET)
{ *(.kstrtab) } { *(.kstrtab) }
__vermagic : AT(ADDR(__vermagic) - PAGE_OFFSET)
{ *(__vermagic) }
.opd : AT(ADDR(.opd) - PAGE_OFFSET) .opd : AT(ADDR(.opd) - PAGE_OFFSET)
{ *(.opd) } { *(.opd) }
......
/* 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,21 +15,13 @@ SECTIONS ...@@ -12,21 +15,13 @@ SECTIONS
*(.fixup) *(.fixup)
*(.gnu.warning) *(.gnu.warning)
} = 0x4e75 } = 0x4e75
.rodata : { *(.rodata) *(.rodata.*) }
.kstrtab : { *(.kstrtab) }
. = 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) }
_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,20 +220,13 @@ SECTIONS { ...@@ -219,20 +220,13 @@ SECTIONS {
_stext = . ; _stext = . ;
*(.text) *(.text)
*(.text.lock) *(.text.lock)
*(.rodata)
*(.rodata.*)
. = ALIGN(0x4) ;
*(.kstrtab)
. = 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,12 +11,9 @@ SECTIONS ...@@ -9,12 +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) }
. = ALIGN(16); /* Exception table */ . = ALIGN(16); /* Exception table */
__start___ex_table = .; __start___ex_table = .;
...@@ -25,13 +24,7 @@ SECTIONS ...@@ -25,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 = .;
......
...@@ -25,6 +25,7 @@ SECTIONS ...@@ -25,6 +25,7 @@ SECTIONS
*(.gnu.warning) *(.gnu.warning)
} = 0 } = 0
.kstrtab : { *(.kstrtab) } .kstrtab : { *(.kstrtab) }
__vermagic : { *(__vermagic) }
. = ALIGN(16); /* Exception table */ . = ALIGN(16); /* Exception table */
__start___ex_table = .; __start___ex_table = .;
......
#include <asm-generic/vmlinux.lds.h>
OUTPUT_ARCH(mips) OUTPUT_ARCH(mips)
ENTRY(kernel_entry) ENTRY(kernel_entry)
SECTIONS SECTIONS
...@@ -7,13 +9,9 @@ SECTIONS ...@@ -7,13 +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) }
. = ALIGN(16); /* Exception table */ . = ALIGN(16); /* Exception table */
__start___ex_table = .; __start___ex_table = .;
...@@ -24,6 +22,8 @@ SECTIONS ...@@ -24,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,31 +32,17 @@ SECTIONS ...@@ -31,31 +32,17 @@ SECTIONS
_etext = .; /* End of text section */ _etext = .; /* End of text section */
. = ALIGN(16);
.rodata : { *(.rodata) *(.rodata.*) }
.kstrtab : { *(.kstrtab) }
.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,13 +42,8 @@ SECTIONS ...@@ -40,13 +42,8 @@ SECTIONS
} }
_etext = .; _etext = .;
PROVIDE (etext = .); PROVIDE (etext = .);
.rodata :
{ RODATA
*(.rodata)
*(.rodata.*)
*(.rodata1)
}
.kstrtab : { *(.kstrtab) }
.fini : { *(.fini) } =0 .fini : { *(.fini) } =0
.ctors : { *(.ctors) } .ctors : { *(.ctors) }
.dtors : { *(.dtors) } .dtors : { *(.dtors) }
...@@ -57,18 +54,6 @@ SECTIONS ...@@ -57,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 :
......
...@@ -42,6 +42,7 @@ SECTIONS ...@@ -42,6 +42,7 @@ SECTIONS
*(.rodata1) *(.rodata1)
} }
.kstrtab : { *(.kstrtab) } .kstrtab : { *(.kstrtab) }
__vermagic : { *(__vermagic) }
.fini : { *(.fini) } =0 .fini : { *(.fini) } =0
.ctors : { *(.ctors) } .ctors : { *(.ctors) }
.dtors : { *(.dtors) } .dtors : { *(.dtors) }
......
#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,22 +20,12 @@ SECTIONS ...@@ -17,22 +20,12 @@ SECTIONS
_etext = .; /* End of text section */ _etext = .; /* End of text section */
.rodata : { *(.rodata) *(.rodata.*) }
.kstrtab : { *(.kstrtab) }
. = 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,22 +20,12 @@ SECTIONS ...@@ -17,22 +20,12 @@ SECTIONS
_etext = .; /* End of text section */ _etext = .; /* End of text section */
.rodata : { *(.rodata) *(.rodata.*) }
.kstrtab : { *(.kstrtab) }
. = 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,25 +27,13 @@ SECTIONS ...@@ -25,25 +27,13 @@ SECTIONS
*(.fixup) *(.fixup)
*(.gnu.warning) *(.gnu.warning)
} = 0x0009 } = 0x0009
.rodata : { *(.rodata) *(.rodata.*) }
.kstrtab : { *(.kstrtab) }
. = 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,17 +39,6 @@ SECTIONS ...@@ -35,17 +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) }
__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,20 +33,15 @@ SECTIONS ...@@ -31,20 +33,15 @@ SECTIONS
*(.gnu.warning) *(.gnu.warning)
*(.gnu.linkonce.t*) *(.gnu.linkonce.t*)
} }
.kstrtab : { *(.kstrtab) }
. = 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,9 +39,7 @@ ...@@ -38,9 +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) \
. = ALIGN (4) ; \ . = ALIGN (4) ; \
*(.call_table_data) \ *(.call_table_data) \
*(.call_table_text) \ *(.call_table_text) \
...@@ -48,12 +47,6 @@ ...@@ -48,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,25 +21,12 @@ SECTIONS ...@@ -18,25 +21,12 @@ SECTIONS
_etext = .; /* End of text section */ _etext = .; /* End of text section */
.rodata : { *(.rodata) *(.rodata.*) }
.kstrtab : { *(.kstrtab) }
. = 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 = .; \
#ifndef _ASM_I386_MODULE_H #ifndef _ASM_I386_MODULE_H
#define _ASM_I386_MODULE_H #define _ASM_I386_MODULE_H
/* x86 is simple */ /* x86 is simple */
struct mod_arch_specific struct mod_arch_specific
{ {
...@@ -8,4 +9,47 @@ struct mod_arch_specific ...@@ -8,4 +9,47 @@ struct mod_arch_specific
#define Elf_Shdr Elf32_Shdr #define Elf_Shdr Elf32_Shdr
#define Elf_Sym Elf32_Sym #define Elf_Sym Elf32_Sym
#define Elf_Ehdr Elf32_Ehdr #define Elf_Ehdr Elf32_Ehdr
#ifdef CONFIG_M386
#define MODULE_PROC_FAMILY "386 "
#elif CONFIG_M486
#define MODULE_PROC_FAMILY "486 "
#elif CONFIG_M586
#define MODULE_PROC_FAMILY "586 "
#elif CONFIG_M586TSC
#define MODULE_PROC_FAMILY "586TSC "
#elif CONFIG_M586MMX
#define MODULE_PROC_FAMILY "586MMX "
#elif CONFIG_M686
#define MODULE_PROC_FAMILY "686 "
#elif CONFIG_MPENTIUMII
#define MODULE_PROC_FAMILY "PENTIUMII "
#elif CONFIG_MPENTIUMIII
#define MODULE_PROC_FAMILY "PENTIUMIII "
#elif CONFIG_MPENTIUM4
#define MODULE_PROC_FAMILY "PENTIUM4 "
#elif CONFIG_MK6
#define MODULE_PROC_FAMILY "K6 "
#elif CONFIG_MK7
#define MODULE_PROC_FAMILY "K7 "
#elif CONFIG_MK8
#define MODULE_PROC_FAMILY "K8 "
#elif CONFIG_MELAN
#define MODULE_PROC_FAMILY "ELAN "
#elif CONFIG_MCRUSOE
#define MODULE_PROC_FAMILY "CRUSOE "
#elif CONFIG_MWINCHIPC6
#define MODULE_PROC_FAMILY "WINCHIPC6 "
#elif CONFIG_MWINCHIP2
#define MODULE_PROC_FAMILY "WINCHIP2 "
#elif CONFIG_MWINCHIP3D
#define MODULE_PROC_FAMILY "WINCHIP3D "
#elif CONFIG_MCYRIXIII
#define MODULE_PROC_FAMILY "CYRIXIII "
#else
#error unknown processor family
#endif
#define MODULE_ARCH_VERMAGIC MODULE_PROC_FAMILY
#endif /* _ASM_I386_MODULE_H */ #endif /* _ASM_I386_MODULE_H */
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
# #
obj-y := main.o version.o do_mounts.o initramfs.o obj-y := main.o version.o do_mounts.o initramfs.o
obj-$(CONFIG_MODULES) += vermagic.o
# files to be removed upon make clean # files to be removed upon make clean
clean-files := ../include/linux/compile.h clean-files := ../include/linux/compile.h
......
#include <linux/version.h>
#include <linux/module.h>
/* Simply sanity version stamp for modules. */
#ifdef CONFIG_SMP
#define MODULE_VERMAGIC_SMP "SMP "
#else
#define MODULE_VERMAGIC_SMP ""
#endif
#ifdef CONFIG_PREEMPT
#define MODULE_VERMAGIC_PREEMPT "preempt "
#else
#define MODULE_VERMAGIC_PREEMPT ""
#endif
#ifndef MODULE_ARCH_VERMAGIC
#define MODULE_ARCH_VERMAGIC ""
#endif
const char vermagic[] __attribute__((section("__vermagic"))) =
UTS_RELEASE " "
MODULE_VERMAGIC_SMP MODULE_VERMAGIC_PREEMPT MODULE_ARCH_VERMAGIC
"gcc-" __stringify(__GNUC__) "." __stringify(__GNUC_MINOR__);
...@@ -963,6 +963,9 @@ static void set_license(struct module *mod, Elf_Shdr *sechdrs, int licenseidx) ...@@ -963,6 +963,9 @@ static void set_license(struct module *mod, Elf_Shdr *sechdrs, int licenseidx)
} }
} }
/* From init/vermagic.o */
extern char vermagic[];
/* Allocate and load the module: note that size of section 0 is always /* Allocate and load the module: note that size of section 0 is always
zero, and we rely on this for optional sections. */ zero, and we rely on this for optional sections. */
static struct module *load_module(void *umod, static struct module *load_module(void *umod,
...@@ -973,7 +976,7 @@ static struct module *load_module(void *umod, ...@@ -973,7 +976,7 @@ static struct module *load_module(void *umod,
Elf_Shdr *sechdrs; Elf_Shdr *sechdrs;
char *secstrings, *args; char *secstrings, *args;
unsigned int i, symindex, exportindex, strindex, setupindex, exindex, unsigned int i, symindex, exportindex, strindex, setupindex, exindex,
modindex, obsparmindex, licenseindex, gplindex; modindex, obsparmindex, licenseindex, gplindex, vmagindex;
long arglen; long arglen;
struct module *mod; struct module *mod;
long err = 0; long err = 0;
...@@ -1012,7 +1015,7 @@ static struct module *load_module(void *umod, ...@@ -1012,7 +1015,7 @@ static struct module *load_module(void *umod,
exportindex = setupindex = obsparmindex = gplindex = licenseindex = 0; exportindex = setupindex = obsparmindex = gplindex = licenseindex = 0;
/* And these should exist, but gcc whinges if we don't init them */ /* And these should exist, but gcc whinges if we don't init them */
symindex = strindex = exindex = modindex = 0; symindex = strindex = exindex = modindex = vmagindex = 0;
/* Find where important sections are */ /* Find where important sections are */
for (i = 1; i < hdr->e_shnum; i++) { for (i = 1; i < hdr->e_shnum; i++) {
...@@ -1062,6 +1065,11 @@ static struct module *load_module(void *umod, ...@@ -1062,6 +1065,11 @@ static struct module *load_module(void *umod,
/* EXPORT_SYMBOL_GPL() */ /* EXPORT_SYMBOL_GPL() */
DEBUGP("GPL symbols found in section %u\n", i); DEBUGP("GPL symbols found in section %u\n", i);
gplindex = i; gplindex = i;
} else if (strcmp(secstrings+sechdrs[i].sh_name,
"__vermagic") == 0) {
/* Version magic. */
DEBUGP("Version magic found in section %u\n", i);
vmagindex = i;
} }
#ifdef CONFIG_KALLSYMS #ifdef CONFIG_KALLSYMS
/* symbol and string tables for decoding later. */ /* symbol and string tables for decoding later. */
...@@ -1082,6 +1090,18 @@ static struct module *load_module(void *umod, ...@@ -1082,6 +1090,18 @@ static struct module *load_module(void *umod,
} }
mod = (void *)sechdrs[modindex].sh_addr; mod = (void *)sechdrs[modindex].sh_addr;
/* This is allowed: modprobe --force will strip it. */
if (!vmagindex) {
tainted |= TAINT_FORCED_MODULE;
printk(KERN_WARNING "%s: no version magic, tainting kernel.\n",
mod->name);
} else if (strcmp((char *)sechdrs[vmagindex].sh_addr, vermagic) != 0) {
printk(KERN_ERR "%s: version magic '%s' should be '%s'\n",
mod->name, (char*)sechdrs[vmagindex].sh_addr, vermagic);
err = -ENOEXEC;
goto free_hdr;
}
/* Now copy in args */ /* Now copy in args */
arglen = strlen_user(uargs); arglen = strlen_user(uargs);
if (!arglen) { if (!arglen) {
......
...@@ -176,10 +176,15 @@ quiet_cmd_link_multi-y = LD $@ ...@@ -176,10 +176,15 @@ quiet_cmd_link_multi-y = LD $@
cmd_link_multi-y = $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) -r -o $@ $(filter $(addprefix $(obj)/,$($(subst $(obj)/,,$(@:.o=-objs))) $($(subst $(obj)/,,$(@:.o=-y)))),$^) cmd_link_multi-y = $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) -r -o $@ $(filter $(addprefix $(obj)/,$($(subst $(obj)/,,$(@:.o=-objs))) $($(subst $(obj)/,,$(@:.o=-y)))),$^)
quiet_cmd_link_multi-m = LD [M] $@ quiet_cmd_link_multi-m = LD [M] $@
cmd_link_multi-m = $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LDFLAGS_MODULE) -o $@ $(filter $(addprefix $(obj)/,$($(subst $(obj)/,,$(@:.ko=-objs))) $($(subst $(obj)/,,$(@:.ko=-y)))),$^) cmd_link_multi-m = $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LDFLAGS_MODULE) -o $@ $(filter $(addprefix $(obj)/,$($(subst $(obj)/,,$(@:.ko=-objs))) $($(subst $(obj)/,,$(@:.ko=-y)))),$^) init/vermagic.o
quiet_cmd_link_single-m = LD [M] $@ quiet_cmd_link_single-m = LD [M] $@
cmd_link_single-m = $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LDFLAGS_MODULE) -o $@ $< cmd_link_single-m = $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LDFLAGS_MODULE) -o $@ $< init/vermagic.o
# Don't rebuilt vermagic.o unless we actually are in the init/ dir
ifneq ($(obj),init)
init/vermagic.o: ;
endif
# We would rather have a list of rules like # We would rather have a list of rules like
# foo.o: $(foo-objs) # foo.o: $(foo-objs)
...@@ -188,10 +193,10 @@ cmd_link_single-m = $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LDFLAGS_MODULE) -o $@ $< ...@@ -188,10 +193,10 @@ cmd_link_single-m = $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LDFLAGS_MODULE) -o $@ $<
$(multi-used-y) : %.o: $(multi-objs-y) FORCE $(multi-used-y) : %.o: $(multi-objs-y) FORCE
$(call if_changed,link_multi-y) $(call if_changed,link_multi-y)
$(multi-used-m:.o=.ko) : %.ko: $(multi-objs-m) FORCE $(multi-used-m:.o=.ko) : %.ko: $(multi-objs-m) init/vermagic.o FORCE
$(call if_changed,link_multi-m) $(call if_changed,link_multi-m)
$(single-used-m:.o=.ko) : %.ko: %.o FORCE $(single-used-m:.o=.ko) : %.ko: %.o init/vermagic.o FORCE
$(call if_changed,link_single-m) $(call if_changed,link_single-m)
targets += $(multi-used-y) $(multi-used-m:.o=.ko) $(single-used-m:.o=.ko) targets += $(multi-used-y) $(multi-used-m:.o=.ko) $(single-used-m:.o=.ko)
......
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