Skip to content

Commit cdf0d5a

Browse files
committed
iop: fix .text offset 0 issues across IOP modules
For modules with export tables, reorder IOP_OBJS so exports.o is linked first and move _retonly definitions after DECLARE_EXPORT_TABLE in exports.tab, ensuring the export struct (STT_OBJECT) occupies .text offset 0 instead of function code. For modules without export tables (smap-none, smap-ps2ip, and others), automatically pass --allow-zero-text to srxfixup via Rules.make when no exports.o is present in IOP_OBJS.
1 parent 7191979 commit cdf0d5a

31 files changed

Lines changed: 46 additions & 41 deletions

File tree

common/sbus/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ IOP_INCS += \
2929

3030
IOP_OBJS_DIR = iop_obj/
3131

32-
IOP_OBJS = ps2_sbus.o iop_sbus.o ps2_sif.o iop_sif2.o sif2cmd.o imports.o exports.o
32+
IOP_OBJS = exports.o iop_sbus.o iop_sif2.o ps2_sbus.o ps2_sif.o sif2cmd.o imports.o
3333

3434
include $(PS2SDKSRC)/Defs.make
3535
include $(PS2SDKSRC)/ee/Rules.lib.make

iop/arcade/acatad/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ IOP_IMPORT_INCS += \
1616
system/threadman
1717

1818
IOP_OBJS = \
19+
exports.o \
1920
acatad.o \
20-
imports.o \
21-
exports.o
21+
imports.o
2222

2323
include $(PS2SDKSRC)/Defs.make
2424
include $(PS2SDKSRC)/iop/Rules.bin.make

iop/arcade/accdvd/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ IOP_IMPORT_INCS += \
1919
system/threadman
2020

2121
IOP_OBJS = \
22+
exports.o \
2223
accdvdi-entry.o \
2324
acd.o \
2425
cdc.o \
2526
cdi.o \
2627
cddrv.o \
2728
cdfs.o \
28-
imports.o \
29-
exports.o
29+
imports.o
3030

3131
include $(PS2SDKSRC)/Defs.make
3232
include $(PS2SDKSRC)/iop/Rules.bin.make

iop/arcade/acdev/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ IOP_IMPORT_INCS += \
1414
system/sysmem
1515

1616
IOP_OBJS = \
17+
exports.o \
1718
acdev.o \
18-
imports.o \
19-
exports.o
19+
imports.o
2020

2121
include $(PS2SDKSRC)/Defs.make
2222
include $(PS2SDKSRC)/iop/Rules.bin.make

iop/arcade/acdev9/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ IOP_IMPORT_INCS += \
1212
system/stdio
1313

1414
IOP_OBJS = \
15+
exports.o \
1516
acdev9.o \
16-
imports.o \
17-
exports.o
17+
imports.o
1818

1919
include $(PS2SDKSRC)/Defs.make
2020
include $(PS2SDKSRC)/iop/Rules.bin.make

iop/cdvd/cdvdfsv/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ IOP_IMPORT_INCS += \
2121
system/sysmem \
2222
system/threadman
2323

24-
IOP_OBJS = cdvdfsv.o imports.o exports.o
24+
IOP_OBJS = exports.o cdvdfsv.o imports.o
2525

2626
include $(PS2SDKSRC)/Defs.make
2727
include $(PS2SDKSRC)/iop/Rules.bin.make

iop/cdvd/cdvdman/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ IOP_IMPORT_INCS += \
1818
system/sysmem \
1919
system/threadman
2020

21-
IOP_OBJS = cdvdman.o imports.o exports.o
21+
IOP_OBJS = exports.o cdvdman.o imports.o
2222

2323
include $(PS2SDKSRC)/Defs.make
2424
include $(PS2SDKSRC)/iop/Rules.bin.make

iop/cdvd/cdvdstm/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ IOP_IMPORT_INCS += \
1919
system/sysmem \
2020
system/threadman
2121

22-
IOP_OBJS = cdvdstm.o imports.o exports.o
22+
IOP_OBJS = exports.o cdvdstm.o imports.o
2323

2424
include $(PS2SDKSRC)/Defs.make
2525
include $(PS2SDKSRC)/iop/Rules.bin.make

iop/debug/ioptrap/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ IOP_IMPORT_INCS += \
1717
system/sysclib \
1818
system/threadman
1919

20-
IOP_OBJS = ioptrap.o handler.o breakpoint.o exports.o imports.o
20+
IOP_OBJS = exports.o ioptrap.o handler.o breakpoint.o imports.o
2121

2222
include $(PS2SDKSRC)/Defs.make
2323
include $(PS2SDKSRC)/iop/Rules.bin.make

iop/debug/sior/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ IOP_IMPORT_INCS += \
1313
system/sysclib \
1414
system/threadman
1515

16-
IOP_OBJS = sior.o xprintf.o exports.o imports.o
16+
IOP_OBJS = exports.o sior.o xprintf.o imports.o
1717

1818
include $(PS2SDKSRC)/Defs.make
1919
include $(PS2SDKSRC)/iop/Rules.bin.make

0 commit comments

Comments
 (0)