-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changes to use unpatched binutils for linking IRX
- Loading branch information
Showing
6 changed files
with
173 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# _____ ___ ____ ___ ____ | ||
# ____| | ____| | | |____| | ||
# | ___| |____ ___| ____| | \ PS2DEV Open Source Project. | ||
#----------------------------------------------------------------------- | ||
# Copyright 2001-2004, ps2dev - http://www.ps2dev.org | ||
# Licenced under Academic Free License version 2.0 | ||
# Review ps2sdk README & LICENSE files for further details. | ||
|
||
all: | ||
|
||
include $(PS2SDKSRC)/Defs.make | ||
include $(PS2SDKSRC)/iop/Rules.make | ||
include $(PS2SDKSRC)/iop/Rules.release | ||
|
||
clean: | ||
|
||
release: | ||
$(ECHO) Installing $(IOP_SRC_DIR)linkfile into $(PS2SDK)/iop/startup | ||
cp -f $(IOP_SRC_DIR)linkfile $(PS2SDK)/iop/startup | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
/* | ||
# _____ ___ ____ ___ ____ | ||
# ____| | ____| | | |____| | ||
# | ___| |____ ___| ____| | \ PS2DEV Open Source Project. | ||
#----------------------------------------------------------------------- | ||
# Copyright 2001-2022, ps2dev - http://www.ps2dev.org | ||
# Licenced under Academic Free License version 2.0 | ||
# Review ps2sdk README & LICENSE files for further details. | ||
# | ||
# Linkfile script for iop-ld | ||
*/ | ||
|
||
OUTPUT_FORMAT("elf32-littlemips") | ||
SEARCH_DIR(""); | ||
ENTRY(_start) | ||
PHDRS | ||
{ | ||
irxhdr 0x70000080 FLAGS (PF_R); | ||
defhdr PT_LOAD; | ||
} | ||
SECTIONS | ||
{ | ||
/* | ||
* This is the .iopmod section for the IRX, it contains information that | ||
* the IOP uses when loading the IRX. | ||
* This section is placed in its own segment. | ||
*/ | ||
.iopmod (COPY) : ALIGN(4) { | ||
/* | ||
* The linker will replace this first LONG with a pointer to _irx_id | ||
* if the symbol has been defined. | ||
*/ | ||
LONG (DEFINED(_irx_id) ? _irx_id : 0xffffffff) ; | ||
LONG (_start) ; | ||
LONG (_gp) ; | ||
LONG (_text_size) ; | ||
LONG (_data_size) ; | ||
LONG (_bss_size) ; | ||
/* | ||
* The linker will put a SHORT here with the version of the IRX | ||
* (or zero if there is no version). | ||
*/ | ||
/* | ||
* The linker will put a null terminated string here containing the | ||
* name of the IRX (or an empty string if the name is not known). | ||
*/ | ||
INPUT_SECTION_FLAGS (!SHF_ALLOC & !SHF_WRITE & !SHF_EXECINSTR) * ( .iopmod ) | ||
} :irxhdr | ||
. = 0x0 ; | ||
_ftext = . ; | ||
.text : { | ||
CREATE_OBJECT_SYMBOLS | ||
* ( .text ) | ||
* ( .text.* ) | ||
* ( .init ) | ||
* ( .fini ) | ||
} :defhdr = 0 | ||
_etext = . ; | ||
. = . ; | ||
_fdata = . ; | ||
.rodata : { | ||
* ( .rdata ) | ||
* ( .rodata ) | ||
* ( .rodata1 ) | ||
* ( .rodata.* ) | ||
} = 0 | ||
.data : { | ||
* ( .data ) | ||
* ( .data1 ) | ||
* ( .data.* ) | ||
CONSTRUCTORS | ||
} | ||
. = ALIGN(16) ; | ||
_gp = . + 0x8000 ; | ||
.sdata : { | ||
* ( .lit8 ) | ||
* ( .lit4 ) | ||
* ( .sdata ) | ||
* ( .sdata.* ) | ||
} | ||
_edata = . ; | ||
. = ALIGN(4) ; | ||
_fbss = . ; | ||
.sbss : { | ||
* ( .sbss ) | ||
* ( .scommon ) | ||
} | ||
_bss_start = . ; | ||
.bss : { | ||
* ( .bss ) | ||
* ( COMMON ) | ||
. = ALIGN(4) ; | ||
} | ||
_end = . ; | ||
_text_size = _etext - _ftext ; | ||
_data_size = _edata - _fdata ; | ||
_bss_size = _end - _fbss ; | ||
/* | ||
* These are the stuff that we don't want to be put in an IRX. | ||
*/ | ||
/DISCARD/ : { | ||
* ( .MIPS.abiflags ) | ||
* ( .gnu.attributes ) | ||
* ( .comment ) | ||
* ( .reginfo ) | ||
* ( .mdebug.* ) | ||
/* | ||
* This must go because it confuses the IOP kernel (treated as a reloc section). | ||
*/ | ||
* ( .pdr ) | ||
/* | ||
* Until I can figure out if there's a better way to rid ourselves of | ||
* .rel.dyn this will have to do. - MRB | ||
*/ | ||
* ( .rel.dyn ) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters