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

Refactor relocation loading to allow loading relocations from external sources #403

Open
twizmwazin opened this issue Jun 20, 2023 · 3 comments

Comments

@twizmwazin
Copy link
Member

Description

Currently relocations for elf and pe backends are only read from their own relocations directory. This design is not extensible and does not allow for more relocations to be added by external sources without changing the source of cle itself.

Alternatives

No response

Additional context

Allowing other programs to add relocations allows programs to develop custom relocations that might not be suitable for general use, or might prefer not to have to use a modified version of cle.

@rhelmot
Copy link
Member

rhelmot commented Jun 20, 2023

I don't think this is a concern - there are a limited number of ELF relocations. Once they are all supported, there is no more extension needed.

@twizmwazin
Copy link
Member Author

One other benefit to this that I neglected to mention is that by loading relocations as python objects rather than files on the filesystem, it would remove special configuration needed in pyinstaller downstream. Loading python code from the filesystem rather through python's standard import system is generally just a bad practice.

@rhelmot
Copy link
Member

rhelmot commented Jun 20, 2023

That can be solved by removing the autoimport stuff and just enumerating the imports.

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

No branches or pull requests

2 participants