Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

i386: Put allocated ELF notes in read-only data segment

This changes the i386 linker script and the asm-generic macro it uses so that
ELF note sections with SHF_ALLOC set are linked into the kernel image along
with other read-only data. The PT_NOTE also points to their location.

This paves the way for putting useful build-time information into ELF notes
that can be found easily later in a kernel memory dump.

Signed-off-by: Roland McGrath <roland@redhat.com>
Cc: Andi Kleen <ak@suse.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Roland McGrath and committed by
Linus Torvalds
cbe87121 b38bd33a

+8 -4
+3 -3
arch/i386/kernel/vmlinux.lds.S
··· 60 60 __stop___ex_table = .; 61 61 } 62 62 63 - BUG_TABLE 63 + NOTES :text :note 64 + 65 + BUG_TABLE :text 64 66 65 67 . = ALIGN(4); 66 68 .tracedata : AT(ADDR(.tracedata) - LOAD_OFFSET) { ··· 210 208 STABS_DEBUG 211 209 212 210 DWARF_DEBUG 213 - 214 - NOTES 215 211 }
+5 -1
include/asm-generic/vmlinux.lds.h
··· 224 224 } 225 225 226 226 #define NOTES \ 227 - .notes : { *(.note.*) } :note 227 + .notes : AT(ADDR(.notes) - LOAD_OFFSET) { \ 228 + VMLINUX_SYMBOL(__start_notes) = .; \ 229 + *(.note.*) \ 230 + VMLINUX_SYMBOL(__stop_notes) = .; \ 231 + } 228 232 229 233 #define INITCALLS \ 230 234 *(.initcall0.init) \