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
{ {
/* Read-only sections, merged into text segment: */ /* Sections to be discarded. */
. = + SIZEOF_HEADERS; /DISCARD/ : {
.interp : { *(.interp) } *(.exitcall.exit)
.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)
*(.got1)
}
. = ALIGN(4096);
_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 = .);
__start___ex_table = .; /* Read-only sections, merged into text segment: */
__ex_table : { *(__ex_table) } .text : {
__stop___ex_table = .; *(.text .text.*)
*(.fixup)
. = ALIGN(4096);
_etext = .;
}
__start___bug_table = .; __ex_table : {
__bug_table : { *(__bug_table) } __start___ex_table = .;
__stop___bug_table = .; *(__ex_table)
__stop___ex_table = .;
}
__start___ftr_fixup = .; __bug_table : {
__ftr_fixup : { *(__ftr_fixup) } __start___bug_table = .;
__stop___ftr_fixup = .; *(__bug_table)
__stop___bug_table = .;
}
. = ALIGN(16384); /* init_task */ __ftr_fixup : {
.data.init_task : { *(.data.init_task) } __start___ftr_fixup = .;
*(__ftr_fixup)
__stop___ftr_fixup = .;
}
. = ALIGN(4096); RODATA
.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);
__setup_start = .; .init.setup : {
.init.setup : { *(.init.setup) } __setup_start = .;
__setup_end = .; *(.init.setup)
__start___param = .; __setup_end = .;
__param : { *(__param) } }
__stop___param = .;
__initcall_start = .; __param : {
__start___param = .;
*(__param)
__stop___param = .;
}
.initcall.init : { .initcall.init : {
*(.initcall1.init) __initcall_start = .;
*(.initcall2.init) *(.initcall1.init)
*(.initcall3.init) *(.initcall2.init)
*(.initcall4.init) *(.initcall3.init)
*(.initcall5.init) *(.initcall4.init)
*(.initcall6.init) *(.initcall5.init)
*(.initcall6.init)
*(.initcall7.init) *(.initcall7.init)
} __initcall_end = .;
__initcall_end = .; }
__con_initcall_start = .;
.con_initcall.init : { *(.con_initcall.init) } .con_initcall.init : {
__con_initcall_end = .; __con_initcall_start = .;
*(.con_initcall.init)
__con_initcall_end = .;
}
SECURITY_INIT SECURITY_INIT
. = ALIGN(4096); . = ALIGN(4096);
__initramfs_start = .; .init.ramfs : {
.init.ramfs : { *(.init.ramfs) } __initramfs_start = .;
__initramfs_end = .; *(.init.ramfs)
. = ALIGN(32); __initramfs_end = .;
__per_cpu_start = .; }
.data.percpu : { *(.data.percpu) }
__per_cpu_end = .; .data.percpu : {
. = ALIGN(4096); __per_cpu_start = .;
*(.data.percpu)
__per_cpu_end = .;
}
. = ALIGN(16384);
__init_end = .; __init_end = .;
/* freed after init ends here */ /* freed after init ends here */
__toc_start = .;
.got : { *(.got.plt) *(.got) }
.toc : { *(.toc) }
. = ALIGN(4096);
__toc_end = .;
__bss_start = .; /* Read/write sections */
.bss : { *(.bss) } . = ALIGN(16384);
__bss_stop = .; /* 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 = .;
*(.got)
*(.toc)
. = ALIGN(4096);
_edata = .;
}
. = ALIGN(4096); . = ALIGN(4096);
_end = . ; .bss : {
PROVIDE (end = .); __bss_start = .;
*(.bss)
__bss_stop = .;
}
/* Sections to be discarded. */ . = ALIGN(4096);
/DISCARD/ : { _end = . ;
*(.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