Add support for symbol table in .com files

This change fixes minor bugs and adds a feature, which lets us store the
ELF symbol table, inside the ZIP directory. We use the path /zip/.symtab
which can be safely removed using a zip editing tool, to make the binary
smaller after compilation. This supplements the existing method of using
a separate .com.dbg file, which is still supported. The intent is people
don't always know that it's a good idea to download the debug file. It's
not great having someone's first experience be a crash report, that only
has numbers rather than symbols. This will help fix that!
This commit is contained in:
Justine Tunney 2022-03-23 06:31:55 -07:00
parent 393ca4be40
commit 23b72eb617
61 changed files with 963 additions and 510 deletions

View file

@ -50,6 +50,7 @@ TOOL_BUILD_DIRECTDEPS = \
LIBC_TINYMATH \
LIBC_UNICODE \
LIBC_X \
LIBC_ZIPOS \
NET_HTTPS \
THIRD_PARTY_COMPILER_RT \
THIRD_PARTY_GDTOA \
@ -78,7 +79,7 @@ o/$(MODE)/tool/build/%.com.dbg: \
o/$(MODE)/tool/build/%.o \
$(CRT) \
$(APE)
-@$(APELINK)
@$(APELINK)
o/$(MODE)/tool/build/blinkenlights.com.dbg: \
$(TOOL_BUILD_DEPS) \
@ -88,13 +89,23 @@ o/$(MODE)/tool/build/blinkenlights.com.dbg: \
$(APE_NO_MODIFY_SELF)
@$(APELINK)
o/$(MODE)/tool/build/blinkenlights.com: \
o/$(MODE)/tool/build/blinkenlights.com.dbg \
o/$(MODE)/third_party/infozip/zip.com \
o/$(MODE)/tool/build/symtab.com
@$(COMPILE) -AOBJCOPY -T$@ $(OBJCOPY) -S -O binary $< $@
@$(COMPILE) -ASYMTAB o/$(MODE)/tool/build/symtab.com \
-o o/$(MODE)/tool/build/.blinkenlights/.symtab $<
@$(COMPILE) -AZIP -T$@ o/$(MODE)/third_party/infozip/zip.com -9qj $@ \
o/$(MODE)/tool/build/.blinkenlights/.symtab
o/$(MODE)/tool/build/ar.com.dbg: \
$(TOOL_BUILD_DEPS) \
o/$(MODE)/tool/build/build.pkg \
o/$(MODE)/tool/build/ar.o \
$(CRT) \
$(APE)
-@$(APELINK)
@$(APELINK)
o/$(MODE)/tool/build/package.com.dbg: \
$(TOOL_BUILD_DEPS) \
@ -102,7 +113,7 @@ o/$(MODE)/tool/build/package.com.dbg: \
o/$(MODE)/tool/build/package.o \
$(CRT) \
$(APE)
-@$(APELINK)
@$(APELINK)
o/$(MODE)/tool/build/mkdeps.com.dbg: \
$(TOOL_BUILD_DEPS) \
@ -118,7 +129,7 @@ o/$(MODE)/tool/build/compile.com.dbg: \
o/$(MODE)/tool/build/compile.o \
$(CRT) \
$(APE)
-@$(APELINK)
@$(APELINK)
o/$(MODE)/tool/build/zipobj.com.dbg: \
$(TOOL_BUILD_DEPS) \
@ -126,7 +137,7 @@ o/$(MODE)/tool/build/zipobj.com.dbg: \
o/$(MODE)/tool/build/zipobj.o \
$(CRT) \
$(APE)
-@$(APELINK)
@$(APELINK)
o/$(MODE)/tool/build/emulator.o: \
OVERRIDE_COPTS += \