A pure-Nim ELF loader for x86-64 systems
Find a file
2026-05-23 17:52:49 +05:30
src add: relocator+core: support for bionic-compiled shared objects 2026-05-23 17:52:49 +05:30
tests xxx: some benchmarking fun 2026-04-18 20:53:15 +05:30
.gitignore feat: initial commit 2026-04-11 14:40:08 +05:30
config.nims bump: nuzzle: 0.1.0 -> 0.1.1 2026-04-17 17:10:50 +05:30
neo.lock xxx: some benchmarking fun 2026-04-18 20:53:15 +05:30
neo.paths xxx: some benchmarking fun 2026-04-18 20:53:15 +05:30
neo.toml add: relocator+core: support for bionic-compiled shared objects 2026-05-23 17:52:49 +05:30
nim.cfg add: tests: more stuff 2026-04-16 21:53:09 +05:30
README.md add: relocator+core: support for bionic-compiled shared objects 2026-05-23 17:52:49 +05:30

elf_loader

This repo just has a tiny generic-ish ELF loader written entirely in Nim.

It doesn't aim to replace glibc's dlfcn entirely, rather just act as a generic loader for various different ELF variants on the same system (e.g loading a Bionic-compiled shared object on desktop GNU/Linux), regardless of compatibility, though this'll probably require a lot more work.

It does not depend on C library functions, but its underlying code (like the Nim runtime and external dependencies) do. That's a long-term goal to fix.

roadmap

  • map segments and stuff
  • open glibc
  • perform enough relocations to make it happy
  • call .init_array
  • basic calls like _exit work (calls that reach into glibc's internal state either don't work, or end up deadlocking, say, if they try messing with a futex)
  • some calls like open work, but crash and/or cause UB if they try setting errno (probably TLS work is required)
  • loading bionic shared objects on glibc linux
  • Proper TLS initialization (glibc-style)