-
Notifications
You must be signed in to change notification settings - Fork 1
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
Implement transitive eager relocation #20
Conversation
Apparently saying "closes #[issue]" (or other keywords) instead of "handles #[issues]" automatically will be closing the linked issue. Horrifying, but cool. |
do_pread(lib_fd, &curr_shdr, sizeof(Elf64_Shdr), | ||
lib_ehdr.e_shoff + i * sizeof(Elf64_Shdr)); | ||
|
||
if (curr_shdr.sh_type == SHT_SYMTAB) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is unlikely, or maybe impossible, but what if there are two sections of the same type (e.g. SHT-SYMTAB
)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cry For now, things will break horribly. I would need to see an actual example to try to understand what would happen practically. I'll need to read and see if it's possible to produce such a binary. I think this would be beyond the current PR, however. I will at least have a read around for now to see, and then update.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at the ELF specification 1, page 66 (Book III, page 1-2) suggests that there can only be one SHT_SYMTAB
, SHT_DYNSYM
, and SHT_DYNAMIC
(at least for now). I will also assume there can only be one section named .rela.plt
. Therefore it seems your original assumption is (currently) impossible. I added a comment saying as such in 344cce8.
Footnotes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Phew!
Please squash. |
We now gather all symbols to be relocated from all `so` libraries within a compartment, and perform eager relocation at map time. This means, primarily, that we handle each `so` file within a compartment the same, then perform a sweep to relocate required symbols after parsing and mapping. Other small changes: * Improve and add more `simple` tests, to test more specific functionality; * Some overall code refactoring; * Add `-Wextra`, and fix more warnings
344cce8
to
1c2d2c9
Compare
Squashed. |
We now gather all symbols to be relocated from all
so
libraries within a compartment, and perform eager relocation at map time. This means, primarily, that we handle eachso
file within a compartment the same, then perform a sweep to relocate required symbols after parsing and mapping. This closes #15.Other small changes:
simple
tests, to test more specific functionality;-Wextra
, and fix more warnings