lkml.org 
[lkml]   [2020]   [Nov]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] arm64: Change the location of DISCARDS
Date
In the include/asm-generic/vmlinux.lds.h file, the "must be the last"
comment indicates that DISCARDS should be placed in the last position
of SECTIONS, like x86, mips, riscv, etc.

Signed-off-by: Youling Tang <tangyouling@loongson.cn>
---
arch/arm64/kernel/vmlinux.lds.S | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S
index 1bda604..bf31074 100644
--- a/arch/arm64/kernel/vmlinux.lds.S
+++ b/arch/arm64/kernel/vmlinux.lds.S
@@ -109,12 +109,6 @@ SECTIONS
* matching the same input section name. There is no documented
* order of matching.
*/
- DISCARDS
- /DISCARD/ : {
- *(.interp .dynamic)
- *(.dynsym .dynstr .hash .gnu.hash)
- }
-
. = KIMAGE_VADDR;

.head.text : {
@@ -284,6 +278,13 @@ SECTIONS

.data.rel.ro : { *(.data.rel.ro) }
ASSERT(SIZEOF(.data.rel.ro) == 0, "Unexpected RELRO detected!")
+
+ /* Sections to be discarded */
+ DISCARDS
+ /DISCARD/ : {
+ *(.interp .dynamic)
+ *(.dynsym .dynstr .hash .gnu.hash)
+ }
}

#include "image-vars.h"
--
2.1.0
\
 
 \ /
  Last update: 2020-11-04 11:49    [W:0.075 / U:0.264 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site