From 4f1a658f899a169e702b1c7146b59f7c04b0338b Mon Sep 17 00:00:00 2001 From: Yann Gautier Date: Tue, 26 Oct 2021 18:13:22 +0200 Subject: [PATCH] fix(pie): do not skip __RW_END__ address during relocation In fixup_gdt_reloc(), do not skip the last address (__RW_END__) for dynamic relocations. Else, the invalidation of the data done under _init_c_runtime in el3_entrypoint_common macro will not be correct. Signed-off-by: Yann Gautier Change-Id: I1166a59ac964ec8ad4e099cb3600e843afc71d82 --- lib/aarch32/misc_helpers.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/aarch32/misc_helpers.S b/lib/aarch32/misc_helpers.S index 8b16f93cc..59e15bd1c 100644 --- a/lib/aarch32/misc_helpers.S +++ b/lib/aarch32/misc_helpers.S @@ -301,9 +301,9 @@ func fixup_gdt_reloc cmp r4, r6 blo 2f - /* Skip adding offset if address is >= upper limit */ + /* Skip adding offset if address is > upper limit */ cmp r4, r7 - bhs 2f + bhi 2f add r4, r0, r4 str r4, [r3]