Commit 18161326 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] ppc64: vmlinux.lds fixes, from Alan Modra

From: Anton Blanchard <anton@samba.org>

- Remove a bunch of unnecessary sections
- Always declare section labels inside the section (bug found on ppc32)
- Rearrange sections to waste less space
parent a4d30bb4
#include <asm-generic/vmlinux.lds.h> #include <asm-generic/vmlinux.lds.h>
OUTPUT_ARCH(powerpc:common64) OUTPUT_ARCH(powerpc:common64)
/* Do we need any of these for elf?
__DYNAMIC = 0; */
jiffies = jiffies_64; jiffies = jiffies_64;
SECTIONS SECTIONS
{ {
/* Sections to be discarded. */
/DISCARD/ : {
*(.exitcall.exit)
}
/* Read-only sections, merged into text segment: */ /* Read-only sections, merged into text segment: */
. = + SIZEOF_HEADERS; .text : {
.interp : { *(.interp) } *(.text .text.*)
.hash : { *(.hash) }
.dynsym : { *(.dynsym) }
.dynstr : { *(.dynstr) }
.rel.text : { *(.rel.text) }
.rela.text : { *(.rela.text) }
.rel.data : { *(.rel.data) }
.rela.data : { *(.rela.data) }
.rel.rodata : { *(.rel.rodata) }
.rela.rodata : { *(.rela.rodata) }
.rel.got : { *(.rel.got) }
.rela.got : { *(.rela.got) }
.rel.ctors : { *(.rel.ctors) }
.rela.ctors : { *(.rela.ctors) }
.rel.dtors : { *(.rel.dtors) }
.rela.dtors : { *(.rela.dtors) }
.rel.bss : { *(.rel.bss) }
.rela.bss : { *(.rela.bss) }
.rel.plt : { *(.rel.plt) }
.rela.plt : { *(.rela.plt) }
/* .init : { *(.init) } =0*/
.plt : { *(.plt) }
.text :
{
*(.text)
*(.fixup) *(.fixup)
*(.got1)
}
. = ALIGN(4096); . = ALIGN(4096);
_etext = .; _etext = .;
PROVIDE (etext = .);
RODATA
.fini : { *(.fini) } =0
.ctors : { *(.ctors) }
.dtors : { *(.dtors) }
/* Read-write section, merged into data segment: */
. = (. + 0x0FFF) & 0xFFFFFFFFFFFFF000;
.data :
{
*(.data)
*(.data1)
*(.sdata)
*(.sdata2)
*(.dynamic)
CONSTRUCTORS
} }
. = ALIGN(4096);
_edata = .;
PROVIDE (edata = .);
__ex_table : {
__start___ex_table = .; __start___ex_table = .;
__ex_table : { *(__ex_table) } *(__ex_table)
__stop___ex_table = .; __stop___ex_table = .;
}
__bug_table : {
__start___bug_table = .; __start___bug_table = .;
__bug_table : { *(__bug_table) } *(__bug_table)
__stop___bug_table = .; __stop___bug_table = .;
}
__ftr_fixup : {
__start___ftr_fixup = .; __start___ftr_fixup = .;
__ftr_fixup : { *(__ftr_fixup) } *(__ftr_fixup)
__stop___ftr_fixup = .; __stop___ftr_fixup = .;
}
. = ALIGN(16384); /* init_task */ RODATA
.data.init_task : { *(.data.init_task) }
. = ALIGN(4096);
.data.page_aligned : { *(.data.page_aligned) }
. = ALIGN(128);
.data.cacheline_aligned : { *(.data.cacheline_aligned) }
/* will be freed after init */ /* will be freed after init */
. = ALIGN(4096); . = ALIGN(4096);
__init_begin = .; __init_begin = .;
.init.text : { .init.text : {
_sinittext = .; _sinittext = .;
*(.init.text) *(.init.text)
_einittext = .; _einittext = .;
} }
.init.data : { *(.init.data) }
.init.data : {
*(.init.data)
}
. = ALIGN(16); . = ALIGN(16);
.init.setup : {
__setup_start = .; __setup_start = .;
.init.setup : { *(.init.setup) } *(.init.setup)
__setup_end = .; __setup_end = .;
}
__param : {
__start___param = .; __start___param = .;
__param : { *(__param) } *(__param)
__stop___param = .; __stop___param = .;
__initcall_start = .; }
.initcall.init : { .initcall.init : {
__initcall_start = .;
*(.initcall1.init) *(.initcall1.init)
*(.initcall2.init) *(.initcall2.init)
*(.initcall3.init) *(.initcall3.init)
...@@ -106,40 +75,72 @@ SECTIONS ...@@ -106,40 +75,72 @@ SECTIONS
*(.initcall5.init) *(.initcall5.init)
*(.initcall6.init) *(.initcall6.init)
*(.initcall7.init) *(.initcall7.init)
}
__initcall_end = .; __initcall_end = .;
}
.con_initcall.init : {
__con_initcall_start = .; __con_initcall_start = .;
.con_initcall.init : { *(.con_initcall.init) } *(.con_initcall.init)
__con_initcall_end = .; __con_initcall_end = .;
}
SECURITY_INIT SECURITY_INIT
. = ALIGN(4096); . = ALIGN(4096);
.init.ramfs : {
__initramfs_start = .; __initramfs_start = .;
.init.ramfs : { *(.init.ramfs) } *(.init.ramfs)
__initramfs_end = .; __initramfs_end = .;
. = ALIGN(32); }
.data.percpu : {
__per_cpu_start = .; __per_cpu_start = .;
.data.percpu : { *(.data.percpu) } *(.data.percpu)
__per_cpu_end = .; __per_cpu_end = .;
. = ALIGN(4096); }
. = ALIGN(16384);
__init_end = .; __init_end = .;
/* freed after init ends here */ /* freed after init ends here */
/* Read/write sections */
. = ALIGN(16384);
/* The initial task and kernel stack */
.data.init_task : {
*(.data.init_task)
}
.data.page_aligned : {
*(.data.page_aligned)
}
.data.cacheline_aligned : {
*(.data.cacheline_aligned)
}
.data : {
*(.data .data.rel* .toc1)
*(.opd)
*(.branch_lt)
}
.got : {
__toc_start = .; __toc_start = .;
.got : { *(.got.plt) *(.got) } *(.got)
.toc : { *(.toc) } *(.toc)
. = ALIGN(4096); . = ALIGN(4096);
__toc_end = .; _edata = .;
}
. = ALIGN(4096);
.bss : {
__bss_start = .; __bss_start = .;
.bss : { *(.bss) } *(.bss)
__bss_stop = .; __bss_stop = .;
}
. = ALIGN(4096); . = ALIGN(4096);
_end = . ; _end = . ;
PROVIDE (end = .);
/* Sections to be discarded. */
/DISCARD/ : {
*(.exitcall.exit)
}
} }
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