about summary refs log tree commit diff
path: root/elf/Makefile
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2017-10-04 15:40:37 -0700
committerH.J. Lu <hjl.tools@gmail.com>2017-10-04 15:40:49 -0700
commit5dba84b3246961ea3032ce48ac72c1ac9364cf2b (patch)
treec96f72f435d5c899fdb668dafa1dceb139340b47 /elf/Makefile
parent758f1bfa2a1bccb52f1b3e97444a367d35aceaee (diff)
downloadglibc-5dba84b3246961ea3032ce48ac72c1ac9364cf2b.tar.gz
glibc-5dba84b3246961ea3032ce48ac72c1ac9364cf2b.tar.xz
glibc-5dba84b3246961ea3032ce48ac72c1ac9364cf2b.zip
Add a test for main () in a shared object
Verify that crt1.o can be used with main () in a shared object.

	* elf/Makefile (tests): Add tst-main1.
	(modules-names): Add tst-main1mod.
	($(objpfx)tst-main1): New.
	(CRT-tst-main1): Likewise.
	(LDFLAGS-tst-main1): Likewise.
	(LDLIBS-tst-main1): Likewise.
	(tst-main1mod.so-no-z-defs): Likewise.
	* elf/tst-main1.c: New file.
	* elf/tst-main1mod.c: Likewise.
Diffstat (limited to 'elf/Makefile')
-rw-r--r--elf/Makefile11
1 files changed, 9 insertions, 2 deletions
diff --git a/elf/Makefile b/elf/Makefile
index c6edebd4ee..0dcbf2f3de 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -185,7 +185,7 @@ tests += restest1 preloadtest loadfail multiload origtest resolvfail \
 	 tst-tlsalign tst-tlsalign-extern tst-nodelete-opened \
 	 tst-nodelete2 tst-audit11 tst-audit12 tst-dlsym-error tst-noload \
 	 tst-latepthread tst-tls-manydynamic tst-nodelete-dlclose \
-	 tst-debug1
+	 tst-debug1 tst-main1
 #	 reldep9
 tests-internal += loadtest unload unload2 circleload1 \
 	 neededtest neededtest2 neededtest3 neededtest4 \
@@ -269,7 +269,8 @@ modules-names = testobj1 testobj2 testobj3 testobj4 testobj5 testobj6 \
 		tst-audit11mod1 tst-audit11mod2 tst-auditmod11 \
 		tst-audit12mod1 tst-audit12mod2 tst-audit12mod3 tst-auditmod12 \
 		tst-latepthreadmod $(tst-tls-many-dynamic-modules) \
-		tst-nodelete-dlclose-dso tst-nodelete-dlclose-plugin
+		tst-nodelete-dlclose-dso tst-nodelete-dlclose-plugin \
+		tst-main1mod
 ifeq (yes,$(have-mtls-dialect-gnu2))
 tests += tst-gnu2-tls1
 modules-names += tst-gnu2-tls1mod
@@ -1427,3 +1428,9 @@ $(objpfx)tst-debug1.out: $(objpfx)tst-debug1mod1.so
 
 $(objpfx)tst-debug1mod1.so: $(objpfx)testobj1.so
 	$(OBJCOPY) --only-keep-debug $< $@
+
+$(objpfx)tst-main1: $(objpfx)tst-main1mod.so
+CRT-tst-main1 := $(csu-objpfx)crt1.o
+LDFLAGS-tst-main1 = $(no-pie-ldflag)
+LDLIBS-tst-main1 = $(libsupport)
+tst-main1mod.so-no-z-defs = yes