Skip to content

Commit

Permalink
i386: Put allocated ELF notes in read-only data segment
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Roland McGrath authored and Linus Torvalds committed Jul 19, 2007
1 parent b38bd33 commit cbe8712
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 3 additions & 3 deletions arch/i386/kernel/vmlinux.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ SECTIONS
__stop___ex_table = .;
}

BUG_TABLE
NOTES :text :note

BUG_TABLE :text

. = ALIGN(4);
.tracedata : AT(ADDR(.tracedata) - LOAD_OFFSET) {
Expand Down Expand Up @@ -208,6 +210,4 @@ SECTIONS
STABS_DEBUG

DWARF_DEBUG

NOTES
}
6 changes: 5 additions & 1 deletion include/asm-generic/vmlinux.lds.h
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,11 @@
}

#define NOTES \
.notes : { *(.note.*) } :note
.notes : AT(ADDR(.notes) - LOAD_OFFSET) { \
VMLINUX_SYMBOL(__start_notes) = .; \
*(.note.*) \
VMLINUX_SYMBOL(__stop_notes) = .; \
}

#define INITCALLS \
*(.initcall0.init) \
Expand Down

0 comments on commit cbe8712

Please sign in to comment.