提交 b2b5d37d 编写于 作者: S Sam Ravnborg 提交者: Linus Torvalds

alpha: beautify vmlinux.lds

Introduced a consistent style in vmlinux.lds and it now matches the
soon-to-be common style for all arch's vmlinux.lds files.

In addition:
- Replaced hardcoded constant with PAGE_SIZE
- Fix page.h so PAGE_SIZE can be used from assembler and in lds files
- Move a few labels inside brackets so linker alignment will not
  make label point ot a too low address
- Replaced DWARF and STABS sections with definitions from asm-generic
Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Richard Henderson <rth@twiddle.net>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 a5f833f3
#include <asm-generic/vmlinux.lds.h> #include <asm-generic/vmlinux.lds.h>
#include <asm/page.h>
OUTPUT_FORMAT("elf64-alpha") OUTPUT_FORMAT("elf64-alpha")
OUTPUT_ARCH(alpha) OUTPUT_ARCH(alpha)
...@@ -8,138 +9,145 @@ jiffies = jiffies_64; ...@@ -8,138 +9,145 @@ jiffies = jiffies_64;
SECTIONS SECTIONS
{ {
#ifdef CONFIG_ALPHA_LEGACY_START_ADDRESS #ifdef CONFIG_ALPHA_LEGACY_START_ADDRESS
. = 0xfffffc0000310000; . = 0xfffffc0000310000;
#else #else
. = 0xfffffc0001010000; . = 0xfffffc0001010000;
#endif #endif
_text = .; /* Text and read-only data */ _text = .; /* Text and read-only data */
.text : { .text : {
*(.text.head) *(.text.head)
TEXT_TEXT TEXT_TEXT
SCHED_TEXT SCHED_TEXT
LOCK_TEXT LOCK_TEXT
*(.fixup) *(.fixup)
*(.gnu.warning) *(.gnu.warning)
} :kernel } :kernel
_etext = .; /* End of text section */ _etext = .; /* End of text section */
. = ALIGN(16); /* Exception table */
__start___ex_table = .; /* Exception table */ . = ALIGN(16);
__ex_table : { *(__ex_table) } __ex_table : {
__stop___ex_table = .; __start___ex_table = .;
*(__ex_table)
NOTES :kernel :note __stop___ex_table = .;
.dummy : { *(.dummy) } :kernel }
RODATA NOTES :kernel :note
.dummy : {
/* Will be freed after init */ *(.dummy)
. = ALIGN(8192); /* Init code and data */ } :kernel
__init_begin = .;
.init.text : { RODATA
_sinittext = .;
*(.init.text) /* Will be freed after init */
_einittext = .; . = ALIGN(PAGE_SIZE);
} /* Init code and data */
.init.data : { *(.init.data) } __init_begin = .;
.init.text : {
. = ALIGN(16); _sinittext = .;
__setup_start = .; *(.init.text)
.init.setup : { *(.init.setup) } _einittext = .;
__setup_end = .; }
.init.data : {
. = ALIGN(8); *(.init.data)
__initcall_start = .; }
.initcall.init : {
INITCALLS . = ALIGN(16);
} .init.setup : {
__initcall_end = .; __setup_start = .;
*(.init.setup)
__setup_end = .;
}
. = ALIGN(8);
.initcall.init : {
__initcall_start = .;
INITCALLS
__initcall_end = .;
}
#ifdef CONFIG_BLK_DEV_INITRD #ifdef CONFIG_BLK_DEV_INITRD
. = ALIGN(8192); . = ALIGN(PAGE_SIZE);
__initramfs_start = .; .init.ramfs : {
.init.ramfs : { *(.init.ramfs) } __initramfs_start = .;
__initramfs_end = .; *(.init.ramfs)
__initramfs_end = .;
}
#endif #endif
. = ALIGN(8); . = ALIGN(8);
.con_initcall.init : { .con_initcall.init : {
__con_initcall_start = .; __con_initcall_start = .;
*(.con_initcall.init) *(.con_initcall.init)
__con_initcall_end = .; __con_initcall_end = .;
} }
. = ALIGN(8); . = ALIGN(8);
SECURITY_INIT SECURITY_INIT
PERCPU(8192) PERCPU(PAGE_SIZE)
. = ALIGN(2*8192); . = ALIGN(2 * PAGE_SIZE);
__init_end = .; __init_end = .;
/* Freed after init ends here */ /* Freed after init ends here */
/* Note 2 page alignment above. */ /* Note 2 page alignment above. */
.data.init_thread : { *(.data.init_thread) } .data.init_thread : {
*(.data.init_thread)
. = ALIGN(8192); }
.data.page_aligned : { *(.data.page_aligned) }
. = ALIGN(PAGE_SIZE);
. = ALIGN(64); .data.page_aligned : {
.data.cacheline_aligned : { *(.data.cacheline_aligned) } *(.data.page_aligned)
}
_data = .;
.data : { /* Data */ . = ALIGN(64);
DATA_DATA .data.cacheline_aligned : {
CONSTRUCTORS *(.data.cacheline_aligned)
} }
.got : { *(.got) } _data = .;
.sdata : { *(.sdata) } /* Data */
.data : {
_edata = .; /* End of data section */ DATA_DATA
CONSTRUCTORS
__bss_start = .; }
.sbss : { *(.sbss) *(.scommon) }
.bss : { *(.bss) *(COMMON) } .got : {
__bss_stop = .; *(.got)
}
_end = .; .sdata : {
*(.sdata)
/* Sections to be discarded */ }
/DISCARD/ : { *(.exit.text) *(.exit.data) *(.exitcall.exit) } _edata = .; /* End of data section */
.mdebug 0 : { *(.mdebug) } __bss_start = .;
.note 0 : { *(.note) } .sbss : {
.comment 0 : { *(.comment) } *(.sbss)
*(.scommon)
/* Stabs debugging sections */ }
.stab 0 : { *(.stab) } .bss : {
.stabstr 0 : { *(.stabstr) } *(.bss)
.stab.excl 0 : { *(.stab.excl) } *(COMMON)
.stab.exclstr 0 : { *(.stab.exclstr) } }
.stab.index 0 : { *(.stab.index) } __bss_stop = .;
.stab.indexstr 0 : { *(.stab.indexstr) } _end = .;
/* DWARF 1 */
.debug 0 : { *(.debug) } /* Sections to be discarded */
.line 0 : { *(.line) } /DISCARD/ : {
/* GNU DWARF 1 extensions */ *(.exit.text)
.debug_srcinfo 0 : { *(.debug_srcinfo) } *(.exit.data)
.debug_sfnames 0 : { *(.debug_sfnames) } *(.exitcall.exit)
/* DWARF 1.1 and DWARF 2 */ }
.debug_aranges 0 : { *(.debug_aranges) }
.debug_pubnames 0 : { *(.debug_pubnames) } .mdebug 0 : {
/* DWARF 2 */ *(.mdebug)
.debug_info 0 : { *(.debug_info) } }
.debug_abbrev 0 : { *(.debug_abbrev) } .note 0 : {
.debug_line 0 : { *(.debug_line) } *(.note)
.debug_frame 0 : { *(.debug_frame) } }
.debug_str 0 : { *(.debug_str) }
.debug_loc 0 : { *(.debug_loc) } STABS_DEBUG
.debug_macinfo 0 : { *(.debug_macinfo) } DWARF_DEBUG
/* SGI/MIPS DWARF 2 extensions */
.debug_weaknames 0 : { *(.debug_weaknames) }
.debug_funcnames 0 : { *(.debug_funcnames) }
.debug_typenames 0 : { *(.debug_typenames) }
.debug_varnames 0 : { *(.debug_varnames) }
} }
...@@ -3,11 +3,12 @@ ...@@ -3,11 +3,12 @@
#ifdef __KERNEL__ #ifdef __KERNEL__
#include <linux/const.h>
#include <asm/pal.h> #include <asm/pal.h>
/* PAGE_SHIFT determines the page size */ /* PAGE_SHIFT determines the page size */
#define PAGE_SHIFT 13 #define PAGE_SHIFT 13
#define PAGE_SIZE (1UL << PAGE_SHIFT) #define PAGE_SIZE (_AC(1,UL) << PAGE_SHIFT)
#define PAGE_MASK (~(PAGE_SIZE-1)) #define PAGE_MASK (~(PAGE_SIZE-1))
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册