about summary refs log tree commit diff
path: root/elf/Makefile
diff options
context:
space:
mode:
authorRoland McGrath <roland@hack.frob.com>2012-04-30 15:00:14 -0700
committerRoland McGrath <roland@hack.frob.com>2012-05-01 13:27:11 -0700
commit82a79e7d1843f9d90075a0bf2f04557040829bb0 (patch)
tree063a8edbad83c421ddc11bd1b1238143378eb900 /elf/Makefile
parent615605c94eb3238fa1a0721506d70871f1610967 (diff)
downloadglibc-82a79e7d1843f9d90075a0bf2f04557040829bb0.tar.gz
glibc-82a79e7d1843f9d90075a0bf2f04557040829bb0.tar.xz
glibc-82a79e7d1843f9d90075a0bf2f04557040829bb0.zip
Do check-textrel test using readelf rather than a build-time C program.
Diffstat (limited to 'elf/Makefile')
-rw-r--r--elf/Makefile27
1 files changed, 16 insertions, 11 deletions
diff --git a/elf/Makefile b/elf/Makefile
index 32d113ea30..50934be71b 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -872,10 +872,6 @@ CFLAGS-tst-pie1.c += $(pie-ccflag)
 
 $(objpfx)tst-pie1: $(objpfx)tst-piemod1.so
 
-check-textrel-CFLAGS = -O -Wall -D_XOPEN_SOURCE=600 -D_BSD_SOURCE
-$(objpfx)check-textrel: check-textrel.c
-	$(native-compile)
-
 check-execstack-CFLAGS = -O -Wall -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -std=gnu99 \
 			 $(objpfx:%/=-I%)
 $(objpfx)check-execstack: check-execstack.c $(objpfx)check-execstack.h
@@ -895,14 +891,23 @@ $(objpfx)check-localplt: check-localplt.c
 ifeq (yes,$(build-shared))
 tests: $(objpfx)check-textrel.out $(objpfx)check-execstack.out
 
-all-built-dso = $(common-objpfx)libc.so \
-		$(filter-out $(common-objpfx)linkobj/libc.so, \
-			     $(sort $(wildcard $(common-objpfx)*/lib*.so \
-					       $(common-objpfx)iconvdata/*.so)))
+all-built-dso := $(common-objpfx)libc.so \
+		 $(filter-out $(common-objpfx)linkobj/libc.so, \
+			      $(sort $(wildcard $(addprefix $(common-objpfx), \
+							    */lib*.so \
+							    iconvdata/*.so))))
 
-$(objpfx)check-textrel.out: $(objpfx)check-textrel $(all-built-dso)
-	$(dir $<)$(notdir $<) $(filter-out $<, $^) > $@
-generated += check-textrel check-textrel.out
+$(all-built-dso:=.dyn): %.dyn: %
+	@rm -f $@T
+	LC_ALL=C $(READELF) -W -d $< > $@T
+	test -s $@T
+	mv -f $@T $@
+generated += $(all-built-dso:=.dyn)
+
+$(objpfx)check-textrel.out: $(..)scripts/check-textrel.awk \
+			    $(all-built-dso:=.dyn)
+	LC_ALL=C $(AWK) -f $^ > $@
+generated += check-textrel.out
 
 $(objpfx)check-execstack.out: $(objpfx)check-execstack $(all-built-dso)
 	$(dir $<)$(notdir $<) $(filter-out $<, $^) > $@