universalisos/tools/uos-cdk/ldscripts/elf32lppcuos.x

118 lines
3.3 KiB
Text

/* UOS linker script for PPC ELF 32-bit little-endian */
OUTPUT_FORMAT("elf32-powerpcle", "elf32-powerpcle",
"elf32-powerpcle")
OUTPUT_ARCH(powerpc:common)
ENTRY(_start)
PHDRS
{
text PT_LOAD FLAGS(5);
data PT_LOAD FLAGS(6);
}
SECTIONS
{
/* Read-only sections, merged into text segment: */
. = SEGMENT_START("text-segment", 0x08010000) + SIZEOF_HEADERS;
_ftext = . ;
.note.gnu.build-id : { *(.note.gnu.build-id) }
.text :
{
*(.text.unlikely .text.*_unlikely)
*(.text .stub .text.* .gnu.linkonce.t.*)
/* .gnu.warning sections are handled specially by elf32.em. */
*(.gnu.warning)
*(.glink)
} : text
.fini :
{
KEEP (*(.fini))
} =0
.rodata : { *(.rodata .rodata.* .gnu.linkonce.r.* .rodata1 .sdata2 .sbss2) } : text
.eh_frame_hdr : { *(.eh_frame_hdr) } : text
/* Exception handling */
.eh_frame :
{
__EH_FRAME__ = . ;
KEEP (*(.eh_frame))
} : text
.gcc_except_table :
{
*(.gcc_except_table .gcc_except_table.*)
} : text
.preinit_array :
{
PROVIDE_HIDDEN (__preinit_array_start = .);
KEEP (*(.preinit_array))
PROVIDE_HIDDEN (__preinit_array_end = .);
}
.init_array :
{
PROVIDE_HIDDEN (__init_array_start = .);
KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))
KEEP (*(.init_array .ctors))
PROVIDE_HIDDEN (__init_array_end = .);
}
.fini_array :
{
PROVIDE_HIDDEN (__fini_array_start = .);
KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))
KEEP (*(.fini_array .dtors))
PROVIDE_HIDDEN (__fini_array_end = .);
}
.ctors :
{
__CTOR_LIST__ = .;
KEEP (*(SORT(.ctors.*)))
KEEP (*(.ctors))
__CTOR_END__ = .;
}
.dtors :
{
__DTOR_LIST__ = .;
KEEP (*(SORT(.dtors.*)))
KEEP (*(.dtors))
__DTOR_END__ = .;
}
PROVIDE (_etext = .);
/* Read-write sections, merged into data segment: */
/* align data segment up to next page to prevent overlapping segments */
. = ALIGN(0x1000);
_fdata = . ;
._uos_vm_stack :
{
LONG(ABSOLUTE(_uos_vm_stack_size));
LONG(ABSOLUTE(_uos_vm_stack));
} : data
.data :
{
*(.data .data.* .gnu.linkonce.d.* .data1 .sdata)
SORT(CONSTRUCTORS)
} : data
_edata = .; PROVIDE (edata = .);
__bss_start = .;
.bss :
{
*(.dynbss)
*(.bss .bss.* .gnu.linkonce.b.*)
*(COMMON)
/* Align here to ensure that the .bss section occupies space up to
_end. Align after .bss to ensure correct alignment even if the
.bss section disappears because there are no input sections.
FIXME: Why do we need it? When there is no .bss section, we don't
pad the .data section. */
. = ALIGN(. != 0 ? 32 / 8 : 1);
} : data
. = ALIGN(32 / 8);
. = ALIGN(32 / 8);
__end = .;
_end = .; PROVIDE (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) }
.gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
/DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
}