lkml.org 
[lkml]   [2007]   [Jul]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 7/7] Use --build-id ld option
Date

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>
---
Makefile | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/Makefile b/Makefile
index 88b2252..1e11ceb 100644
--- a/Makefile
+++ b/Makefile
@@ -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,))
+LDFLAGS_MODULE += $(LDFLAGS_BUILD_ID)
+LDFLAGS_vmlinux += $(LDFLAGS_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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2007-07-11 21:09    [W:0.375 / U:1.716 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site