hex2.1 2.5 KB

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