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

Debugging failures during elf loading #340

Open
christian-herber-nxp opened this issue Dec 10, 2024 · 1 comment
Open

Debugging failures during elf loading #340

christian-herber-nxp opened this issue Dec 10, 2024 · 1 comment

Comments

@christian-herber-nxp
Copy link

I am currently facing a fail during loading of an elf file, and I have a hard time understanding what the issue could be.
In general, slightly more explicit error messages would be nice, but for that one has to understand the code.
My error is thrown on that condition in pk/elf.c:

size_t phdr_size = eh.e_phnum * sizeof(Elf_Phdr);
if (phdr_size > info->phdr_size)

I would appreciate if somebody has input as to what this indicates.

@aswaterman
Copy link
Collaborator

There's a data structure that holds the program headers and is statically sized:

static long phdrs[128]; // avoid large stack allocation

You could probably increase it without consequence. But I agree the error message could be clearer in this case, since this error is not about a malformed ELF, but about a pk constraint.

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

2 participants