aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authorTony Puccinelli2010-05-27 23:47:31 +0000
committerTony Puccinelli2010-05-27 23:47:31 +0000
commit7682a5f815e58aadb6c2d041705626218e83eaac (patch)
treebbbbe55eca4229b5d3a923fa94e0281891d1d4fc /backends
parent0fdfd5d47b5a50b6125bfeca92d83d49b09a6ee1 (diff)
downloadscummvm-rg350-7682a5f815e58aadb6c2d041705626218e83eaac.tar.gz
scummvm-rg350-7682a5f815e58aadb6c2d041705626218e83eaac.tar.bz2
scummvm-rg350-7682a5f815e58aadb6c2d041705626218e83eaac.zip
was using the default linker for the psp. Now a modified version of the default linker for the ps2 compiler
svn-id: r49278
Diffstat (limited to 'backends')
-rw-r--r--backends/platform/ps2/main_prog.ld153
1 files changed, 61 insertions, 92 deletions
diff --git a/backends/platform/ps2/main_prog.ld b/backends/platform/ps2/main_prog.ld
index 68ade38d1a..10b881cef9 100644
--- a/backends/platform/ps2/main_prog.ld
+++ b/backends/platform/ps2/main_prog.ld
@@ -1,66 +1,59 @@
+/* Script for -z combreloc: combine and sort reloc sections */
OUTPUT_FORMAT("elf32-littlemips", "elf32-bigmips",
"elf32-littlemips")
-OUTPUT_ARCH(mips:allegrex)
+OUTPUT_ARCH(mips:5900)
ENTRY(_start)
/* Do we need any of these for elf?
__DYNAMIC = 0; */
+_DYNAMIC_LINK = 0;
SECTIONS
{
/* Read-only sections, merged into text segment: */
- PROVIDE (__executable_start = 0x08900000); . = 0x08900000;
+ . = 0x100000;
.interp : { *(.interp) }
- .reginfo : { *(.reginfo) }
- .dynamic : { *(.dynamic) }
+ .reginfo : { *(.reginfo) }
.hash : { *(.hash) }
.dynsym : { *(.dynsym) }
.dynstr : { *(.dynstr) }
.gnu.version : { *(.gnu.version) }
.gnu.version_d : { *(.gnu.version_d) }
.gnu.version_r : { *(.gnu.version_r) }
- .rel.init : { *(.rel.init) }
- .rela.init : { *(.rela.init) }
- .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }
- .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
- .rel.fini : { *(.rel.fini) }
- .rela.fini : { *(.rela.fini) }
- /* PSP-specific relocations. TODO: works for PS2 as well? */
- .rel.sceStub.text : { *(.rel.sceStub.text) *(SORT(.rel.sceStub.text.*)) }
- .rel.lib.ent.top : { *(.rel.lib.ent.top) }
- .rel.lib.ent : { *(.rel.lib.ent) }
- .rel.lib.ent.btm : { *(.rel.lib.ent.btm) }
- .rel.lib.stub.top : { *(.rel.lib.stub.top) }
- .rel.lib.stub : { *(.rel.lib.stub) }
- .rel.lib.stub.btm : { *(.rel.lib.stub.btm) }
- .rel.rodata.sceModuleInfo : { *(.rel.rodata.sceModuleInfo) }
- .rel.rodata.sceResident : { *(.rel.rodata.sceResident) }
- .rel.rodata.sceNid : { *(.rel.rodata.sceNid) }
- .rel.rodata.sceVstub : { *(.rel.rodata.sceVstub) *(SORT(.rel.rodata.sceVstub.*)) }
- .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }
- .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
- .rel.data.rel.ro : { *(.rel.data.rel.ro*) }
- .rela.data.rel.ro : { *(.rel.data.rel.ro*) }
- .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }
- .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
- .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
- .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
- .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
- .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
- .rel.ctors : { *(.rel.ctors) }
- .rela.ctors : { *(.rela.ctors) }
- .rel.dtors : { *(.rel.dtors) }
- .rela.dtors : { *(.rela.dtors) }
- .rel.got : { *(.rel.got) }
- .rela.got : { *(.rela.got) }
- .rel.sdata : { *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) }
- .rela.sdata : { *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) }
- .rel.sbss : { *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) }
- .rela.sbss : { *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) }
- .rel.sdata2 : { *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) }
- .rela.sdata2 : { *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) }
- .rel.sbss2 : { *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) }
- .rela.sbss2 : { *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) }
- .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }
- .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
+ .rel.dyn :
+ {
+ *(.rel.init)
+ *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
+ *(.rel.fini)
+ *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
+ *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
+ *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
+ *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
+ *(.rel.ctors)
+ *(.rel.dtors)
+ *(.rel.got)
+ *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*)
+ *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*)
+ *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*)
+ *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*)
+ *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
+ }
+ .rela.dyn :
+ {
+ *(.rela.init)
+ *(.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.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
+ *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
+ *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
+ *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
+ *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
+ }
.rel.plt : { *(.rel.plt) }
.rela.plt : { *(.rela.plt) }
.init :
@@ -72,7 +65,6 @@ SECTIONS
{
_ftext = . ;
*(.text .stub .text.* .gnu.linkonce.t.*)
- KEEP (*(.text.*personality*))
/* .gnu.warning sections are handled specially by elf32.em. */
*(.gnu.warning)
*(.mips16.fn.*) *(.mips16.call.*)
@@ -81,56 +73,43 @@ SECTIONS
{
KEEP (*(.fini))
} =0
- /* PSP library stub functions. TODO: works for PS2 as well? */
- .sceStub.text : { *(.sceStub.text) *(SORT(.sceStub.text.*)) }
PROVIDE (__etext = .);
PROVIDE (_etext = .);
PROVIDE (etext = .);
- /* PSP library entry table and library stub table. TODO: works for PS2 as well? */
- .lib.ent.top : { *(.lib.ent.top) }
- .lib.ent : { *(.lib.ent) }
- .lib.ent.btm : { *(.lib.ent.btm) }
- .lib.stub.top : { *(.lib.stub.top) }
- .lib.stub : { *(.lib.stub) }
- .lib.stub.btm : { *(.lib.stub.btm) }
- /* PSP read-only data for module info, NIDs, and Vstubs. The
- .rodata.sceModuleInfo section must appear before the .rodata section
- otherwise it would get absorbed into .rodata and the PSP bootloader
- would be unable to locate the module info structure. TODO: Works for PS2 as well? */
- .rodata.sceModuleInfo : { *(.rodata.sceModuleInfo) }
- .rodata.sceResident : { *(.rodata.sceResident) }
- .rodata.sceNid : { *(.rodata.sceNid) }
- .rodata.sceVstub : { *(.rodata.sceVstub) *(SORT(.rodata.sceVstub.*)) }
.rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
.rodata1 : { *(.rodata1) }
.sdata2 : { *(.sdata2 .sdata2.* .gnu.linkonce.s2.*) }
.sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
.eh_frame_hdr : { *(.eh_frame_hdr) }
- .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
- .gcc_except_table : ONLY_IF_RO { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) }
/* Adjust the address for the data segment. We want to adjust up to
the same address within the page on the next page up. */
- . = ALIGN(256) + (. & (256 - 1));
- /* Exception handling */
- .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
- .gcc_except_table : ONLY_IF_RW { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) }
- /* Thread Local Storage sections */
- .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
- .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ . = ALIGN(128) + (. & (128 - 1));
/* Ensure the __preinit_array_start label is properly aligned. We
could instead move the label definition inside the section, but
the linker would then create the section even if it turns out to
be empty, which isn't pretty. */
. = ALIGN(32 / 8);
PROVIDE (__preinit_array_start = .);
- .preinit_array : { KEEP (*(.preinit_array)) }
+ .preinit_array : { *(.preinit_array) }
PROVIDE (__preinit_array_end = .);
PROVIDE (__init_array_start = .);
- .init_array : { KEEP (*(.init_array)) }
+ .init_array : { *(.init_array) }
PROVIDE (__init_array_end = .);
PROVIDE (__fini_array_start = .);
- .fini_array : { KEEP (*(.fini_array)) }
+ .fini_array : { *(.fini_array) }
PROVIDE (__fini_array_end = .);
+ .data :
+ {
+ _fdata = . ;
+ *(.data .data.* .gnu.linkonce.d.*)
+ SORT(CONSTRUCTORS)
+ }
+ .data1 : { *(.data1) }
+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
+ .eh_frame : { KEEP (*(.eh_frame)) }
+ .gcc_except_table : { *(.gcc_except_table) }
+ .dynamic : { *(.dynamic) }
.ctors :
{
/* gcc uses crtbegin.o to find the start of
@@ -159,18 +138,10 @@ SECTIONS
KEEP (*(.dtors))
}
.jcr : { KEEP (*(.jcr)) }
- .data.rel.ro : { *(.data.rel.ro.local) *(.data.rel.ro*) }
- .data :
- {
- _fdata = . ;
- *(.data .data.* .gnu.linkonce.d.*)
- KEEP (*(.gnu.linkonce.d.*personality*))
- SORT(CONSTRUCTORS)
- }
- .data1 : { *(.data1) }
- . = .;
_gp = ALIGN(16) + 0x7ff0;
.got : { *(.got.plt) *(.got) }
+ .lit8 : { *(.lit8) }
+ .lit4 : { *(.lit4) }
/* We want the small data sections together, so single-instruction offsets
can access them all, and initialized data all before uninitialized, so
we can shorten the on-disk segment size. */
@@ -178,8 +149,6 @@ SECTIONS
{
*(.sdata .sdata.* .gnu.linkonce.s.*)
}
- .lit8 : { *(.lit8) }
- .lit4 : { *(.lit4) }
_edata = .;
PROVIDE (edata = .);
__bss_start = .;
@@ -248,6 +217,6 @@ SECTIONS
.debug_funcnames 0 : { *(.debug_funcnames) }
.debug_typenames 0 : { *(.debug_typenames) }
.debug_varnames 0 : { *(.debug_varnames) }
- /DISCARD/ : { *(.comment) *(.pdr) }
- /DISCARD/ : { *(.note.GNU-stack) }
+ .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
+ .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
}