mirror of
https://github.com/mmueller41/genode.git
synced 2026-01-21 20:42:56 +01:00
ldso: Make truly self relocatable
On Linux the linker can now be loaded at arbitrary addresses, this became necessary for newer kernel versions. The 'linux_arm' target is not supported. Issue #1728
This commit is contained in:
committed by
Christian Helmuth
parent
e74b53d5dd
commit
41b9f6bd03
@@ -20,12 +20,14 @@
|
||||
|
||||
/*
|
||||
* We cannot just include <semaphore.h> and <pthread.h> here
|
||||
* because this would impy the nested inclusion of a myriad
|
||||
* because this would imply the nested inclusion of a myriad
|
||||
* of Linux types and would pollute the namespace for everyone
|
||||
* who includes this header file. We want to cleanly separate
|
||||
* Genode from POSIX.
|
||||
*/
|
||||
|
||||
extern Genode::addr_t _context_area_start;
|
||||
|
||||
namespace Genode {
|
||||
|
||||
/**
|
||||
@@ -129,10 +131,11 @@ namespace Genode {
|
||||
* Thread-context area configuration.
|
||||
*
|
||||
* Please update platform-specific files after changing these
|
||||
* values, e.g., 'base-linux/src/platform/context_area.*.ld'.
|
||||
* functions, e.g., 'base-linux/src/ld/context_area.*.ld'.
|
||||
*/
|
||||
static constexpr addr_t context_area_virtual_base() {
|
||||
return 0x40000000UL; }
|
||||
static addr_t context_area_virtual_base() {
|
||||
return align_addr((addr_t)&_context_area_start, 20); }
|
||||
|
||||
static constexpr addr_t context_area_virtual_size() {
|
||||
return 0x10000000UL; }
|
||||
|
||||
|
||||
@@ -20,6 +20,9 @@ SECTIONS
|
||||
{
|
||||
. = 0x40000000;
|
||||
_context_area_start = .;
|
||||
.context_area : { . += 0x10000000; } : context_area
|
||||
_context_area_end = .;
|
||||
/*
|
||||
* Since Linux loads ldso page aligned, we align the context area after
|
||||
* loading to a 1 MiB boundary, therefore we reserve one MiB more here.
|
||||
*/
|
||||
.context_area : { . += 0x10100000; } : context_area
|
||||
}
|
||||
|
||||
@@ -16,5 +16,4 @@ SECTIONS
|
||||
. = 0x40000000;
|
||||
_context_area_start = .;
|
||||
.context_area : { . += 0x10000000; }
|
||||
_context_area_end = .;
|
||||
}
|
||||
|
||||
@@ -19,6 +19,12 @@
|
||||
|
||||
extern "C" int raw_write_str(const char *str);
|
||||
|
||||
/**
|
||||
* Define context area
|
||||
*/
|
||||
Genode::addr_t _context_area_start;
|
||||
|
||||
|
||||
enum { verbose_atexit = false };
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user