README 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. This is a set of tiny Hello world executables for Linux.
  2. All they do is
  3. write(1, "Hello!\n", 7)
  4. _exit(0)
  5. but it's done in as little bytes as possible. This particular
  6. implementation stores the string in ELF header padding and
  7. squashes Ehdr against Phdr on little-endian targets.
  8. For context and the origins of the size-reducing tricks, see
  9. http://www.muppetlabs.com/~breadbox/software/tiny/teensy.html
  10. http://mainisusuallyafunction.blogspot.com/2015/01/151-byte-static-linux-binary-in-rust.html
  11. http://hookrace.net/blog/nim-binary-size/
  12. Unlike the x86-focused projects above, this one attempts
  13. to be relatively portable. GNU binutils are used instead of nasm,
  14. and it is expected to work well with cross-compiling toolchains.
  15. For most configurations, run something like
  16. make ARCH=arm CROSS=arm-linux-gnueabi-
  17. or set both variables in Makefile.
  18. To build x86_32 with a native x86_64 toolchain, set
  19. AS = as --x32
  20. LD = ld -melf32_x86_64
  21. Run resulting executables with appropriate qemu:
  22. qemu-arm ./hello_arm
  23. Use -strace option to verify it's working properly.