mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 10:27:35 +00:00
LibELF+Userland: Enable RELRO for all userland executables :^)
The dynamic loader will now mark RELRO segments read-only after performing relocations. This is pretty cool! Note that this only applies to main executables so far,. RELRO support for shared libraries will require some reorganizing of the dynamic loader.
This commit is contained in:
parent
0d3866e84c
commit
fa4c249425
4 changed files with 32 additions and 2 deletions
|
@ -102,6 +102,7 @@ private:
|
|||
bool is_tls_template() const { return type() == PT_TLS; }
|
||||
bool is_load() const { return type() == PT_LOAD; }
|
||||
bool is_dynamic() const { return type() == PT_DYNAMIC; }
|
||||
bool is_relro() const { return type() == PT_GNU_RELRO; }
|
||||
|
||||
private:
|
||||
Elf32_Phdr m_program_header; // Explicitly a copy of the PHDR in the image
|
||||
|
@ -145,6 +146,9 @@ private:
|
|||
VirtualAddress m_text_segment_load_address;
|
||||
size_t m_text_segment_size { 0 };
|
||||
|
||||
VirtualAddress m_relro_segment_address;
|
||||
size_t m_relro_segment_size { 0 };
|
||||
|
||||
VirtualAddress m_tls_segment_address;
|
||||
VirtualAddress m_dynamic_section_address;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue