kern/ldr: enable the use of relr for relocations

This commit is contained in:
Michael Scire 2024-09-01 22:27:48 -07:00
parent 423a05a1e9
commit 027e209073
6 changed files with 17 additions and 13 deletions

View file

@ -15,8 +15,8 @@
*/
#include <mesosphere.hpp>
extern "C" void _start();
extern "C" void __end__();
extern "C" void __bin_start__();
extern "C" void __bin_end__();
namespace ams::kern {
@ -264,8 +264,8 @@ namespace ams::kern::init {
KMemoryLayout::GetPhysicalMemoryRegionTree().InsertDirectly(KernelPhysicalAddressSpaceBase, KernelPhysicalAddressSpaceBase + KernelPhysicalAddressSpaceSize - 1);
/* Save start and end for ease of use. */
const uintptr_t code_start_virt_addr = reinterpret_cast<uintptr_t>(_start);
const uintptr_t code_end_virt_addr = reinterpret_cast<uintptr_t>(__end__);
const uintptr_t code_start_virt_addr = reinterpret_cast<uintptr_t>(__bin_start__);
const uintptr_t code_end_virt_addr = reinterpret_cast<uintptr_t>(__bin_end__);
/* Setup the containing kernel region. */
constexpr size_t KernelRegionSize = 1_GB;