Skip to content

Comments

Dynamic Link Walking (Linux only)#104

Draft
Ex-32 wants to merge 2 commits intocharmoniumQ:mainfrom
Ex-32:dyn-link-walk
Draft

Dynamic Link Walking (Linux only)#104
Ex-32 wants to merge 2 commits intocharmoniumQ:mainfrom
Ex-32:dyn-link-walk

Conversation

@Ex-32
Copy link
Collaborator

@Ex-32 Ex-32 commented Feb 19, 2025

Dynamic Link Walking

parsing ELF files, reading environment variables, and traversing the filesystem to produce a runtime link dependency tree before an executable is exec-ed

Approximate roadmap

  • ELF parsing
    • 64-bit
      • section table parsing
      • dynamic section parsing
      • dynamic string table parsing
      • program segment table parsing
      • interpreter segment parsing
    • 32-bit
      • section table parsing
      • dynamic section parsing
      • dynamic string table parsing
      • program segment table parsing
      • interpreter segment parsing
  • dependency searching
    • environment variable aggregation
    • RPATH and RUNPATH aggregation
    • RPATH and RUNPATH substitutions
    • filesystem traversal
  • recursive evaluation
    • propagate RPATH
  • cry about added overhead

@Ex-32 Ex-32 self-assigned this Feb 19, 2025
@Ex-32 Ex-32 changed the title Dynamic Link Walking **(Linux only)** Dynamic Link Walking (Linux only) Feb 19, 2025
@charmoniumQ
Copy link
Owner

This seems reasonable; hopefully the 64-bit logic is not too different than the 32-bit.

Regarding overhead, hopefully it's not too bad, since the loader will now have a warmed cache (we aren't loading anything they wouldn't). Also, I am hoping to use statistics to separate the cost-per-exec vs cost-per-other-things.

@Ex-32
Copy link
Collaborator Author

Ex-32 commented Feb 22, 2025

hopefully the 64-bit logic is not too different than the 32-bit.

It shouldn't be: the structs and alignments are all different, but the fields are almost all the same, so like 90% of the work will probably be copy, paste, s/64/32/g

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants