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

llext: Addressable ELF loading #63538

Closed
teburd opened this issue Oct 4, 2023 · 2 comments
Closed

llext: Addressable ELF loading #63538

teburd opened this issue Oct 4, 2023 · 2 comments
Assignees
Labels
area: llext Linkable Loadable Extensions Enhancement Changes/Updates/Additions to existing features

Comments

@teburd
Copy link
Collaborator

teburd commented Oct 4, 2023

Is your enhancement proposal related to a problem? Please describe.
Currently llext assumes a non-addressable source of an ELF, e.g. i2c flash, which may be copied from given a specific location. This causes a lot of unnecessary allocations for addressable ELF data.

Describe the solution you'd like
While sections themselves have different requirements and perhaps could be seen in #63535 for
getting elf metadata perhaps some function pointers would suffice.

struct llext_loader {
   int (*get_ehdr)(struct llext_loader *ldr, elf_ehdr_t **ehdr);
   int (*get_shdr)(struct llext_loader *ldr, size_t idx, elf_shdr_t **shdr);
}

This way each loader can decide how to best get a reference to some particular metadata rather than
forcing a file I/O like API on top of a buffer, we can assign the pointer value to where it is in the buffer. For non-addressable elf loaders custom logic can copy and cache and return a pointer as is done now.

Describe alternatives you've considered
A peek function like #62433 also works, but I think having metadata accessors is nicer for the elf portion and hopefully creates single functions for things like looking up a section or symbol name. I could be wrong though and need to experiment a bit.

@teburd teburd added the Enhancement Changes/Updates/Additions to existing features label Oct 4, 2023
@teburd
Copy link
Collaborator Author

teburd commented Oct 4, 2023

@lyakh @pillo79

@teburd teburd added the area: llext Linkable Loadable Extensions label Oct 4, 2023
@teburd teburd self-assigned this Oct 4, 2023
@teburd
Copy link
Collaborator Author

teburd commented Jan 26, 2024

This has been solved with the the peek interface and WRITABLE kconfig

@teburd teburd closed this as completed Jan 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: llext Linkable Loadable Extensions Enhancement Changes/Updates/Additions to existing features
Projects
None yet
Development

No branches or pull requests

1 participant