hex2.1 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. .\"Made with Love
  2. .TH hex2 1 "JULY 2019" Linux "User Manuals"
  3. .SH NAME
  4. hex2 - The trivially bootstrappable linker that is designed to be introspectable by humans
  5. .SH SYNOPSIS
  6. .na
  7. hex2 --architecture ARCHITECTURE --base-address ADDRESS --file FILE [--output FILE [--non-executable]]
  8. .SH DESCRIPTION
  9. hex2 is designed to allow humans to write elf and other binary
  10. files by hand in a format that allows comments and ease of understanding.
  11. .br
  12. At its core is read 2 hex characters add them together
  13. and output a single byte. You can override this and use
  14. binary or octal input if you so desire, using the --octal
  15. or --binary option.
  16. .br
  17. If no output file is specified the output will be send to standard out.
  18. By default the file will be executable unless the option:
  19. --non-executable is also passed.
  20. .br
  21. The supported ARCHITECTURES are as follows: knight-native,
  22. knight-posix, x86, amd64, armv7l and aarch64.
  23. If you fail to specify an architecture, the default of knight-native
  24. will be used.
  25. .br
  26. The base address for which the binary is to be loaded into memory
  27. and thus the relative and absolute pointers should be based,
  28. is passed via --base-address if it is not provided the default
  29. value of ZERO will be assumed.
  30. .br
  31. hex2 also support labels in the :LABEL format and relative
  32. and absolute pointers to those labels in 8, 16, 24 or 32bit sizes.
  33. !LABEL, @LABEL, ~LABEL and %LABEL for 8, 16, 24 and 32bit relative addresses
  34. respectively and $LABEL and &LABEL for 16 and 32bit absolute
  35. addresses respectively.
  36. Should you wish to specify the bit and byte encoding of the
  37. addresses to match your target --big-endian and --little-endian
  38. On architectures that require word alignment the < and ^
  39. characters have a special meaning; particularly pad to word
  40. and use word base address calculation rather than standard
  41. byte based address calculation; generally seen in the form:
  42. ^~LABEL EB for calls in ARM
  43. .SH EXAMPLES
  44. Typically, hex2 will be called in scripts used in bootstrapping
  45. .br
  46. # hex2 -f ELF-armv7l.hex2 -f cc.hex2 --little-endian --architecture armv7l --base-address 0x10000 -o cc
  47. .br
  48. .SH COMPATIBILITY
  49. hex2 is compatible with all Turing complete machines;
  50. even the ones that try to be Turing complete -1
  51. .SH AUTHORS
  52. Jeremiah Orians <Jeremiah@pdp10.guru>
  53. .br
  54. Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
  55. .SH COPYRIGHT
  56. Copyright 2016-2019 Jeremiah Orians <Jeremiah@pdp10.guru>
  57. .br
  58. Copyright 2017 Jan Nieuwenhuizen <janneke@gnu.org>
  59. .br
  60. License GPLv3+.
  61. .SH "SEE ALSO"
  62. M1(1), blood-elf(1), kaem(1), syscalls(2)