hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/arch/x86/boot/compressed/vmlinux.lds.S
....@@ -1,7 +1,7 @@
11 /* SPDX-License-Identifier: GPL-2.0 */
22 #include <asm-generic/vmlinux.lds.h>
33
4
-OUTPUT_FORMAT(CONFIG_OUTPUT_FORMAT, CONFIG_OUTPUT_FORMAT, CONFIG_OUTPUT_FORMAT)
4
+OUTPUT_FORMAT(CONFIG_OUTPUT_FORMAT)
55
66 #undef i386
77
....@@ -42,16 +42,11 @@
4242 *(.rodata.*)
4343 _erodata = . ;
4444 }
45
- .got : {
46
- _got = .;
47
- KEEP(*(.got.plt))
48
- KEEP(*(.got))
49
- _egot = .;
50
- }
5145 .data : {
5246 _data = . ;
5347 *(.data)
5448 *(.data.*)
49
+ *(.bss.efistub)
5550 _edata = . ;
5651 }
5752 . = ALIGN(L1_CACHE_BYTES);
....@@ -73,4 +68,50 @@
7368 #endif
7469 . = ALIGN(PAGE_SIZE); /* keep ZO size page aligned */
7570 _end = .;
71
+
72
+ STABS_DEBUG
73
+ DWARF_DEBUG
74
+ ELF_DETAILS
75
+
76
+ DISCARDS
77
+ /DISCARD/ : {
78
+ *(.dynamic) *(.dynsym) *(.dynstr) *(.dynbss)
79
+ *(.hash) *(.gnu.hash)
80
+ *(.note.*)
81
+ }
82
+
83
+ .got.plt (INFO) : {
84
+ *(.got.plt)
85
+ }
86
+ ASSERT(SIZEOF(.got.plt) == 0 ||
87
+#ifdef CONFIG_X86_64
88
+ SIZEOF(.got.plt) == 0x18,
89
+#else
90
+ SIZEOF(.got.plt) == 0xc,
91
+#endif
92
+ "Unexpected GOT/PLT entries detected!")
93
+
94
+ /*
95
+ * Sections that should stay zero sized, which is safer to
96
+ * explicitly check instead of blindly discarding.
97
+ */
98
+ .got : {
99
+ *(.got)
100
+ }
101
+ ASSERT(SIZEOF(.got) == 0, "Unexpected GOT entries detected!")
102
+
103
+ .plt : {
104
+ *(.plt) *(.plt.*)
105
+ }
106
+ ASSERT(SIZEOF(.plt) == 0, "Unexpected run-time procedure linkages detected!")
107
+
108
+ .rel.dyn : {
109
+ *(.rel.*) *(.rel_*)
110
+ }
111
+ ASSERT(SIZEOF(.rel.dyn) == 0, "Unexpected run-time relocations (.rel) detected!")
112
+
113
+ .rela.dyn : {
114
+ *(.rela.*) *(.rela_*)
115
+ }
116
+ ASSERT(SIZEOF(.rela.dyn) == 0, "Unexpected run-time relocations (.rela) detected!")
76117 }