diff options
author | Daniel Bertalan <dani@danielbertalan.dev> | 2022-03-13 08:30:34 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-05-01 12:42:01 +0200 |
commit | ed5f110b402bc6fa48ee4efbfcffd94f43a061f3 (patch) | |
tree | 7d84f66953799fbe2b6bfd641278242c14519f8c /Userland/Libraries | |
parent | 435a263998440ea880ef1d20b7d3f1c8fb8a5a10 (diff) | |
download | serenity-ed5f110b402bc6fa48ee4efbfcffd94f43a061f3.zip |
LibELF: Perform .relr.dyn relocations before .rel.dyn
IFUNC resolvers depend on the resolved function's address having been
relocated by the time they are called. This means that relative
relocations have to be done first.
The linker is kind enough to put R_*_RELATIVE before R_*_IRELATIVE in
.rel.dyn, but .relr.dyn contains relative relocations too.
Diffstat (limited to 'Userland/Libraries')
-rw-r--r-- | Userland/Libraries/LibELF/DynamicLoader.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibELF/DynamicLoader.cpp b/Userland/Libraries/LibELF/DynamicLoader.cpp index 63bad18311..6a78df5af5 100644 --- a/Userland/Libraries/LibELF/DynamicLoader.cpp +++ b/Userland/Libraries/LibELF/DynamicLoader.cpp @@ -197,9 +197,9 @@ void DynamicLoader::do_main_relocations() } }; + do_relr_relocations(); m_dynamic_object->relocation_section().for_each_relocation(do_single_relocation); m_dynamic_object->plt_relocation_section().for_each_relocation(do_single_relocation); - do_relr_relocations(); } Result<NonnullRefPtr<DynamicObject>, DlErrorMessage> DynamicLoader::load_stage_3(unsigned flags) |