summary refs log tree commit diff
path: root/elf/Makefile
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2019-03-01 18:53:03 +0100
committerFlorian Weimer <fweimer@redhat.com>2019-03-01 18:53:42 +0100
commitc259196b5005812aa3294dbf4eeca29b266a4522 (patch)
tree05195ae1b2e826cc3ba42f09913e3a923f6ba6e9 /elf/Makefile
parent928b305d3f6773b6a8cd1202da4f7d5d9a654456 (diff)
downloadglibc-c259196b5005812aa3294dbf4eeca29b266a4522.tar.gz
glibc-c259196b5005812aa3294dbf4eeca29b266a4522.tar.xz
glibc-c259196b5005812aa3294dbf4eeca29b266a4522.zip
elf/tst-big-note: Improve accuracy of test [BZ #20419]
It is possible that the link editor injects an allocated ABI tag note
before the artificial, allocated large note in the test.  Note parsing
in open_verify stops when the first ABI tag note is encountered, so if
the ABI tag note comes first, the problematic code is not actually
exercised.

Also tweak the artificial note so that it is a syntactically valid
4-byte aligned note, in case the link editor tries to parse notes and
process them.

Improves the testing part of commit 0065aaaaae51cd60210ec3a7e13.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Diffstat (limited to 'elf/Makefile')
-rw-r--r--elf/Makefile9
1 files changed, 7 insertions, 2 deletions
diff --git a/elf/Makefile b/elf/Makefile
index 55204073a3..310a37cc13 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -316,8 +316,8 @@ endif
 modules-execstack-yes = tst-execstack-mod
 extra-test-objs += $(addsuffix .os,$(strip $(modules-names)))
 
-# filtmod1.so has a special rule
-modules-names-nobuild := filtmod1
+# filtmod1.so, tst-big-note-lib.so have special rules.
+modules-names-nobuild := filtmod1 tst-big-note-lib
 
 tests += $(tests-static)
 
@@ -1515,6 +1515,11 @@ tst-libc_dlvsym-static-ENV = \
 $(objpfx)tst-libc_dlvsym-static.out: $(objpfx)tst-libc_dlvsym-dso.so
 
 $(objpfx)tst-big-note: $(objpfx)tst-big-note-lib.so
+# Avoid creating an ABI tag note, which may come before the
+# artificial, large note in tst-big-note-lib.o and invalidate the
+# test.
+$(objpfx)tst-big-note-lib.so: $(objpfx)tst-big-note-lib.o
+	$(LINK.o) -shared -o $@ $(LDFLAGS.so) $<
 
 $(objpfx)tst-unwind-ctor: $(objpfx)tst-unwind-ctor-lib.so