Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"statically" link libs and deps into prybar binary #42

Open
turbio opened this issue Jan 2, 2020 · 0 comments
Open

"statically" link libs and deps into prybar binary #42

turbio opened this issue Jan 2, 2020 · 0 comments

Comments

@turbio
Copy link
Contributor

turbio commented Jan 2, 2020

Right now prybar links with the system's libraries and depends on the system having all the language's dependencies. Python for example requires (ignoring common system libs) /usr/lib/libpython3.8.so, /usr/bin/lib/python3.8/..., and /usr/lib/python3.8/... to be present at runtime. This makes prybar non portable between systems without installing the language's libs at the correct version system wide.

These shared libs come in two forms: shared objects loaded by the elf interpreter and shared resources loaded by the language interpreter. My proposed solution:

  • interpreters often don't provide statically linkable objects
    • we bundle all the SOs (not libc) into the elf and have the loader prefer those
  • languages have resources sprinkled across the system
    • we embed all the resources into the elf and do some libc patching to redirect io on these files to the embedded files.

There are already some projects out there that'll make embedding pretty easy.

It's a bit unclear where to draw the line on what gets packed into the binary. Putting the language's entire standard library into the binary would make it super portable but perhaps too big.

@turbio turbio added boop and removed boop labels Jan 2, 2020
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

No branches or pull requests

1 participant