kern: Support older SVC ABIs

This commit is contained in:
Michael Scire 2020-07-13 18:50:37 -07:00 committed by SciresM
parent 3d2eb8e903
commit ff022115ca
7 changed files with 94 additions and 21 deletions

View file

@ -318,6 +318,8 @@ namespace ams::kern::init::loader {
Elf::ApplyRelocations(GetInteger(virtual_base_address), kernel_dynamic);
/* Call the kernel's init array functions. */
/* NOTE: The kernel does this after reprotecting .rodata, but we do it before. */
/* This allows our global constructors to edit .rodata, which is valuable for editing the SVC tables to support older firmwares' ABIs. */
Elf::CallInitArrayFuncs(GetInteger(virtual_base_address) + init_array_offset, GetInteger(virtual_base_address) + init_array_end_offset);
/* Reprotect .rodata as R-- */