diff options
author | Vincent Chen <vincent.chen@sifive.com> | 2021-03-17 09:16:38 +0800 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2021-03-19 15:00:50 +0530 |
commit | 0f20e8adcf42d31bc478d6700b625d00a68cb30e (patch) | |
tree | e2968cd11e015d47ce8062c0a9b4aa0e00dbc3d0 /firmware/fw_base.ldS | |
parent | 22d8ee9758128070aa838f7c8c46f9e50d6aaf5a (diff) |
firmware: Support position independent execution
Enable OpenSBI to support position independent execution. Because the
position independent code will cause an additional GOT reference when
accessing the global variables, it will reduce performance a bit. Therefore,
the position independent execution is disabled by default. Users can
through specifying "FW_PIC=y" on the make command to enable this feature.
In theory, after enabling position-independent execution, the OpenSBI
can run at arbitrary address with appropriate alignment. Therefore, the
original relocation mechanism will be skipped. In other words, OpenSBI will
directly run at the load address without any code movement.
Signed-off-by: Vincent Chen <vincent.chen@sifive.com>
Reviewed-by: Anup Patel <anup.patel@wdc.com>
Diffstat (limited to 'firmware/fw_base.ldS')
-rw-r--r-- | firmware/fw_base.ldS | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/firmware/fw_base.ldS b/firmware/fw_base.ldS index 0ac75f2..0d222da 100644 --- a/firmware/fw_base.ldS +++ b/firmware/fw_base.ldS @@ -61,6 +61,19 @@ PROVIDE(_data_end = .); } + .dynsym : { + PROVIDE(__dyn_sym_start = .); + *(.dynsym) + PROVIDE(__dyn_sym_end = .); + } + + .rela.dyn : { + PROVIDE(__rel_dyn_start = .); + *(.rela*) + . = ALIGN(8); + PROVIDE(__rel_dyn_end = .); + } + . = ALIGN(0x1000); /* Ensure next section is page aligned */ .bss : |