16526, 16538, 16559, 16560, 16704, 16783, 16850, 17053, 17090, 17195,
17269, 17293, 17322, 17403, 17523, 17542, 17569, 17581, 17588, 17596,
17620, 17621, 17628, 17631, 17692, 17711, 17715, 17776, 17779, 17792,
- 17836, 17841, 17912, 17916, 17930, 17932, 17944, 17949, 17964, 17965,
- 17967, 17969, 17977, 17978, 17987, 17991, 17996, 17998, 17999, 18007,
- 18019, 18020, 18029, 18030, 18032, 18034, 18036, 18038, 18039, 18042,
- 18043, 18046, 18047, 18049, 18068, 18080, 18093, 18100, 18104, 18110,
- 18111, 18116, 18125, 18128, 18138, 18185, 18196, 18197, 18206, 18210,
- 18211, 18217, 18219, 18220, 18221, 18234, 18244, 18245, 18247, 18287,
- 18319, 18324, 18333, 18346, 18371, 18397, 18409, 18410, 18412, 18418,
- 18422, 18434, 18435, 18444, 18468, 18469, 18470, 18479, 18483, 18495,
- 18496, 18497, 18498, 18502, 18507, 18508, 18512, 18513, 18519, 18520,
- 18522, 18527, 18528, 18529, 18530, 18532, 18533, 18534, 18536, 18539,
- 18540, 18542, 18544, 18545, 18546, 18547, 18549, 18553, 18558, 18569,
- 18583, 18585, 18586, 18592, 18593, 18594, 18602, 18612, 18613, 18619,
- 18633.
+ 17833, 17836, 17841, 17912, 17916, 17930, 17932, 17944, 17949, 17964,
+ 17965, 17967, 17969, 17977, 17978, 17987, 17991, 17996, 17998, 17999,
+ 18007, 18019, 18020, 18029, 18030, 18032, 18034, 18036, 18038, 18039,
+ 18042, 18043, 18046, 18047, 18049, 18068, 18080, 18093, 18100, 18104,
+ 18110, 18111, 18116, 18125, 18128, 18138, 18185, 18196, 18197, 18206,
+ 18210, 18211, 18217, 18219, 18220, 18221, 18234, 18244, 18245, 18247,
+ 18287, 18319, 18324, 18333, 18346, 18371, 18397, 18409, 18410, 18412,
+ 18418, 18422, 18434, 18435, 18444, 18468, 18469, 18470, 18479, 18483,
+ 18495, 18496, 18497, 18498, 18502, 18507, 18508, 18512, 18513, 18519,
+ 18520, 18522, 18527, 18528, 18529, 18530, 18532, 18533, 18534, 18536,
+ 18539, 18540, 18542, 18544, 18545, 18546, 18547, 18549, 18553, 18558,
+ 18569, 18583, 18585, 18586, 18592, 18593, 18594, 18602, 18612, 18613,
+ 18619, 18633.
* Cache information can be queried via sysconf() function on s390 e.g. with
_SC_LEVEL1_ICACHE_SIZE as argument.
ifeq (yes,$(build-shared))
tests += loadtest restest1 preloadtest loadfail multiload origtest resolvfail \
constload1 order noload filter unload \
- reldep reldep2 reldep3 reldep4 nodelete nodelete2 \
+ reldep reldep2 reldep3 reldep4 nodelete nodelete2 tst-nodelete \
nodlopen nodlopen2 neededtest neededtest2 \
neededtest3 neededtest4 unload2 lateglobal initfirst global \
restest2 next dblload dblunload reldep5 reldep6 reldep7 reldep8 \
tst-unique1mod1 tst-unique1mod2 \
tst-unique2mod1 tst-unique2mod2 \
tst-auditmod9a tst-auditmod9b \
- $(if $(CXX),tst-unique3lib tst-unique3lib2 tst-unique4lib) \
+ $(if $(CXX),tst-unique3lib tst-unique3lib2 tst-unique4lib \
+ tst-nodelete-uniquemod) \
+ tst-nodelete-rtldmod tst-nodelete-zmod \
tst-initordera1 tst-initorderb1 \
tst-initordera2 tst-initorderb2 \
tst-initordera3 tst-initordera4 \
ifuncmod6.so-no-z-defs = yes
tst-auditmod9a.so-no-z-defs = yes
tst-auditmod9b.so-no-z-defs = yes
+tst-nodelete-uniquemod.so-no-z-defs = yes
+tst-nodelete-rtldmod.so-no-z-defs = yes
+tst-nodelete-zmod.so-no-z-defs = yes
ifeq ($(build-shared),yes)
# Build all the modules even when not actually running test programs.
$(objpfx)tst-unique4: $(objpfx)tst-unique4lib.so
+$(objpfx)tst-nodelete: $(libdl)
+$(objpfx)tst-nodelete.out: $(objpfx)tst-nodelete-uniquemod.so \
+ $(objpfx)tst-nodelete-rtldmod.so \
+ $(objpfx)tst-nodelete-zmod.so
+
+LDFLAGS-tst-nodelete = -rdynamic
+LDFLAGS-tst-nodelete-zmod.so = -Wl,--enable-new-dtags,-z,nodelete
+
$(objpfx)tst-initorder-cmp.out: tst-initorder.exp $(objpfx)tst-initorder.out
cmp $^ > $@; \
$(evaluate-test)
--- /dev/null
+#include "../dlfcn/dlfcn.h"
+#include <stdio.h>
+#include <stdlib.h>
+
+static int
+do_test (void)
+{
+ int result = 0;
+
+ /* This is a test for correct handling of dlopen failures for library that
+ is loaded with RTLD_NODELETE flag. The first dlopen should fail because
+ of undefined symbols in shared library. The second dlopen then verifies
+ that library was properly unloaded. */
+ if (dlopen ("tst-nodelete-rtldmod.so", RTLD_NOW | RTLD_NODELETE) != NULL
+ || dlopen ("tst-nodelete-rtldmod.so", RTLD_LAZY | RTLD_NOLOAD) != NULL)
+ {
+ printf ("RTLD_NODELETE test failed\n");
+ result = 1;
+ }
+
+ /* This is a test for correct handling of dlopen failures for library that
+ is linked with '-z nodelete' option and hence has DF_1_NODELETE flag.
+ The first dlopen should fail because of undefined symbols in shared
+ library. The second dlopen then verifies that library was properly
+ unloaded. */
+ if (dlopen ("tst-nodelete-zmod.so", RTLD_NOW) != NULL
+ || dlopen ("tst-nodelete-zmod.so", RTLD_LAZY | RTLD_NOLOAD) != NULL)
+ {
+ printf ("-z nodelete test failed\n");
+ result = 1;
+ }
+
+ /* This is a test for correct handling of dlopen failures for library
+ with unique symbols. The first dlopen should fail because of undefined
+ symbols in shared library. The second dlopen then verifies that library
+ was properly unloaded. */
+ if (dlopen ("tst-nodelete-uniquemod.so", RTLD_NOW) != NULL
+ || dlopen ("tst-nodelete-uniquemod.so", RTLD_LAZY | RTLD_NOLOAD) != NULL)
+ {
+ printf ("Unique symbols test failed\n");
+ result = 1;
+ }
+
+ if (result == 0)
+ printf ("SUCCESS\n");
+
+ return result;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"