mirror of
git://sourceware.org/git/glibc.git
synced 2025-01-18 12:16:13 +08:00
Update.
* elf/Makefile: Add rules to build and run tst-pathopt. * elf/tst-pathopt.c: New file. * elf/tst-pathopt.sh: New file. * elf/pathoptobj.c: New file.
This commit is contained in:
parent
775106de7d
commit
5a384a9143
@ -1,5 +1,10 @@
|
||||
2000-10-29 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
* elf/Makefile: Add rules to build and run tst-pathopt.
|
||||
* elf/tst-pathopt.c: New file.
|
||||
* elf/tst-pathopt.sh: New file.
|
||||
* elf/pathoptobj.c: New file.
|
||||
|
||||
* elf/elf.h (SHN_XINDEX): Define.
|
||||
|
||||
2000-10-28 Ulrich Drepper <drepper@redhat.com>
|
||||
|
15
elf/Makefile
15
elf/Makefile
@ -53,14 +53,15 @@ distribute := $(rtld-routines:=.c) dynamic-link.h do-rel.h dl-machine.h \
|
||||
nodlopenmod.c nodelete.c nodelmod1.c nodelmod2.c \
|
||||
nodelmod3.c nodelmod4.c nodlopen.c dl-osinfo.h \
|
||||
reldepmod1.c reldepmod2.c reldepmod3.c reldepmod4.c \
|
||||
nextmod1.c nextmod2.c \
|
||||
nextmod1.c nextmod2.c pathoptobj.c \
|
||||
neededobj1.c neededobj2.c neededobj3.c neededobj4.c \
|
||||
unload2mod.c unload2dep.c ltglobmod1.c ltglobmod2.c
|
||||
|
||||
include ../Makeconfig
|
||||
|
||||
before-compile = $(objpfx)trusted-dirs.h
|
||||
generated := trusted-dirs.h trusted-dirs.st
|
||||
generated := trusted-dirs.h trusted-dirs.st for-renamed/renamed.so
|
||||
generated-dirs := for-renamed
|
||||
|
||||
ifeq ($(versioning),yes)
|
||||
ld-map = $(common-objpfx)ld.map
|
||||
@ -99,6 +100,7 @@ tests = loadtest restest1 preloadtest loadfail multiload origtest resolvfail \
|
||||
reldep reldep2 reldep3 next $(tests-nodelete-$(have-z-nodelete)) \
|
||||
$(tests-nodlopen-$(have-z-nodlopen)) neededtest neededtest2 \
|
||||
neededtest3 unload2 lateglobal
|
||||
test-srcs = tst-pathopt
|
||||
tests-vis-yes = vismain
|
||||
tests-nodelete-yes = nodelete
|
||||
tests-nodlopen-yes = nodlopen
|
||||
@ -110,7 +112,7 @@ modules-names = testobj1 testobj2 testobj3 testobj4 testobj5 testobj6 \
|
||||
$(modules-nodlopen-$(have-z-nodlopen)) filtmod1 filtmod2 \
|
||||
reldepmod1 reldepmod2 reldepmod3 reldepmod4 nextmod1 nextmod2 \
|
||||
neededobj1 neededobj2 neededobj3 neededobj4 \
|
||||
unload2mod unload2dep ltglobmod1 ltglobmod2
|
||||
unload2mod unload2dep ltglobmod1 ltglobmod2 pathoptobj
|
||||
modules-vis-yes = vismod1 vismod2 vismod3
|
||||
modules-nodelete-yes = nodelmod1 nodelmod2 nodelmod3 nodelmod4
|
||||
modules-nodlopen-yes = nodlopenmod
|
||||
@ -240,6 +242,8 @@ CFLAGS-cache.c = $(SYSCONF-FLAGS)
|
||||
test-modules = $(addprefix $(objpfx),$(addsuffix .so,$(strip $(modules-names))))
|
||||
generated += $(addsuffix .so,$(strip $(modules-names)))
|
||||
|
||||
tests: $(objpfx)tst-pathopt.out
|
||||
|
||||
$(objpfx)testobj1.so: $(libdl)
|
||||
$(objpfx)testobj1_1.so: $(objpfx)testobj1.so $(libdl)
|
||||
$(objpfx)testobj2.so: $(objpfx)testobj1.so $(libdl)
|
||||
@ -371,3 +375,8 @@ $(objpfx)unload2.out: $(objpfx)unload2mod.so $(objpfx)unload2dep.so
|
||||
|
||||
$(objpfx)lateglobal: $(libdl)
|
||||
$(objpfx)lateglobal.out: $(objpfx)ltglobmod1.so $(objpfx)ltglobmod2.so
|
||||
|
||||
$(objpfx)tst-pathopt: $(libdl)
|
||||
$(objpfx)tst-pathopt.out: tst-pathopt.sh $(objpfx)tst-pathopt \
|
||||
$(objpfx)pathoptobj.so
|
||||
$(SHELL) -e $< $(common-objpfx)
|
||||
|
5
elf/pathoptobj.c
Normal file
5
elf/pathoptobj.c
Normal file
@ -0,0 +1,5 @@
|
||||
int
|
||||
in_renamed (int a)
|
||||
{
|
||||
return a - 10;
|
||||
}
|
39
elf/tst-pathopt.c
Normal file
39
elf/tst-pathopt.c
Normal file
@ -0,0 +1,39 @@
|
||||
#include <dlfcn.h>
|
||||
#include <mcheck.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
|
||||
int
|
||||
main (void)
|
||||
{
|
||||
void *h;
|
||||
int (*fp) (int);
|
||||
int result;
|
||||
|
||||
mtrace ();
|
||||
|
||||
h = dlopen ("renamed.so", RTLD_LAZY);
|
||||
if (h == NULL)
|
||||
{
|
||||
printf ("failed to load \"%s\": %s\n", "renamed.so", dlerror ());
|
||||
exit (1);
|
||||
}
|
||||
|
||||
fp = dlsym (h, "in_renamed");
|
||||
if (fp == NULL)
|
||||
{
|
||||
printf ("lookup of \"%s\" failed: %s\n", "in_renamed", dlerror ());
|
||||
exit (1);
|
||||
}
|
||||
|
||||
result = fp (10);
|
||||
|
||||
if (dlclose (h) != 0)
|
||||
{
|
||||
printf ("failed to close \"%s\": %s\n", "renamed.so", dlerror ());
|
||||
exit (1);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
36
elf/tst-pathopt.sh
Executable file
36
elf/tst-pathopt.sh
Executable file
@ -0,0 +1,36 @@
|
||||
#! /bin/sh
|
||||
# Test lookup path optimization.
|
||||
# Copyright (C) 2000 Free Software Foundation, Inc.
|
||||
# This file is part of the GNU C Library.
|
||||
#
|
||||
# The GNU C Library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Library General Public License as
|
||||
# published by the Free Software Foundation; either version 2 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# The GNU C Library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Library General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Library General Public
|
||||
# License along with the GNU C Library; see the file COPYING.LIB. If
|
||||
# not, write to the Free Software Foundation, Inc.,
|
||||
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
common_objpfx=$1
|
||||
run_program_prefix=$2
|
||||
|
||||
test -e ${common_objpfx}elf/will-be-empty &&
|
||||
rm -fr ${common_objpfx}elf/will-be-empty
|
||||
test -d ${common_objpfx}elf/for-renamed ||
|
||||
mkdir ${common_objpfx}elf/for-renamed
|
||||
|
||||
cp ${common_objpfx}elf/pathoptobj.so ${common_objpfx}elf/for-renamed/renamed.so
|
||||
|
||||
LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \
|
||||
LC_ALL=C LD_LIBRARY_PATH=${common_objpfx}elf/will-be-empty:${common_objpfx}elf/for-renamed:${common_objpfx}.:${common_objpfx}dlfcn \
|
||||
${common_objpfx}elf/ld.so ${common_objpfx}elf/tst-pathopt \
|
||||
> ${common_objpfx}elf/tst-pathopt.out
|
||||
|
||||
exit $?
|
Loading…
Reference in New Issue
Block a user