diff options
author | Max <mparisi@stevens.edu> | 2020-09-23 14:33:06 -0400 |
---|---|---|
committer | Max <mparisi@stevens.edu> | 2020-09-23 14:33:06 -0400 |
commit | 4e91f4772fb5e5d9ea80694e5aa7c27be4315a00 (patch) | |
tree | a828fc9b30d8bebbfc9cc1b8a08a38ea95ed1f0e | |
parent | 556f48661d82d5bc32177f9b5c71ff4d39288302 (diff) |
patch_strtab readme, and add it to the Makefile
-rw-r--r-- | Makefile | 19 | ||||
-rw-r--r-- | tools/patch_strtab/README.md | 2 | ||||
-rw-r--r-- | tools/patch_strtab/patch_strtab.c | 13 |
3 files changed, 20 insertions, 14 deletions
@@ -55,14 +55,15 @@ O_FILES := $(EXTAB_O_FILES) $(EXTABINDEX_O_FILES) $(TEXT_O_FILES) \ MWCC_VERSION := 3.0 # Programs -AS := $(DEVKITPPC)/bin/powerpc-eabi-as -OBJCOPY := $(DEVKITPPC)/bin/powerpc-eabi-objcopy -CPP := cpp -P -CC := $(WINE) tools/mwcc_compiler/$(MWCC_VERSION)/mwcceppc.exe -LD := $(WINE) tools/mwcc_compiler/$(MWCC_VERSION)/mwldeppc.exe -ELF2DOL := tools/elf2dol/elf2dol$(EXE) -SHA1SUM := sha1sum -PYTHON := python3 +AS := $(DEVKITPPC)/bin/powerpc-eabi-as +OBJCOPY := $(DEVKITPPC)/bin/powerpc-eabi-objcopy +CPP := cpp -P +CC := $(WINE) tools/mwcc_compiler/$(MWCC_VERSION)/mwcceppc.exe +LD := $(WINE) tools/mwcc_compiler/$(MWCC_VERSION)/mwldeppc.exe +PATCHSTRTAB := tools/patch_strtab/patch_strtab$(EXE) +ELF2DOL := tools/elf2dol/elf2dol$(EXE) +SHA1SUM := sha1sum +PYTHON := python3 #POSTPROC := tools/postprocess.py @@ -132,6 +133,8 @@ $(ELF): $(O_FILES) $(LDSCRIPT) $(OBJCOPY) $@ $@ $(BUILD_DIR)/%.o: %.s $(AS) $(ASFLAGS) -o $@ $< + # resolve escape sequences for C++ mangled names in the .strtab section (assembler workaround). + $(PATCHSTRTAB) $< $(BUILD_DIR)/%.o: %.cpp $(CC) $(CFLAGS) -lang c++ -c -o $@ $< diff --git a/tools/patch_strtab/README.md b/tools/patch_strtab/README.md index 6904ac1..5cdca3f 100644 --- a/tools/patch_strtab/README.md +++ b/tools/patch_strtab/README.md @@ -1,6 +1,6 @@ README:
-The program patches the .strtab section of an ELF relocatable module
+This program patches the .strtab section of an ELF relocatable module
by replacing certain escape sequences with the characters they represent.
CodeWarrior's C++ name mangling scheme may produce linkage names that
diff --git a/tools/patch_strtab/patch_strtab.c b/tools/patch_strtab/patch_strtab.c index ee0076a..bbdd4ce 100644 --- a/tools/patch_strtab/patch_strtab.c +++ b/tools/patch_strtab/patch_strtab.c @@ -1,9 +1,12 @@ /*
-patch_strtab
-
-by Max Parisi, 2020
-
-*/
+ * patch_strtab
+ *
+ * This program patches the .strtab section of an ELF relocatable module
+ * by replacing certain escape sequences with the characters they represent.
+ *
+ * by Max Parisi, 2020
+ *
+ */
#include <stdio.h>
#include <stdlib.h>
|