File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed
Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -78,6 +78,10 @@ ifeq ($(IOP_LINKFILE),)
7878IOP_LINKFILE := $(PS2SDKSRC ) /iop/startup/src/linkfile
7979endif
8080
81+ # If this build produces an exports.o, ensure it is linked first so the
82+ # export-table object occupies .text offset 0 (helps srxfixup detection).
83+ IOP_OBJS := $(filter exports.o,$(IOP_OBJS ) ) $(filter-out exports.o,$(IOP_OBJS ) )
84+
8185IOP_OBJS := $(IOP_OBJS:%=$(IOP_OBJS_DIR ) % )
8286
8387IOP_BIN_ELF := $(IOP_BIN:.irx=.notiopmod.elf )
Original file line number Diff line number Diff line change @@ -72,14 +72,12 @@ ifeq ($(IOP_LINKFILE),)
7272IOP_LINKFILE := $(PS2SDK)/iop/startup/linkfile
7373endif
7474
75- # Populate object paths
76- IOP_OBJS := $(IOP_OBJS:%=$(IOP_OBJS_DIR)%)
77-
7875# If this build produces an exports.o, ensure it is linked first so the
7976# export-table object occupies .text offset 0 (helps srxfixup detection).
80- ifneq (,$(filter $(IOP_OBJS_DIR)exports.o,$(IOP_OBJS)))
81- IOP_OBJS := $(IOP_OBJS_DIR)exports.o $(filter-out $(IOP_OBJS_DIR)exports.o,$(IOP_OBJS))
82- endif
77+ IOP_OBJS := $(filter exports.o,$(IOP_OBJS)) $(filter-out exports.o,$(IOP_OBJS))
78+
79+ # Populate object paths
80+ IOP_OBJS := $(IOP_OBJS:%=$(IOP_OBJS_DIR)%)
8381
8482# srxfixup flags: default to `--rb --irx1`. If this module does not build an
8583# exports.o, add `--allow-zero-text` (modules without an export table may
@@ -132,6 +130,7 @@ $(IOP_OBJS_DIR)imports.o: $(IOP_OBJS_DIR)build-imports.c
132130
133131# Rules to build exports.tab.
134132$(IOP_OBJS_DIR)build-exports.c: $(IOP_SRC_DIR)exports.tab
133+ $(DIR_GUARD)
135134 $(PRINTF) '%s\n' "#include \"irx.h\"" > $@
136135 cat $< >> $@
137136
You can’t perform that action at this time.
0 commit comments