summaryrefslogtreecommitdiff
path: root/arch/s390/boot/startup.c
diff options
context:
space:
mode:
authorAlexander Gordeev <agordeev@linux.ibm.com>2024-02-21 13:51:55 +0300
committerHeiko Carstens <hca@linux.ibm.com>2024-02-26 12:25:09 +0300
commit3334fda639cfa7bb27a457f85f4ce06d622e0511 (patch)
tree21cb04dd36f253d1b63c8100a311202565870eec /arch/s390/boot/startup.c
parenta795e5d2347def129734a7f247ac70339d50d8c2 (diff)
downloadlinux-3334fda639cfa7bb27a457f85f4ce06d622e0511.tar.xz
s390/boot: simplify GOT handling
The end of GOT is calculated dynamically on boot. The size of GOT is calculated on build from the start and end of GOT. Avoid both calculations and use the end of GOT directly. Acked-by: Sumanth Korikkar <sumanthk@linux.ibm.com> Acked-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Diffstat (limited to 'arch/s390/boot/startup.c')
-rw-r--r--arch/s390/boot/startup.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/arch/s390/boot/startup.c b/arch/s390/boot/startup.c
index cb0d89801c43..c1a758921b7a 100644
--- a/arch/s390/boot/startup.c
+++ b/arch/s390/boot/startup.c
@@ -221,11 +221,8 @@ static void kaslr_adjust_got(unsigned long offset)
* Even without -fPIE, Clang still uses a global offset table for some
* reason. Adjust the GOT entries.
*/
- for (entry = (u64 *)vmlinux.got_off;
- entry < (u64 *)(vmlinux.got_off + vmlinux.got_size);
- entry++) {
+ for (entry = (u64 *)vmlinux.got_start; entry < (u64 *)vmlinux.got_end; entry++)
*entry += offset;
- }
}
#endif
@@ -366,7 +363,8 @@ static void kaslr_adjust_vmlinux_info(unsigned long offset)
vmlinux.rela_dyn_end += offset;
vmlinux.dynsym_start += offset;
#else
- vmlinux.got_off += offset;
+ vmlinux.got_start += offset;
+ vmlinux.got_end += offset;
#endif
vmlinux.init_mm_off += offset;
vmlinux.swapper_pg_dir_off += offset;