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

Bug: Elf relocation #32

Open
septag opened this issue Mar 7, 2019 · 2 comments
Open

Bug: Elf relocation #32

septag opened this issue Mar 7, 2019 · 2 comments

Comments

@septag
Copy link
Contributor

septag commented Mar 7, 2019

On linux (elf), when we define a new .section add assign some variables to it, the .state section data gets mangled.
I couldn't solve it yet, because I don't have enough knowledge on elf format and how the code accesses section data pointers.
But I suspect that there must a bug within cr_elf_validate_sections where we fetch the pointer to section's data.
For example, if we define a new variable:

__attribute__((section(".test"))) int test;

the .state data seems to be overwritten with zeros by 4 bytes
I may do more investigations and keep you posted

@fungos
Copy link
Owner

fungos commented Mar 9, 2019

This can be some alignment issue. The new section may have caused .state to misalign or something similar. It would be nice to add this case in our tests, testing that it is broken and then another time we can fix for real and make sure we cover this case.

Unfortunately I'll not have much time to help on this for some time, in the meantime, if you get it fixed it will be awesome!

@septag
Copy link
Contributor Author

septag commented Mar 17, 2019

Ok, I'll try to fix the issue
but my knowledge from ELF is lacking and the vague api documentation doesn't help either.

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