Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1200 byte noop #1

Open
eigood opened this issue Jul 5, 2017 · 1 comment
Open

1200 byte noop #1

eigood opened this issue Jul 5, 2017 · 1 comment

Comments

@eigood
Copy link

eigood commented Jul 5, 2017

#include <unistd.h>

int _start(void) {
        _exit(42);
}
11:24:50 -0500 adam@tooz:/tmp$ gcc -nostartfiles -static -Wall -s -O3 -o noop noop.c && ls -l noop && ./noop; echo $?
-rwxrwxr-x 1 adam adam 1200 Jul  5 11:24 noop
42

I was aware of http://www.muppetlabs.com/~breadbox/software/tiny/teensy.html when I found your repo, in the compose extends thread, so a bit of googling for a non-assembly based way, that seems easy to understand.

A standard static compile, with strip, was 750k or so on my machine.

The license on this example is public domain. I don't care what anyone does with it, there is nothing of value in any of this.

@JanNash
Copy link
Owner

JanNash commented Jul 5, 2017

This is awesome and I will try to get that in asap, thanks, @eigood

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants