lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <48442052.6080506@de.ibm.com>
Date:	Mon, 02 Jun 2008 18:31:14 +0200
From:	Peter Oberparleiter <peter.oberparleiter@...ibm.com>
To:	linux-kernel@...r.kernel.org
CC:	Sam Ravnborg <sam@...nborg.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Peter Oberparleiter <oberparleiter@...glemail.com>
Subject: [PATCH] kbuild: simplify module versioning procedure

This patch used to be part of the gcov patch set but is no longer
required. kbuild simplifications might still prove useful though.

--
From: Peter Oberparleiter <peter.oberparleiter@...ibm.com>

Simplify module version generation to remove duplicate definition of
cmd_cc_o_c build rule.

Signed-off-by: Peter Oberparleiter <peter.oberparleiter@...ibm.com>
---
 scripts/Makefile.build |   25 ++++++++++---------------
 1 files changed, 10 insertions(+), 15 deletions(-)

Index: linux-2.6.26-rc4/scripts/Makefile.build
===================================================================
--- linux-2.6.26-rc4.orig/scripts/Makefile.build
+++ linux-2.6.26-rc4/scripts/Makefile.build
@@ -165,26 +165,23 @@ $(obj)/%.symtypes : $(src)/%.c FORCE
 # (See cmd_cc_o_c + relevant part of rule_cc_o_c)
 
 quiet_cmd_cc_o_c = CC $(quiet_modtag)  $@
-
-ifndef CONFIG_MODVERSIONS
 cmd_cc_o_c = $(CC) $(c_flags) -c -o $@ $<
 
-else
-# When module versioning is enabled the following steps are executed:
-# o compile a .tmp_<file>.o from <file>.c
-# o if .tmp_<file>.o doesn't contain a __ksymtab version, i.e. does
-#   not export symbols, we just rename .tmp_<file>.o to <file>.o and
-#   are done.
-# o otherwise, we calculate symbol versions using the good old
-#   genksyms on the preprocessed source and postprocess them in a way
-#   that they are usable as a linker script
+ifdef CONFIG_MODVERSIONS
+# When module versioning is enabled the following steps are executed
+# in addition to compiling:
+# o if <file>.o doesn't contain a __ksymtab version, i.e. does
+#   not export symbols, we are done
+# o otherwise, we rename <file>.o into .tmp_<file.o> and calculate symbol
+#   versions using the good old genksyms on the preprocessed source and
+#   postprocess them in a way that they are usable as a linker script
 # o generate <file>.o from .tmp_<file>.o using the linker to
 #   replace the unresolved symbols __crc_exported_symbol with
 #   the actual value of the checksum generated by genksyms
 
-cmd_cc_o_c = $(CC) $(c_flags) -c -o $(@D)/.tmp_$(@F) $<
 cmd_modversions =							\
-	if $(OBJDUMP) -h $(@D)/.tmp_$(@F) | grep -q __ksymtab; then	\
+	if $(OBJDUMP) -h $@ | grep -q __ksymtab; then			\
+		mv -f $@ $(@D)/.tmp_$(@F);				\
 		$(CPP) -D__GENKSYMS__ $(c_flags) $<			\
 		| $(GENKSYMS) $(if $(KBUILD_SYMTYPES),			\
 			      -T $(@D)/$(@F:.o=.symtypes)) -a $(ARCH)	\
@@ -193,8 +190,6 @@ cmd_modversions =							\
 		$(LD) $(LDFLAGS) -r -o $@ $(@D)/.tmp_$(@F) 		\
 			-T $(@D)/.tmp_$(@F:.o=.ver);			\
 		rm -f $(@D)/.tmp_$(@F) $(@D)/.tmp_$(@F:.o=.ver);	\
-	else								\
-		mv -f $(@D)/.tmp_$(@F) $@;				\
 	fi;
 endif
 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ