Skip to content

Commit 05d9356

Browse files
committed
iop: default srxfixup flags & allow zero-.text for non-exporting modules
Default IOP_SRXFIXUP_FLAGS to --rb --irx1 and use it for the iopfixup invocation. When the build does not produce exports.o, append --allow-zero-text so modules without an export table do not fail the zero-.text check. This keeps behavior consistent with iop/Rules.make while allowing top-level Makefiles to override IOP_SRXFIXUP_FLAGS when needed.
1 parent 20d0fe9 commit 05d9356

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

samples/Makefile.iopglobal_sample

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,15 @@ endif
7474

7575
IOP_OBJS := $(IOP_OBJS:%=$(IOP_OBJS_DIR)%)
7676

77+
# srxfixup flags: default to `--rb --irx1`. If this module does not build an
78+
# exports.o, add `--allow-zero-text` (modules without an export table may
79+
# legitimately lack an STT_OBJECT at .text offset 0). Top-level Makefiles may
80+
# override `IOP_SRXFIXUP_FLAGS` if they need custom behaviour.
81+
IOP_SRXFIXUP_FLAGS := --rb --irx1
82+
ifeq (,$(filter $(IOP_OBJS_DIR)exports.o,$(IOP_OBJS)))
83+
IOP_SRXFIXUP_FLAGS += --allow-zero-text
84+
endif
85+
7786
IOP_BIN_ELF := $(IOP_BIN:.irx=.notiopmod.elf)
7887

7988
IOP_BIN_STRIPPED_ELF := $(IOP_BIN:.irx=.notiopmod.stripped.elf)
@@ -133,7 +142,7 @@ $(IOP_BIN_STRIPPED_ELF): $(IOP_BIN_ELF)
133142

134143
$(IOP_BIN): $(IOP_BIN_STRIPPED_ELF)
135144
$(DIR_GUARD)
136-
iopfixup --irx1 -o $@ $<
145+
iopfixup $(IOP_SRXFIXUP_FLAGS) -o $@ $<
137146

138147
$(IOP_LIB): $(IOP_OBJS)
139148
$(DIR_GUARD)

0 commit comments

Comments
 (0)