firmware: Use lla to access all global symbols

When OpenSBI is compiled as fPIE mode, the assembler will translate "la"
to GOT reference pattern. It will cause to cost an additional load
instruction when obtaining the symbol address. However, if the symbol
locates within the positive or negative 2GB region, we can use "lla"
instead of "la" to avoid unneeded GOT references. This patch assumes that
the OpenSBI image excluding the payload does not exceed 2GB. Based on
this assumption, all "la" instructions are replaced by "lla" to avoid
performance degradation when compiling as fPIE mode.

Signed-off-by: Vincent Chen <vincent.chen@sifive.com>
Reviewed-by: Anup Patel <anup.patel@wdc.com>
This commit is contained in:
Vincent Chen
2021-03-17 09:16:37 +08:00
committed by Anup Patel
parent ff5bd949d5
commit 22d8ee9758
5 changed files with 64 additions and 64 deletions

View File

@@ -59,7 +59,7 @@ fw_next_arg1:
* The next address should be returned in 'a0'.
*/
fw_next_addr:
la a0, payload_bin
lla a0, payload_bin
ret
.section .entry, "ax", %progbits