From: Ye Bin
maillist inclusion
from mainline-v5.7-rc1
commit 32830a0534700f86366f371b150b17f0f0d140d7
category: bugfix
issue: #I3ZXZF
CVE: NA
------------------------------------------------------------------------
Fix follow warnings:
arm-linux-gnueabihf-ld: warning: orphan section `.data.rel.local' from
`net/sunrpc/xprt.o' being placed in section `.data.rel.local'.
......
arm-linux-gnueabihf-ld: warning: orphan section `.got.plt' from
`arch/arm/kernel/head.o' being placed in section `.got.plt'.
arm-linux-gnueabihf-ld: warning: orphan section `.plt' from
`arch/arm/kernel/head.o' being placed in section `.plt'.
arm-linux-gnueabihf-ld: warning: orphan section `.data.rel.ro' from
`arch/arm/kernel/head.o' being placed in section `.data.rel.ro'.
......
Fixes:("ARM: kernel: make vmlinux buildable as a PIE executable")
Signed-off-by: Ye Bin
Signed-off-by: Cui GaoSheng
Reviewed-by: Xiu Jianfeng
Signed-off-by: Chen Jun
Signed-off-by: Yu Changchun
---
arch/arm/boot/compressed/kaslr.c | 4 +++-
arch/arm/include/asm/vmlinux.lds.h | 3 ++-
arch/arm/kernel/vmlinux.lds.S | 11 ++++++++++-
3 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/arch/arm/boot/compressed/kaslr.c b/arch/arm/boot/compressed/kaslr.c
index 6ac666f3d8be..6a4c60b22908 100644
--- a/arch/arm/boot/compressed/kaslr.c
+++ b/arch/arm/boot/compressed/kaslr.c
@@ -12,7 +12,7 @@
#include
#include
#include
-#include
+#include
#include CONFIG_UNCOMPRESS_INCLUDE
@@ -64,9 +64,11 @@ static u32 __memparse(const char *val, const char **retptr)
case 'g':
case 'G':
ret <<= 10;
+ /* fall through */
case 'm':
case 'M':
ret <<= 10;
+ /* fall through */
case 'k':
case 'K':
ret <<= 10;
diff --git a/arch/arm/include/asm/vmlinux.lds.h b/arch/arm/include/asm/vmlinux.lds.h
index 68e1fc0b7175..be04f5b5056f 100644
--- a/arch/arm/include/asm/vmlinux.lds.h
+++ b/arch/arm/include/asm/vmlinux.lds.h
@@ -62,7 +62,7 @@
*/
#define ARM_ASSERTS \
.plt : { \
- *(.iplt) *(.rel.iplt) *(.iplt) *(.igot.plt) \
+ *(.iplt) *(.rel.iplt) *(.iplt) *(.igot.plt) *(.plt) \
} \
ASSERT(SIZEOF(.plt) == 0, \
"Unexpected run-time procedure linkages detected!")
@@ -93,6 +93,7 @@
ARM_STUBS_TEXT \
. = ALIGN(4); \
*(.got) /* Global offset table */ \
+ *(.got.plt) \
ARM_CPU_KEEP(PROC_INFO)
/* Stack unwinding tables */
diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S
index 262ba776d32d..1a9849968ce6 100644
--- a/arch/arm/kernel/vmlinux.lds.S
+++ b/arch/arm/kernel/vmlinux.lds.S
@@ -117,7 +117,7 @@ SECTIONS
#endif
.rel.dyn : ALIGN(8) {
__rel_begin = .;
- *(.rel .rel.* .rel.dyn)
+ *(.rel .rel.* .rel.dyn .rel*)
}
__rel_end = ADDR(.rel.dyn) + SIZEOF(.rel.dyn);
@@ -150,6 +150,15 @@ SECTIONS
_sdata = .;
RW_DATA(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE)
+
+ .data.rel.local : {
+ *(.data.rel.local)
+ }
+
+ .data.rel.ro : {
+ *(.data.rel.ro)
+ }
+
_edata = .;
BSS_SECTION(0, 0, 0)
--
2.22.0