Created
March 15, 2022 15:46
-
-
Save SKGleba/d317f5f826aeb0a672a83ab792397040 to your computer and use it in GitHub Desktop.
bypass 24bit _start in mep gcc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%.S: %.c | |
$(CC) -S -o $@ $< $(CFLAGS) | |
%.o: %.S | |
mv $< $<.w | |
awk '{if ($$1 == "movu" && !($$3 ~ /^[0-9]/)) {$$1 = "or3"; $$4 = $$3; $$3 = $$2; printf("\tmovh %s 0x0004\n\t", $$2)}} 1' $<.w > $< | |
rm $<.w | |
$(CC) -c -o $@ $< $(CFLAGS) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment