Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[BZ #4775, BZ #4776]
2007-07-12  Jakub Jelinek  <jakub@redhat.com>
	[BZ #4775]
	* math/tgmath.h (__tgmath_real_type_sub): Formatting.
	(__tgmath_real_type): Fix if expr is const int or other const
	qualified integral type.
	(__TGMATH_UNARY_REAL_ONLY): Rewritten to avoid using statement
	expressions and handle const qualified arguments.
	(__TGMATH_BINARY_FIRST_REAL_ONLY, __TGMATH_UNARY_REAL_IMAG,
	__TGMATH_UNARY_REAL_IMAG_RET_REAL): Likewise.
	(__TGMATH_UNARY_REAL_RET_ONLY): Rewritten to avoid using
	statement expressions.
	(__TGMATH_BINARY_REAL_ONLY, __TGMATH_TERNARY_FIRST_SECOND_REAL_ONLY,
	__TGMATH_TERNARY_REAL_ONLY, __TGMATH_BINARY_REAL_IMAG): Likewise.
	(__TGMATH_UNARY_IMAG): Define.
	(conj, cproj): Use __TGMATH_UNARY_IMAG macro.
	* math/Makefile (tests): Add test-tgmath2.
	(CFLAGS-test-tgmath2.c): Add.
	* math/test-tgmath.c (fy, dy, ly, fz, dz, lz, count_cdouble,
	count_cfloat, count_cldouble): New variables.
	(NCCALLS): Define.
	(main): Check number of complex calls as well.
	(F(compile_test)): Add complex tests and tests with const qualified
	arguments.
	(y, z, ccount): Define.
	(F(cacos), F(casin), F(catan), F(ccos), F(csin), F(ctan), F(cacosh),
	F(casinh), F(catanh), F(ccosh), F(csinh), F(ctanh), F(cexp), F(clog),
	F(csqrt), F(cpow), F(cabs), F(carg), F(creal), F(cimag), F(conj),
	F(cproj)): New functions.
	* math/test-tgmath2.c: New test.

2007-07-11  Jakub Jelinek  <jakub@redhat.com>

	[BZ #4776]
	* elf/dl-load.c (_dl_rtld_di_serinfo): Output / in LD_LIBRARY_PATH,
	RPATH etc. as "/" rather than "", don't segfault on empty paths,
	instead output ".".
	* dlfcn/Makefile (distribute): Add glreflib3.c.
	(module-names): Add glreflib3.
	($(objpfx)tst-dlinfo.out): Depend on glreflib3.so rather than
	glreflib1.so.
	(LDFLAGS_glreflib3.so): New.
	* dlfcn/tst-dlinfo.c (do_test): Load glreflib3.so instead of
	glreflib1.so.
	* dlfcn/glreflib3.c: New file.

	* intl/finddomain.c (_nl_find_domain): If _nl_explode_name
	returned -1, return NULL.
	* intl/explodename.c (_nl_explode_name): Return -1 if
	_nl_normalize_codeset failed.
  • Loading branch information
Ulrich Drepper committed Jul 12, 2007
1 parent f98c2d0 commit 1c298d0
Show file tree
Hide file tree
Showing 11 changed files with 1,143 additions and 247 deletions.
51 changes: 51 additions & 0 deletions ChangeLog
@@ -1,3 +1,54 @@
2007-07-12 Jakub Jelinek <jakub@redhat.com>

[BZ #4775]
* math/tgmath.h (__tgmath_real_type_sub): Formatting.
(__tgmath_real_type): Fix if expr is const int or other const
qualified integral type.
(__TGMATH_UNARY_REAL_ONLY): Rewritten to avoid using statement
expressions and handle const qualified arguments.
(__TGMATH_BINARY_FIRST_REAL_ONLY, __TGMATH_UNARY_REAL_IMAG,
__TGMATH_UNARY_REAL_IMAG_RET_REAL): Likewise.
(__TGMATH_UNARY_REAL_RET_ONLY): Rewritten to avoid using
statement expressions.
(__TGMATH_BINARY_REAL_ONLY, __TGMATH_TERNARY_FIRST_SECOND_REAL_ONLY,
__TGMATH_TERNARY_REAL_ONLY, __TGMATH_BINARY_REAL_IMAG): Likewise.
(__TGMATH_UNARY_IMAG): Define.
(conj, cproj): Use __TGMATH_UNARY_IMAG macro.
* math/Makefile (tests): Add test-tgmath2.
(CFLAGS-test-tgmath2.c): Add.
* math/test-tgmath.c (fy, dy, ly, fz, dz, lz, count_cdouble,
count_cfloat, count_cldouble): New variables.
(NCCALLS): Define.
(main): Check number of complex calls as well.
(F(compile_test)): Add complex tests and tests with const qualified
arguments.
(y, z, ccount): Define.
(F(cacos), F(casin), F(catan), F(ccos), F(csin), F(ctan), F(cacosh),
F(casinh), F(catanh), F(ccosh), F(csinh), F(ctanh), F(cexp), F(clog),
F(csqrt), F(cpow), F(cabs), F(carg), F(creal), F(cimag), F(conj),
F(cproj)): New functions.
* math/test-tgmath2.c: New test.

2007-07-11 Jakub Jelinek <jakub@redhat.com>

[BZ #4776]
* elf/dl-load.c (_dl_rtld_di_serinfo): Output / in LD_LIBRARY_PATH,
RPATH etc. as "/" rather than "", don't segfault on empty paths,
instead output ".".
* dlfcn/Makefile (distribute): Add glreflib3.c.
(module-names): Add glreflib3.
($(objpfx)tst-dlinfo.out): Depend on glreflib3.so rather than
glreflib1.so.
(LDFLAGS_glreflib3.so): New.
* dlfcn/tst-dlinfo.c (do_test): Load glreflib3.so instead of
glreflib1.so.
* dlfcn/glreflib3.c: New file.

* intl/finddomain.c (_nl_find_domain): If _nl_explode_name
returned -1, return NULL.
* intl/explodename.c (_nl_explode_name): Return -1 if
_nl_normalize_codeset failed.

2007-07-10 Ulrich Drepper <drepper@redhat.com>

[BZ #4773]
Expand Down
10 changes: 6 additions & 4 deletions dlfcn/Makefile
Expand Up @@ -23,7 +23,8 @@ libdl-routines := dlopen dlclose dlsym dlvsym dlerror dladdr dladdr1 dlinfo \
dlmopen dlfcn
routines := $(patsubst %,s%,$(filter-out dlfcn,$(libdl-routines)))
elide-routines.os := $(routines)
distribute := dlopenold.c glreflib1.c glreflib2.c failtestmod.c \
distribute := dlopenold.c glreflib1.c glreflib2.c glreflib3.c \
failtestmod.c \
defaultmod1.c defaultmod2.c errmsg1mod.c modatexit.c \
modcxaatexit.c modstatic.c modstatic2.c \
bug-dlsym1-lib1.c bug-dlsym1-lib2.c bug-atexit1-lib.c \
Expand All @@ -43,8 +44,8 @@ tests = glrefmain failtest tst-dladdr default errmsg1 tstcxaatexit \
bug-dlopen1 bug-dlsym1 tst-dlinfo bug-atexit1 bug-atexit2 \
bug-atexit3 tstatexit
endif
modules-names = glreflib1 glreflib2 failtestmod defaultmod1 defaultmod2 \
errmsg1mod modatexit modcxaatexit \
modules-names = glreflib1 glreflib2 glreflib3 failtestmod defaultmod1 \
defaultmod2 errmsg1mod modatexit modcxaatexit \
bug-dlsym1-lib1 bug-dlsym1-lib2 bug-atexit1-lib \
bug-atexit2-lib bug-atexit3-lib

Expand Down Expand Up @@ -83,7 +84,8 @@ $(objpfx)tst-dladdr: $(libdl)
$(objpfx)tst-dladdr.out: $(objpfx)glreflib1.so

$(objpfx)tst-dlinfo: $(libdl)
$(objpfx)tst-dlinfo.out: $(objpfx)glreflib1.so
$(objpfx)tst-dlinfo.out: $(objpfx)glreflib3.so
LDFLAGS-glreflib3.so = -Wl,-rpath,:

LDFLAGS-default = $(LDFLAGS-rdynamic)
$(objpfx)default: $(libdl) $(objpfx)defaultmod1.so $(objpfx)defaultmod2.so
Expand Down
1 change: 1 addition & 0 deletions dlfcn/glreflib3.c
@@ -0,0 +1 @@
#include "glreflib1.c"
2 changes: 1 addition & 1 deletion dlfcn/tst-dlinfo.c
Expand Up @@ -29,7 +29,7 @@ do_test (void)
{
int status = 0;

void *handle = dlopen ("glreflib1.so", RTLD_NOW);
void *handle = dlopen ("glreflib3.so", RTLD_NOW);
if (handle == NULL)
error (EXIT_FAILURE, 0, "cannot load: glreflib1.so: %s", dlerror ());

Expand Down
9 changes: 6 additions & 3 deletions elf/dl-load.c
Expand Up @@ -2273,14 +2273,17 @@ _dl_rtld_di_serinfo (struct link_map *loader, Dl_serinfo *si, bool counting)
if (counting)
{
si->dls_cnt++;
si->dls_size += r->dirnamelen;
si->dls_size += r->dirnamelen < 2 ? r->dirnamelen : 2;
}
else
{
Dl_serpath *const sp = &si->dls_serpath[idx++];
sp->dls_name = allocptr;
allocptr = __mempcpy (allocptr,
r->dirname, r->dirnamelen - 1);
if (r->dirnamelen < 2)
*allocptr++ = r->dirnamelen ? '/' : '.';
else
allocptr = __mempcpy (allocptr,
r->dirname, r->dirnamelen - 1);
*allocptr++ = '\0';
sp->dls_flags = flags;
}
Expand Down
6 changes: 4 additions & 2 deletions intl/explodename.c
@@ -1,4 +1,4 @@
/* Copyright (C) 1995-2002, 2003, 2006 Free Software Foundation, Inc.
/* Copyright (C) 1995-2002, 2003, 2006, 2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
Expand Down Expand Up @@ -108,7 +108,9 @@ _nl_explode_name (name, language, modifier, territory, codeset,
{
*normalized_codeset = _nl_normalize_codeset (*codeset,
cp - *codeset);
if (strcmp (*codeset, *normalized_codeset) == 0)
if (*normalized_codeset == NULL)
return -1;
else if (strcmp (*codeset, *normalized_codeset) == 0)
free ((char *) *normalized_codeset);
else
mask |= XPG_NORM_CODESET;
Expand Down
5 changes: 4 additions & 1 deletion intl/finddomain.c
@@ -1,5 +1,5 @@
/* Handle list of needed message catalogs
Copyright (C) 1995-1999, 2000, 2001, 2002, 2004, 2006
Copyright (C) 1995-1999, 2000, 2001, 2002, 2004, 2006, 2007
Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Ulrich Drepper <drepper@gnu.org>, 1995.
Expand Down Expand Up @@ -126,6 +126,9 @@ _nl_find_domain (dirname, locale, domainname, domainbinding)
we use XPG4 style, and `_', `+', and `,' if we use CEN syntax. */
mask = _nl_explode_name (locale, &language, &modifier, &territory,
&codeset, &normalized_codeset);
if (mask == -1)
/* This means we are out of core. */
return NULL;

/* We need to protect modifying the _NL_LOADED_DOMAINS data. */
__libc_rwlock_wrlock (lock);
Expand Down
3 changes: 2 additions & 1 deletion math/Makefile
Expand Up @@ -90,7 +90,7 @@ distribute += $(filter-out $(generated),$(long-m-yes:=.c) $(long-c-yes:=.c))
# Rules for the test suite.
tests = test-matherr test-fenv atest-exp atest-sincos atest-exp2 basic-test \
test-misc test-fpucw tst-definitions test-tgmath test-tgmath-ret \
bug-nextafter bug-nexttoward bug-tgmath1 test-tgmath-int
bug-nextafter bug-nexttoward bug-tgmath1 test-tgmath-int test-tgmath2
# We do the `long double' tests only if this data type is available and
# distinct from `double'.
test-longdouble-yes = test-ldouble test-ildoubl
Expand Down Expand Up @@ -129,6 +129,7 @@ CFLAGS-test-float.c = -fno-inline -ffloat-store -fno-builtin
CFLAGS-test-double.c = -fno-inline -ffloat-store -fno-builtin
CFLAGS-test-ldouble.c = -fno-inline -ffloat-store -fno-builtin
CFLAGS-test-tgmath.c = -fno-builtin
CFLAGS-test-tgmath2.c = -fno-builtin
CFLAGS-test-tgmath-ret.c = -fno-builtin
CPPFLAGS-test-ifloat.c = -U__LIBC_INTERNAL_MATH_INLINES -D__FAST_MATH__ \
-DTEST_FAST_MATH -fno-builtin
Expand Down

0 comments on commit 1c298d0

Please sign in to comment.