Advertisement
ashnwill

ELF Specs for ccLinux

Sep 17th, 2014
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.54 KB | None | 0 0
  1. Executable Lua Format, or ELF (or alternatively ELuF) Specifications.
  2. File extensions: .elf, .celf (exclusively for compiled Lua) or .eluf.
  3. Format:
  4. |id|fl|hs|code|
  5. id: Ascii "ELF", identifying an el(u)f file.
  6. fl: Flags for the executable
  7. hs: Hash of code (for corruption detection), hash would be in SHA-256
  8. code: The code/bytecode itself
  9.  
  10. Flags (each one character long):
  11. c - Tells parser that this EL(u)F file has compiled code
  12. n - Tells parser that there are no flags
  13. That's about it (for now).
  14. Fields are terminated by a "#:t", except for the code field.
  15. The code field begins directly after the point where the hs field is terminated.
  16. Suggestions:
  17. 1. Implement this, or support it's implementation
  18. 2. Have kernel source in github, but have it be compiled to celf (EL(u)F with compiled lua code)
  19. 3. Bootloader I just pushed would, in this case, be extended as an ELF parser and would load and run the kernel image. This would greatly increase the load performance among other things, such as it being really cool.
  20. 4. GNU coreutils ports should be compiled to celf for above reasons
  21. EDITED TO GIVE EXAMPLE AND BREAKDOWN OF FORMAT:
  22. Example of this format: (not celf)
  23. hello.elf [
  24. ELF#:tn#:ta5a797fdacc9298ce69f407265bc5afb#:tprint("Hi!")
  25. ]
  26. Above program prints Hi! and exits. The only difference here is because I'm lazy I used MD5 in the terminal rather than looking up a SHA256 hasher online, but you get the point.
  27. Breakdown:
  28. hello.elf [
  29. ELF|n|ta5a797fdacc9298ce69f407265bc5afb|print("Hi!")
  30. ]
  31. id |fl| hs | code
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement