+ kbuild-delay-object-file-renaming-during-module-versioning.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     kbuild: delay object file renaming during module versioning
has been added to the -mm tree.  Its filename is
     kbuild-delay-object-file-renaming-during-module-versioning.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

------------------------------------------------------
Subject: kbuild: delay object file renaming during module versioning
From: Peter Oberparleiter <peter.oberparleiter@xxxxxxxxxx>

Change module versioning to alter object file names only after compiling.

Required by the gcov profiling infrastructure: when compiling with option
-fprofile-arcs, gcc stores file names inside object files.  A name change
before compilation would prevent the gcov tool from finding the
corresponding source files.

Signed-off-by: Peter Oberparleiter <peter.oberparleiter@xxxxxxxxxx>
Cc: Sam Ravnborg <sam@xxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 scripts/Makefile.build |   25 ++++++++++---------------
 1 file changed, 10 insertions(+), 15 deletions(-)

diff -puN scripts/Makefile.build~kbuild-delay-object-file-renaming-during-module-versioning scripts/Makefile.build
--- a/scripts/Makefile.build~kbuild-delay-object-file-renaming-during-module-versioning
+++ a/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
 
_

Patches currently in -mm which might be from peter.oberparleiter@xxxxxxxxxx are

linux-next.patch
kernel-call-constructors.patch
kernel-introduce-gcc_version_lower-macro.patch
kbuild-delay-object-file-renaming-during-module-versioning.patch
seq_file-add-function-to-write-binary-data.patch
gcov-add-gcov-profiling-infrastructure.patch
kbuild-make-source-and-include-paths-absolute.patch
gcov-architecture-specific-compile-flag-adjustments.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux