summaryrefslogtreecommitdiff
path: root/sysdeps/x86/Makefile
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2015-11-10 12:27:24 -0800
committerH.J. Lu <hjl.tools@gmail.com>2015-11-10 12:27:24 -0800
commitfe534fe8980fa214c410e3661a4216e781073353 (patch)
tree5f576a346baf42247d8d575906ed6cb2cfac814e /sysdeps/x86/Makefile
parent685312298fcc5b24ed9700bcc43787d5f83553c5 (diff)
Add a test for prelink output
This test applies to i386 and x86_64 which set R_386_GLOB_DAT and R_X86_64_GLOB_DAT to ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA. [BZ #19178] * sysdeps/x86/Makefile (tests): Add tst-prelink. (tst-prelink-ENV): New. ($(objpfx)tst-prelink-conflict.out): Likewise. ($(objpfx)tst-prelink-cmp.out): Likewise. (tests-special): Add $(objpfx)tst-prelink-cmp.out. * sysdeps/x86/tst-prelink.c: New file. * sysdeps/x86/tst-prelink.exp: Likewise.
Diffstat (limited to 'sysdeps/x86/Makefile')
-rw-r--r--sysdeps/x86/Makefile15
1 files changed, 15 insertions, 0 deletions
diff --git a/sysdeps/x86/Makefile b/sysdeps/x86/Makefile
index 0de4f42168..a2f4f8adf5 100644
--- a/sysdeps/x86/Makefile
+++ b/sysdeps/x86/Makefile
@@ -7,4 +7,19 @@ sysdep-dl-routines += dl-get-cpu-features
tests += tst-get-cpu-features
tests-static += tst-get-cpu-features-static
+
+tests += tst-prelink
+tst-prelink-ENV = LD_TRACE_PRELINKING=1
+
+$(objpfx)tst-prelink-conflict.out: $(objpfx)tst-prelink.out
+ grep stdout $< | grep conflict | $(AWK) '{ print $$10, $$11 }' > $@
+
+$(objpfx)tst-prelink-cmp.out: $(..)sysdeps/x86/tst-prelink.exp \
+ $(objpfx)tst-prelink-conflict.out
+ cmp $^ > $@; \
+ $(evaluate-test)
+
+ifeq ($(run-built-tests),yes)
+tests-special += $(objpfx)tst-prelink-cmp.out
+endif
endif