Merge pull request #609 from Henny022p/linker-fix

This commit is contained in:
notyourav 2023-05-20 22:03:32 -07:00 committed by GitHub
commit 298d215232
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

4
GBA.mk
View File

@ -123,7 +123,7 @@ $(BUILD_DIR)/%.o : %.c $$(deps)
@mkdir -p $(dir $@)
$(CPP) $(CPPFLAGS) $< -o $(BUILD_DIR)/$*.i
$(CC1) $(CFLAGS) -o $(BUILD_DIR)/$*.s $(BUILD_DIR)/$*.i
@echo "\t.text\n\t.align\t2, 0 @ Don't pad with nop\n" >> $(BUILD_DIR)/$*.s
@printf "\t.text\n\t.align\t2, 0 @ Don't pad with nop\n" >> $(BUILD_DIR)/$*.s
$(AS) $(ASFLAGS) -o $@ $(BUILD_DIR)/$*.s
# ==============
@ -136,7 +136,7 @@ LIB := -L ../../tools/agbcc/lib -lc
$(ROM): $(ELF)
$(OBJCOPY) -O binary --gap-fill 0xFF --pad-to 0x9000000 $< $@
$(ELF): objs = $(shell grep -o -E "(\w|/)+\.o" linker.ld)
$(ELF): objs = $(shell grep -vE "\*\w+\.a" linker.ld | grep -oE "(\w|/)+\.o")
$(ELF): $(BUILD_DIR)/linker.ld $$(addprefix $(BUILD_DIR)/, $$(objs))
cd $(BUILD_DIR) && $(LD) $(LDFLAGS) -n -T linker.ld -o ../../$@ $(LIB)
$(FIX) $@ -t"$(TITLE)" -c$(GAME_CODE) -m$(MAKER_CODE) -r$(REVISION) --silent

View File

@ -867,7 +867,7 @@ SECTIONS {
src/gba/m4a.o(.text);
asm/lib/libagbsyscall.o(.text);
src/eeprom.o(.text);
libc.a(.text);
*libc.a:memcpy.o(.text);
/* handwritten assembly in arm mode */
asm/src/intr.o(.text);