aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>2007-07-19 04:48:40 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-19 13:04:48 -0400
commit18991197b4b588255ccabf472ebc84db7b66a19c (patch)
treeeb6b66df60951378072c9d6af99af153b7d6dd66 /Makefile
parentda1a679cde9b12d6e331f43d2d92a234f2d1f9b0 (diff)
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: 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>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile6
1 files changed, 6 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index ddbfcac299c1..eccb03b88b8d 100644
--- a/Makefile
+++ b/Makefile
@@ -514,6 +514,12 @@ CFLAGS += $(call cc-option,-Wdeclaration-after-statement,)
514# disable pointer signed / unsigned warnings in gcc 4.0 514# disable pointer signed / unsigned warnings in gcc 4.0
515CFLAGS += $(call cc-option,-Wno-pointer-sign,) 515CFLAGS += $(call cc-option,-Wno-pointer-sign,)
516 516
517# Use --build-id when available.
518LDFLAGS_BUILD_ID = $(patsubst -Wl$(comma)%,%,\
519 $(call ld-option, -Wl$(comma)--build-id,))
520LDFLAGS_MODULE += $(LDFLAGS_BUILD_ID)
521LDFLAGS_vmlinux += $(LDFLAGS_BUILD_ID)
522
517# Default kernel image to build when no specific target is given. 523# Default kernel image to build when no specific target is given.
518# KBUILD_IMAGE may be overruled on the command line or 524# KBUILD_IMAGE may be overruled on the command line or
519# set in the environment 525# set in the environment