Conversation
Hand-written ARM32 assembly rewrite that is functionally identical to the C version but significantly smaller by: - Using raw Linux syscalls instead of libc wrappers (write, close, fork, execve, wait4, fchmod, unlink, socket, connect, sendto, recvfrom) - Eliminating CRT startup (no .init/.fini, no __uClibc_main) - Inlining string operations (strcmp, strstr, memset, memcpy) - Only 2 PLT imports remain: gethostbyname and mkstemp Size comparison (stripped, hisiv510 toolchain): C version: 4680 bytes, bin2sh script: 14532 bytes ASM version: 2632 bytes, bin2sh script: 7965 bytes Tested on all 6 toolchains via qemu-arm (48 tests: 8 per toolchain). Also updates: - Makefile: adds uget-asm target - CI: builds and tests both variants, includes both in release artifacts - README: documents both variants Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Hand-written ARM32 assembly rewrite of uget that is functionally identical but significantly smaller.
uget(C)uget-asm(ARM32)How it works
_startentry point — no CRT startup (.init/.fini,__uClibc_main, frame registration)gethostbyname(DNS) andmkstemp(temp file)Per-toolchain sizes
himix toolchains show less savings due to linker segment page-alignment padding (~2KB of zeroes between text and data segments), not from larger code.
Test plan
🤖 Generated with Claude Code