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

Implment ld.so-like search procedure for shared objects #448

Open
langston-barrett opened this issue Oct 10, 2024 · 3 comments
Open

Implment ld.so-like search procedure for shared objects #448

langston-barrett opened this issue Oct 10, 2024 · 3 comments

Comments

@langston-barrett
Copy link
Contributor

Macaw's current mechanism for resolving functions in shared libraries relies on having all of the shared libraries in a single directory. It would be nice to lift this restriction by implementing a library search procedure similar to the one described in man 8 ld.so. Then, tools based on Macaw could discover and load shared libraries as would be done by the actual system loader, without further user intervention.

@sauclovian-g
Copy link
Contributor

Beware that system loaders vary and you can also get into all kinds of subtle problems... not that there's necessarily a better solution. There's ldd(1) but traditionally it works by setting some environment variables and running the program, and that's not always acceptable. And it seems to be missing on macos. (Though some quick searching suggests the environment variables method does exist.)

@RyanGlScott
Copy link
Contributor

RyanGlScott commented Oct 16, 2024

Data.Macaw.Memory.ElfLoader.DynamicDependencies was ported from ambient-verifier, and the only reason why ambient-verifier requires all shared libraries to live in a single directory was because of engineering constraints, not because of deeper technical reasons. I agree that it would be nicer if it could be a little smarter.

I also agree with @sauclovian-g that it's unwise to try and make macaw's version quite as fully-featured as a system loader, as system loaders are rife with additional complexity that we likely do not want.

@sauclovian-g sauclovian-g changed the title Implment ld-like search procedure for shared objects Implment ld.so-like search procedure for shared objects Oct 16, 2024
@sauclovian-g
Copy link
Contributor

(sorry, I feel like maybe I shouldn't rename other people's issues, but that's been bugging me)

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

3 participants