aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuis R. Rodriguez <mcgrof@kernel.org>2016-05-25 17:26:14 -0700
committerLuis R. Rodriguez <mcgrof@kernel.org>2016-06-23 15:23:28 -0700
commit39173728ea2d352032bdc8fc17b453afd6a8375b (patch)
tree1a8880d15785874328bb26357bdfc3a80196d082
parent9443312e2eb6e82081cbcdd2e538c26229293223 (diff)
downloadlinker-tables-39173728ea2d352032bdc8fc17b453afd6a8375b.tar.gz
arch/x86/kernel/vmlinux.lds.S: map other Linux sections
This is just in case our demo uses them, we place them in functional equivalents, given we never free or do sanity checking, which is one of the ways the refs are used for. Signed-off-by: Luis R. Rodriguez <mcgrof@kernel.org>
-rw-r--r--arch/x86/kernel/vmlinux.lds.S5
-rw-r--r--include/linux/sections.h8
2 files changed, 12 insertions, 1 deletions
diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S
index adebf1e..e7378cc 100644
--- a/arch/x86/kernel/vmlinux.lds.S
+++ b/arch/x86/kernel/vmlinux.lds.S
@@ -64,6 +64,8 @@ SECTIONS
*(SORT(SECTION_TBL_ALL(SECTION_TEXT)))
*(SORT(SECTION_TBL_ALL(SECTION_INIT)))
*(SORT(SECTION_TBL_ALL(SECTION_INIT_CALL)))
+ *(SORT(SECTION_TBL_ALL(SECTION_EXIT)))
+ *(SORT(SECTION_TBL_ALL(SECTION_EXIT_CALL)))
*(.text .stub .text.* .gnu.linkonce.t.*)
/* .gnu.warning sections are handled specially by elf32.em. */
*(.gnu.warning)
@@ -81,6 +83,7 @@ SECTIONS
*(SORT(.rodata.*))
*(SORT(SECTION_TBL_ALL(SECTION_RODATA)))
*(SORT(SECTION_TBL_ALL(SECTION_INIT_RODATA)))
+ *(SORT(SECTION_TBL_ALL(SECTION_REF_RODATA)))
*(.gnu.linkonce.r.*)
}
.rodata1 : { *(.rodata1) }
@@ -161,6 +164,8 @@ SECTIONS
*(.data .data.* .gnu.linkonce.d.*)
*(SORT(SECTION_TBL_ALL(SECTION_DATA)))
*(SORT(SECTION_TBL_ALL(SECTION_INIT_DATA)))
+ *(SORT(SECTION_TBL_ALL(SECTION_REF_DATA)))
+ *(SORT(SECTION_TBL_ALL(SECTION_EXIT_DATA)))
SORT(CONSTRUCTORS)
}
.data1 : { *(.data1) }
diff --git a/include/linux/sections.h b/include/linux/sections.h
index d6f7a30..cdcfd56 100644
--- a/include/linux/sections.h
+++ b/include/linux/sections.h
@@ -2,12 +2,18 @@
#define _LINUX_SECTIONS_H
#define SECTION_RODATA .rodata
-#define SECTION_DATA .data
#define SECTION_TEXT .text
+#define SECTION_DATA .data
#define SECTION_INIT .init.text
#define SECTION_INIT_DATA .init.data
#define SECTION_INIT_RODATA .init.rodata
#define SECTION_INIT_CALL .initcall
+#define SECTION_EXIT .exit.text
+#define SECTION_EXIT_DATA .exit.data
+#define SECTION_EXIT_CALL .exitcall.exit
+#define SECTION_REF .ref.text
+#define SECTION_REF_DATA .ref.data
+#define SECTION_REF_RODATA .ref.rodata
#ifndef __ASSEMBLY__