This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.21-69-g04f5a63


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  04f5a636b6ac79677967d901a956f336a7ccfee3 (commit)
      from  87a629c5d7aa559e5c144196bce123469b17af4c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=04f5a636b6ac79677967d901a956f336a7ccfee3

commit 04f5a636b6ac79677967d901a956f336a7ccfee3
Author: Roland McGrath <roland@hack.frob.com>
Date:   Thu Feb 12 13:38:47 2015 -0800

    Support after-link variable to run a final step on binaries.

diff --git a/ChangeLog b/ChangeLog
index 986554f..bd06443 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2015-02-12  Roland McGrath  <roland@hack.frob.com>
+
+	* Makeconfig (after-link): New variable.
+	(+link-pie, +link-pie-tests): Use it.
+	(+link-static, +link-static-tests): Likewise.
+	(+link, +link-tests): Likewise.
+	* Makerules (build-module, build-module-asneeded): Likewise.
+	(lib%.so, $(common-objpfx)libc.so, $(common-objpfx)linkobj/libc.so):
+	Likewise.
+	* elf/Makefile ($(objpfx)ld.so): Likewise.
+
 2015-02-12  Rüdiger Sonderfeld  <ruediger@c-plusplus.net>
 
 	[BZ #17965]
diff --git a/Makeconfig b/Makeconfig
index 751e9ff..1e03481 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -387,6 +387,14 @@ LDFLAGS.so += $(hashstyle-LDFLAGS)
 LDFLAGS-rtld += $(hashstyle-LDFLAGS)
 endif
 
+# Command to run after every final link (executable or shared object).
+# This is invoked with $(call after-link,...), so it should operate on
+# the file $1.  This can be set to do some sort of post-processing on
+# binaries, or to perform some sort of static sanity check.
+ifndef after-link
+after-link =
+endif
+
 # Command for linking PIE programs with the C library.
 ifndef +link-pie
 +link-pie-before-libc = $(CC) -pie -Wl,-O1 -nostdlib -nostartfiles -o $@ \
@@ -400,10 +408,15 @@ ifndef +link-pie
 			  $(common-objpfx)libc% $(+postinit),$^) \
 	     $(link-extra-libs)
 +link-pie-after-libc = $(+postctorS) $(+postinit)
-+link-pie = $(+link-pie-before-libc) $(rtld-LDFLAGS) $(link-libc) \
-	    $(+link-pie-after-libc)
-+link-pie-tests = $(+link-pie-before-libc) $(rtld-tests-LDFLAGS) \
-		  $(link-libc-tests) $(+link-pie-after-libc)
+define +link-pie
+$(+link-pie-before-libc) $(rtld-LDFLAGS) $(link-libc) $(+link-pie-after-libc)
+$(call after-link,$@)
+endef
+define +link-pie-tests
+$(+link-pie-before-libc) $(rtld-tests-LDFLAGS) $(link-libc-tests) \
+			 $(+link-pie-after-libc)
+$(call after-link,$@)
+endef
 endif
 # Command for statically linking programs with the C library.
 ifndef +link-static
@@ -417,10 +430,14 @@ ifndef +link-static
 			   $(common-objpfx)libc% $(+postinit),$^) \
 	      $(link-extra-libs-static)
 +link-static-after-libc = $(+postctorT) $(+postinit)
-+link-static = $(+link-static-before-libc) $(link-libc-static) \
-	       $(+link-static-after-libc)
-+link-static-tests = $(+link-static-before-libc) $(link-libc-static-tests) \
-		     $(+link-static-after-libc)
+define +link-static
+$(+link-static-before-libc) $(link-libc-static) $(+link-static-after-libc)
+$(call after-link,$@)
+endef
+define +link-static-tests
+$(+link-static-before-libc) $(link-libc-static-tests) $(+link-static-after-libc)
+$(call after-link,$@)
+endef
 endif
 # Commands for linking programs with the C library.
 ifndef +link
@@ -436,10 +453,15 @@ ifeq (yes,$(build-shared))
 			   $(common-objpfx)libc% $(+postinit),$^) \
 	      $(link-extra-libs)
 +link-after-libc = $(+postctor) $(+postinit)
-+link = $(+link-before-libc) $(rtld-LDFLAGS) $(link-libc) \
-	$(+link-after-libc)
-+link-tests = $(+link-before-libc) $(rtld-tests-LDFLAGS) \
-	      $(link-libc-tests) $(+link-after-libc)
+define +link
+$(+link-before-libc) $(rtld-LDFLAGS) $(link-libc) $(+link-after-libc)
+$(call after-link,$@)
+endef
+define +link-tests
+$(+link-before-libc) $(rtld-tests-LDFLAGS) $(link-libc-tests) \
+		     $(+link-after-libc)
+$(call after-link,$@)
+endef
 else
 +link = $(+link-static)
 +link-tests = $(+link-static-tests)
diff --git a/Makerules b/Makerules
index ca238f1..c79915f 100644
--- a/Makerules
+++ b/Makerules
@@ -505,6 +505,7 @@ link-libc-deps = $(common-objpfx)libc.so $(common-objpfx)linkobj/libc.so \
 # to be as similar as possible to a default link with an installed libc.
 lib%.so: lib%_pic.a $(+preinit) $(+postinit) $(link-libc-deps)
 	$(build-shlib) $(link-libc-args)
+	$(call after-link,$@)
 
 define build-shlib-helper
 $(LINK.o) -shared $(static-libgcc) -Wl,-O1 $(sysdep-LDFLAGS) \
@@ -580,12 +581,14 @@ endef
 define build-module
 $(build-module-helper) -o $@ $(shlib-lds-flags) \
 	  $(csu-objpfx)abi-note.o $(build-module-objlist) $(link-libc-args)
+$(call after-link,$@)
 endef
 define build-module-asneeded
 $(build-module-helper) -o $@ $(shlib-lds-flags) \
 	  $(csu-objpfx)abi-note.o \
 	  -Wl,--as-needed $(build-module-objlist) -Wl,--no-as-needed \
 	  $(link-libc-args)
+$(call after-link,$@)
 endef
 
 build-module-helper-objlist = \
@@ -666,6 +669,7 @@ $(common-objpfx)libc.so: $(elf-objpfx)soinit.os \
 			 $(elf-objpfx)ld.so \
 			 $(shlib-lds)
 	$(build-shlib)
+	$(call after-link,$@)
 
 $(common-objpfx)linkobj/libc.so: $(elf-objpfx)soinit.os \
 			 $(common-objpfx)linkobj/libc_pic.a \
@@ -674,6 +678,7 @@ $(common-objpfx)linkobj/libc.so: $(elf-objpfx)soinit.os \
 			 $(elf-objpfx)ld.so \
 			 $(shlib-lds)
 	$(build-shlib)
+	$(call after-link,$@)
 
 ifeq ($(build-shared),yes)
 $(common-objpfx)libc.so: $(common-objpfx)libc.map
diff --git a/elf/Makefile b/elf/Makefile
index f2d1781..b43b48e 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -349,6 +349,7 @@ $(objpfx)ld.so: $(objpfx)librtld.os $(ld-map)
 		  $(filter-out $(map-file),$^) $(load-map-file)		\
 		  -Wl,-soname=$(rtld-installed-name)			\
 		  -Wl,-defsym=_begin=0
+	$(call after-link,$@.new)
 	$(READELF) -s $@.new \
 	  | $(AWK) '($$7 ~ /^UND(|EF)$$/ && $$1 != "0:" && $$4 != "REGISTER") { print; p=1 } END { exit p != 0 }'
 	mv -f $@.new $@

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog    |   11 +++++++++++
 Makeconfig   |   46 ++++++++++++++++++++++++++++++++++------------
 Makerules    |    5 +++++
 elf/Makefile |    1 +
 4 files changed, 51 insertions(+), 12 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]