From 60ca6e1b77f3e3e476250bded132c2a59103d4af Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Thu, 1 Jun 2023 21:42:23 +0100 Subject: Filter out any unwanted symbol --- tools/pngpal.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tools/pngpal.py') diff --git a/tools/pngpal.py b/tools/pngpal.py index 7db451d..195fc91 100755 --- a/tools/pngpal.py +++ b/tools/pngpal.py @@ -8,6 +8,7 @@ from PIL import Image __version__ = "1.0" ld = os.environ.get("LD", "i586-pc-msdosdjgpp-ld") +strip = os.environ.get("STRIP", "i586-pc-msdosdjgpp-strip") def main(): @@ -40,6 +41,8 @@ def main(): with open(tmp, "wb") as fd: fd.write(bytearray(palette)) fd.flush() + + # create an object file from the binary rc = subprocess.call( [ ld, @@ -55,6 +58,11 @@ def main(): if rc != 0: parser.error("Failed to run %s" % ld) + # strip unwanted symbols + rc = subprocess.call([strip, "-w", "-K", "*_%s_*" % tmp, args.output]) + if rc != 0: + parser.error("Failed to run %s" % ld) + if __name__ == "__main__": main() -- cgit v1.2.3