9
0
Fork 0

svn_rev_476

use linker script from x86_64 ld
This commit is contained in:
Sascha Hauer 2007-07-05 18:01:57 +02:00 committed by Sascha Hauer
parent e1533684d5
commit 3abdebe9ca
1 changed files with 164 additions and 102 deletions

View File

@ -6,25 +6,9 @@ ENTRY(_start)
SECTIONS SECTIONS
{ {
PROVIDE (__executable_start = START);
. = START + SIZEOF_HEADERS;
.interp : { *(.interp) }
/* Used in arch/um/kernel/mem.c. Any memory between START and __binary_start
* is remapped.*/
__binary_start = .;
. = ALIGN(4096); /* Init code and data */
_text = .;
_stext = .;
__init_begin = .;
.init.text : {
_sinittext = .;
*(.init.text)
_einittext = .;
}
. = ALIGN(4096);
/* Read-only sections, merged into text segment: */ /* Read-only sections, merged into text segment: */
PROVIDE (__executable_start = 0x400000); . = 0x400000 + SIZEOF_HEADERS;
.interp : { *(.interp) }
.hash : { *(.hash) } .hash : { *(.hash) }
.gnu.hash : { *(.gnu.hash) } .gnu.hash : { *(.gnu.hash) }
.dynsym : { *(.dynsym) } .dynsym : { *(.dynsym) }
@ -32,97 +16,108 @@ SECTIONS
.gnu.version : { *(.gnu.version) } .gnu.version : { *(.gnu.version) }
.gnu.version_d : { *(.gnu.version_d) } .gnu.version_d : { *(.gnu.version_d) }
.gnu.version_r : { *(.gnu.version_r) } .gnu.version_r : { *(.gnu.version_r) }
.rel.init : { *(.rel.init) } .rel.dyn :
.rela.init : { *(.rela.init) } {
.rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) } *(.rel.init)
.rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) } *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
.rel.fini : { *(.rel.fini) } *(.rel.fini)
.rela.fini : { *(.rela.fini) } *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
.rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) } *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)
.rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) } *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
.rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) } *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
.rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) } *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
.rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) } *(.rel.ctors)
.rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) } *(.rel.dtors)
.rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) } *(.rel.got)
.rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) } *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
.rel.ctors : { *(.rel.ctors) } *(.rel.ldata .rel.ldata.* .rel.gnu.linkonce.l.*)
.rela.ctors : { *(.rela.ctors) } *(.rel.lbss .rel.lbss.* .rel.gnu.linkonce.lb.*)
.rel.dtors : { *(.rel.dtors) } *(.rel.lrodata .rel.lrodata.* .rel.gnu.linkonce.lr.*)
.rela.dtors : { *(.rela.dtors) } }
.rel.got : { *(.rel.got) } .rela.dyn :
.rela.got : { *(.rela.got) } {
.rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) } *(.rela.init)
.rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) } *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
*(.rela.fini)
*(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
*(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
*(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
*(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
*(.rela.ctors)
*(.rela.dtors)
*(.rela.got)
*(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
*(.rela.ldata .rela.ldata.* .rela.gnu.linkonce.l.*)
*(.rela.lbss .rela.lbss.* .rela.gnu.linkonce.lb.*)
*(.rela.lrodata .rela.lrodata.* .rela.gnu.linkonce.lr.*)
}
.rel.plt : { *(.rel.plt) } .rel.plt : { *(.rel.plt) }
.rela.plt : { *(.rela.plt) } .rela.plt : { *(.rela.plt) }
.init : { .init :
{
KEEP (*(.init)) KEEP (*(.init))
} =0x90909090 } =0x90909090
.plt : { *(.plt) } .plt : { *(.plt) }
.text : { .text :
*(.text) {
*(.fixup) *(.text .stub .text.* .gnu.linkonce.t.*)
*(.stub .text.* .gnu.linkonce.t.*) KEEP (*(.text.*personality*))
/* .gnu.warning sections are handled specially by elf32.em. */ /* .gnu.warning sections are handled specially by elf32.em. */
*(.gnu.warning) *(.gnu.warning)
. = ALIGN(4096);
__syscall_stub_start = .;
*(.__syscall_stub*)
__syscall_stub_end = .;
. = ALIGN(4096);
} =0x90909090 } =0x90909090
.fini : { .fini :
{
KEEP (*(.fini)) KEEP (*(.fini))
} =0x90909090 } =0x90909090
.kstrtab : { *(.kstrtab) } . = ALIGN(64);
__u_boot_initcalls_start = .; __u_boot_initcalls_start = .;
__u_boot_initcalls : { INITCALLS } __u_boot_initcalls : { INITCALLS }
__u_boot_initcalls_end = .; __u_boot_initcalls_end = .;
. = ALIGN(64);
__u_boot_cmd_start = .; __u_boot_cmd_start = .;
__u_boot_cmd : { U_BOOT_CMDS } __u_boot_cmd : { U_BOOT_CMDS }
__u_boot_cmd_end = .; __u_boot_cmd_end = .;
__preinit_array_start = .; PROVIDE (__etext = .);
.preinit_array : { *(.preinit_array) } PROVIDE (_etext = .);
__preinit_array_end = .; PROVIDE (etext = .);
__init_array_start = .; .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
.init_array : { *(.init_array) } .rodata1 : { *(.rodata1) }
__init_array_end = .; .eh_frame_hdr : { *(.eh_frame_hdr) }
__fini_array_start = .; .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
.fini_array : { *(.fini_array) } .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
__fini_array_end = .; /* Adjust the address for the data segment. We want to adjust up to
the same address within the page on the next page up. */
init.data : { *(.init.data) } . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
/* Exception handling */
/* Ensure the __preinit_array_start label is properly aligned. We .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
could instead move the label definition inside the section, but .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
the linker would then create the section even if it turns out to /* Thread Local Storage sections */
be empty, which isn't pretty. */
. = ALIGN(32 / 8);
.preinit_array : { *(.preinit_array) }
.init_array : {
PROVIDE_HIDDEN (__init_array_start = .);
*(.init_array)
PROVIDE_HIDDEN (__init_array_end = .);
}
.fini_array : { *(.fini_array) }
.data : {
. = ALIGN(KERNEL_STACK_SIZE); /* init_task */
*(.data.init_task)
*(.data .data.* .gnu.linkonce.d.*)
SORT(CONSTRUCTORS)
}
.data1 : { *(.data1) }
.tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) } .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
.tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) } .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
.eh_frame : { KEEP (*(.eh_frame)) } .preinit_array :
.gcc_except_table : { *(.gcc_except_table) } {
.dynamic : { *(.dynamic) } PROVIDE_HIDDEN (__preinit_array_start = .);
.ctors : { KEEP (*(.preinit_array))
PROVIDE_HIDDEN (__preinit_array_end = .);
}
.init_array :
{
PROVIDE_HIDDEN (__init_array_start = .);
KEEP (*(SORT(.init_array.*)))
KEEP (*(.init_array))
PROVIDE_HIDDEN (__init_array_end = .);
}
.fini_array :
{
PROVIDE_HIDDEN (__fini_array_start = .);
KEEP (*(.fini_array))
KEEP (*(SORT(.fini_array.*)))
PROVIDE_HIDDEN (__fini_array_end = .);
}
.ctors :
{
/* gcc uses crtbegin.o to find the start of /* gcc uses crtbegin.o to find the start of
the constructors, so we make sure it is the constructors, so we make sure it is
first. Because this is a wildcard, it first. Because this is a wildcard, it
@ -133,35 +128,102 @@ SECTIONS
doesn't matter which directory crtbegin.o doesn't matter which directory crtbegin.o
is in. */ is in. */
KEEP (*crtbegin.o(.ctors)) KEEP (*crtbegin.o(.ctors))
KEEP (*crtbegin?.o(.ctors))
/* We don't want to include the .ctor section from /* We don't want to include the .ctor section from
from the crtend.o file until after the sorted ctors. the crtend.o file until after the sorted ctors.
The .ctor section from the crtend file contains the The .ctor section from the crtend file contains the
end of ctors marker and it must be last */ end of ctors marker and it must be last */
KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors)) KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
KEEP (*(SORT(.ctors.*))) KEEP (*(SORT(.ctors.*)))
KEEP (*(.ctors)) KEEP (*(.ctors))
} }
.dtors : { .dtors :
{
KEEP (*crtbegin.o(.dtors)) KEEP (*crtbegin.o(.dtors))
KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors)) KEEP (*crtbegin?.o(.dtors))
KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
KEEP (*(SORT(.dtors.*))) KEEP (*(SORT(.dtors.*)))
KEEP (*(.dtors)) KEEP (*(.dtors))
} }
.jcr : { KEEP (*(.jcr)) } .jcr : { KEEP (*(.jcr)) }
.got : { *(.got.plt) *(.got) } .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
_edata = .; .dynamic : { *(.dynamic) }
PROVIDE (edata = .); .got : { *(.got) }
. = DATA_SEGMENT_RELRO_END (24, .);
.got.plt : { *(.got.plt) }
.data :
{
*(.data .data.* .gnu.linkonce.d.*)
KEEP (*(.gnu.linkonce.d.*personality*))
SORT(CONSTRUCTORS)
}
.data1 : { *(.data1) }
_edata = .; PROVIDE (edata = .);
__bss_start = .; __bss_start = .;
.bss : { .bss :
{
*(.dynbss) *(.dynbss)
*(.bss .bss.* .gnu.linkonce.b.*) *(.bss .bss.* .gnu.linkonce.b.*)
*(COMMON) *(COMMON)
/* Align here to ensure that the .bss section occupies space up to /* Align here to ensure that the .bss section occupies space up to
_end. Align after .bss to ensure correct alignment even if the _end. Align after .bss to ensure correct alignment even if the
.bss section disappears because there are no input sections. */ .bss section disappears because there are no input sections.
. = ALIGN(32 / 8); FIXME: Why do we need it? When there is no .bss section, we don't
. = ALIGN(32 / 8); pad the .data section. */
. = ALIGN(. != 0 ? 64 / 8 : 1);
} }
_end = .; .lbss :
PROVIDE (end = .); {
*(.dynlbss)
*(.lbss .lbss.* .gnu.linkonce.lb.*)
*(LARGE_COMMON)
}
. = ALIGN(64 / 8);
.lrodata ALIGN(CONSTANT (MAXPAGESIZE)) + (. & (CONSTANT (MAXPAGESIZE) - 1)) :
{
*(.lrodata .lrodata.* .gnu.linkonce.lr.*)
}
.ldata ALIGN(CONSTANT (MAXPAGESIZE)) + (. & (CONSTANT (MAXPAGESIZE) - 1)) :
{
*(.ldata .ldata.* .gnu.linkonce.l.*)
. = ALIGN(. != 0 ? 64 / 8 : 1);
}
. = ALIGN(64 / 8);
_end = .; PROVIDE (end = .);
. = DATA_SEGMENT_END (.);
/* Stabs debugging sections. */
.stab 0 : { *(.stab) }
.stabstr 0 : { *(.stabstr) }
.stab.excl 0 : { *(.stab.excl) }
.stab.exclstr 0 : { *(.stab.exclstr) }
.stab.index 0 : { *(.stab.index) }
.stab.indexstr 0 : { *(.stab.indexstr) }
.comment 0 : { *(.comment) }
/* DWARF debug sections.
Symbols in the DWARF debugging sections are relative to the beginning
of the section so we begin them at 0. */
/* DWARF 1 */
.debug 0 : { *(.debug) }
.line 0 : { *(.line) }
/* GNU DWARF 1 extensions */
.debug_srcinfo 0 : { *(.debug_srcinfo) }
.debug_sfnames 0 : { *(.debug_sfnames) }
/* DWARF 1.1 and DWARF 2 */
.debug_aranges 0 : { *(.debug_aranges) }
.debug_pubnames 0 : { *(.debug_pubnames) }
/* DWARF 2 */
.debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
.debug_abbrev 0 : { *(.debug_abbrev) }
.debug_line 0 : { *(.debug_line) }
.debug_frame 0 : { *(.debug_frame) }
.debug_str 0 : { *(.debug_str) }
.debug_loc 0 : { *(.debug_loc) }
.debug_macinfo 0 : { *(.debug_macinfo) }
/* 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) }
/DISCARD/ : { *(.note.GNU-stack) }
} }