From: Ye Bin
ohos inclusion
category: feature
feature: ARM kaslr support
issue: #I3ZXZF
CVE: NA
-------------------------------------------------
If we not hide the GOT, when insert module which reference global
variable we got error "Unknown symbol_GLOBAL_OFFSET_TABLE_ (err 0)".
Signed-off-by: Ye Bin
Reviewed-by: Jing Xiangfeng
Signed-off-by: zhangyi (F)
Signed-off-by: Cui GaoSheng
Reviewed-by: Xiu Jianfeng
Signed-off-by: Chen Jun
Signed-off-by: Yu Changchun
---
arch/arm/boot/compressed/decompress.c | 4 ++++
arch/arm/boot/compressed/misc.c | 3 +++
2 files changed, 7 insertions(+)
diff --git a/arch/arm/boot/compressed/decompress.c b/arch/arm/boot/compressed/decompress.c
index aa075d8372ea..38a5dd847e03 100644
--- a/arch/arm/boot/compressed/decompress.c
+++ b/arch/arm/boot/compressed/decompress.c
@@ -1,6 +1,10 @@
// SPDX-License-Identifier: GPL-2.0
#define _LINUX_STRING_H_
+#ifdef CONFIG_RANDOMIZE_BASE
+#pragma GCC visibility pop
+#endif
+
#include /* for inline */
#include /* for size_t */
#include /* for NULL */
diff --git a/arch/arm/boot/compressed/misc.c b/arch/arm/boot/compressed/misc.c
index e1e9a5dde853..974a08df7c7a 100644
--- a/arch/arm/boot/compressed/misc.c
+++ b/arch/arm/boot/compressed/misc.c
@@ -16,6 +16,9 @@
* which should point to addresses in RAM and cleared to 0 on start.
* This allows for a much quicker boot time.
*/
+#ifdef CONFIG_RANDOMIZE_BASE
+#pragma GCC visibility pop
+#endif
unsigned int __machine_arch_type;
--
2.22.0