Commit 18991197 authored by Roland McGrath's avatar Roland McGrath Committed by Linus Torvalds
Browse files

Use --build-id ld option

This change passes the --build-id when linking the kernel and when linking
modules, if ld supports it.  This is a new GNU ld option that synthesizes an
ELF note section inside the read-only data.  The note in this section contains
unique identifying bits called the "build ID", which are generated so as to be
different for any two linked ELF files that aren't identical.  The build ID
can be recovered from stripped files, memory dumps, etc.  and used to look up
the original program built, locate debuginfo or other details or history
associated with it.  For normal program linking, the compiler passes
--build-id to ld by default, but the option is needed when using ld directly
as we do.

Signed-off-by: default avatarRoland McGrath <>
Cc: Andi Kleen <>
Cc: Paul Mackerras <>
Cc: Benjamin Herrenschmidt <>
Cc: Richard Henderson <>
Cc: Ivan Kokshaysky <>
Cc: Martin Schwidefsky <>
Cc: Heiko Carstens <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent da1a679c
......@@ -514,6 +514,12 @@ CFLAGS += $(call cc-option,-Wdeclaration-after-statement,)
# disable pointer signed / unsigned warnings in gcc 4.0
CFLAGS += $(call cc-option,-Wno-pointer-sign,)
# Use --build-id when available.
LDFLAGS_BUILD_ID = $(patsubst -Wl$(comma)%,%,\
$(call ld-option, -Wl$(comma)--build-id,))
# Default kernel image to build when no specific target is given.
# KBUILD_IMAGE may be overruled on the command line or
# set in the environment
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment