Mark internal nss symbols with attribute_hidden to allow direct access
within libc.so and libc.a without using GOT nor PLT.
Tested on x86-64 with and without --disable-nscd.
[BZ #18822]
* grp/initgroups.c (__nss_group_database): Removed.
(__nss_initgroups_database): Likewise.
* nscd/gai.c (__nss_hosts_database): Likewise.
* nss/XXX-lookup.c (DATABASE_NAME_SYMBOL): Likewise.
* posix/tst-rfc3484-2.c (__nss_hosts_database): Likewise.
* posix/tst-rfc3484-3.c (__nss_hosts_database): Likewise.
* posix/tst-rfc3484.c (__nss_hosts_database): Likewise.
* sysdeps/posix/getaddrinfo.c (__nss_hosts_database): Likewise.
* nss/getXXent.c (INTERNAL (REENTRANT_GETNAME)): Add
attribute_hidden.
* nss/nsswitch.c (__nss_database_custom): Define only if
USE_NSCD is defined.
(__nss_configure_lookup): Use __nss_database_custom only if
USE_NSCD is defined.
* nss/nsswitch.h (__nss_database_custom): Declare only if
USE_NSCD is defined. Add attribute_hidden.
(__nss_setent): Add attribute_hidden.
(__nss_endent): Likewise.
(__nss_getent_r): Likewise.
(__nss_getent): Likewise.
(DEFINE_DATABASE): Declare __nss_##arg##_database.
Commit 384ca55174 from 2007 added this to
nss/XXX-lookup.c:
+#ifndef NO_COMPAT
+int
+internal_function attribute_compat_text_section
+DB_COMPAT_FCT (service_user **ni, const char *fct_name, void **fctp)
+{
+ return DB_LOOKUP_FCT (ni, fct_name, NULL, fctp);
+}
+#endif
That is, it adds a pseudo-compat function with an internal_function
attribute. The function it was supposed to replace did not have the
attribute:
extern int DB_LOOKUP_FCT (service_user **ni, const char *fct_name,
- void **fctp) internal_function;
+ const char *fct2_name, void **fctp)
+ internal_function;
This changed the calling convention on i386 for the following
functions in the public ABI:
__nss_passwd_lookup
__nss_group_lookup
__nss_hosts_lookup
This commit replaces the functions with always-failing stubs,
with true compat symbols. Due to a happy accident, the calling
convention of the stub is identical for the internal_function
and non-internal_function case on i386.
In addition, this commit auto-generates the __nss_*_lookup2
function declarations as part of <nsswitch.h>.
When glibc is built with --enable-static-nss, the warning that
using NSS symbols requires the nss shared objects to be present
is no longer true, as those symbols are built into libc. Suppress
the warning for those symbols by providing a new macro
(nss_interface_function) for the NSS functions that is defined as
static_link_warning in the normal case, and empty for static NSS.
Together with a previous patch which introduced the initgroups
entry in nsswitch.conf this patch allows more customization of
the lookups for initgroups/getgrouplist. Nothing changes if
the groups entry in nsswitch.conf is used. If the initgroups entry
is used instead the code now doesn't automatically continue looking
for more entries aftedr a successful lookup. Instead the normal
rules are followed which do specify that by default no more
service is consulted. This can be overwritten with
[SUCCESS=continue]
appropriately placed in the line.
2005-03-19 Bruno Haible <bruno@clisp.org>
* intl/dcigettext.c (struct known_translation_t): Change type of
domainname field to 'const char *'.
(DCIGETTEXT): Remove const-cast.
[BZ #661]
* grp/initgroups.c (internal_getgrouplist): Check if we have
enough space before adding the primary group to the list.
2004-03-30 Ulrich Drepper <drepper@redhat.com>
* nis/nss_nis/nis-initgroups.c: Implement getting the information
from the netid.byname map if the system administrator allows this.
* grp/initgroups.c (initgroups): Limit the initial allocation to 64
entries to not allocate too much on systems with really high limits.
2003-04-23 Ulrich Drepper <drepper@redhat.com>
* grp/initgroups.c (getgrouplist): Don't copy too much into the
user buffer if more groups are found than fit into it.
* nis/nss_nis/nis-initgroups.c (_nss_nis_initgroups_dyn): Use
extend_alloca.
2001-07-06 Paul Eggert <eggert@twinsun.com>
* manual/argp.texi: Remove ignored LGPL copyright notice; it's
not appropriate for documentation anyway.
* manual/libc-texinfo.sh: "Library General Public License" ->
"Lesser General Public License".
2001-07-06 Andreas Jaeger <aj@suse.de>
* All files under GPL/LGPL version 2: Place under LGPL version
2.1.
instead of the constant NGROUPS_MAX. That way, the limit can be
raised in the kernel configuration without having to recompile libc.
* sysdeps/posix/euidaccess.c: Don't #include <limits.h> or try to
define NGROUPS_MAX; we don't use it here.
* string/endian.h: Explain the _*_ENDIAN constant values a bit
more. Patch by scarlet@mit.edu [PR libc/1799].
* io/ftwtest-sh: Add -f parameter to chmod if -R is also given.
[PR libc/1792].
* argp/argp-parse.c (parser_finalize): Reverse order in which
parsers are run for ARGP_KEY_END. [PR libc/1755].
* grp/initgroups.c (initgroups): Don't limit the possible number
of groups to NGROUPS_MAX. Allow dynamic resizing. Loop around
the setgroups call while the call fails and descrease the number
of groups each round.
The name of the initgroups function in the NSS modules changed.
(compat_call): Adapt for dynamic resizing.
* hesiod/nss_hesiod/hesiod-grp.c (_nss_hesiod_initgroups_dyn):
Implement dynamic resizing.
* nis/nss_compat/compat-initgroups.c (_nss_compat_initgroups_dyn):
Likewise.
* nis/nss_nis/compat-initgroups.c (_nss_nis_initgroups_dyn): Likewise.
* hesiod/Versions: Change exported interface name.
* nis/Versions: Change exported interface name.
2000-07-23 Ulrich Drepper <drepper@redhat.com>
2000-04-21 Ulrich Drepper <drepper@redhat.com>
* iconv/iconv.c (iconv): Add __builtin_expect where useful.
* iconv/iconv_close.c (iconv_close): Likewise.
* iconv/iconv_open.c (iconv_open): Likewise.
* grp/putgrent.c (putgrent): Unlock steam if fprintf failed. Add
__builtin_expect where useful.
* grp/initgroups.c (initgroups): Test for result of memory
allocation and punt if it fails.
* dirent/scandir.c (scandir): Add __builtin_expect where useful.
* grp/fgetgrent.c (fgetfrent): Likewise.
* grp/fgetgrent_r.c (__fgetgrent_r): Likewise.
* sysdeps/gnu/Makefile (libdl-routines): Add eval.
1999-07-06 Zack Weinberg <zack@rabi.columbia.edu>
* dlfcn: New directory. Move the following files from elf:
dladdr.c, dlclose.c, dlerror.c, dlfcn.h, dlopen.c,
dlopenold.c, dlsym.c, dlvsym.c.
* dlfcn/Makefile: New file.
* dlfcn/Versions: New file.
* dlfcn/dlsym.c: All ELF-specific code split out to new
function _dl_sym.
* dlfcn/dlvsym.c: All ELF-specific code split out to new
function _dl_vsym.
* elf/dl-sym.c: New file. _dl_sym and _dl_vsym are
implemented here.
* dlfcn/dladdr.c: Remove all references to ELF data structures
or headers.
* dlfcn/dlclose.c: Likewise.
* dlfcn/dlerror.c: Likewise.
* dlfcn/dlopen.c: Likewise.
* dlfcn/dlopenold.c: Likewise.
* Makeconfig (dlfcn): New variable - set to `dlfcn' if elf is
yes, empty otherwise.
(libdl): Set to dlfcn/libdl.so or libdl.a if elf is yes,
depending on build-shared.
(subdirs): Add $(dlfcn).
(rpath-dirs): Add dlfcn.
* elf/Makefile: Remove all references to libdl or its
components, except the ones relating to the test cases.
(routines): Add dl-sym.
* elf/Versions (libc): Add _dl_sym and _dl_vsym for GLIBC_2.2.
(libdl): Delete.
* elf/dl-close.c (_dl_close): Change argument to void *.
* elf/dl-open.c (_dl_open): Change return type to void *.
* elf/eval.c: Removed.
* elf/ldsodefs.h: Move prototypes of _dl_catch_error,
_dlerror_run, _dl_open, _dl_close, _dl_addr, and
_dl_mcount_wrapper_check to include/dlfcn.h. Delete
_CALL_DL_FCT macro.
* include/dlfcn.h: Also prototype _dl_sym and _dl_vsym here.
Include real header from dlfcn directory.
* include/ldsodefs.h: Removed.
* grp/initgroups.c: Use DL_CALL_FCT not _CALL_DL_FCT.
* nss/getXXbyYY_r.c: Likewise.
* nss/getXXent_r.c: Likewise.
* iconv/gconv.c: Likewise. Don't include ldsodefs.h.
* iconv/gconv_db.c: Likewise. Don't include ldsodefs.h.
* iconv/skeleton.c: Don't include ldsodefs.h.
* nss/nsswitch.h: Don't include ldsodefs.h. Include dlfcn.h.
1999-07-07 Ulrich Drepper <drepper@cygnus.com>
* elf/dynamic-link.h (elf_get_dynamic_info): Take new argument with
load address. Relocate d_ptr in DT_DTRTAB, DT_SYMTAB, DT_RELA, DT_REL,
DT_JMPREL, DT_PLTGOT, and DT_VERSYM l_info entry.
(_ELF_DYNAMIC_DO_RELOC): Take extra argument which specifies whether
rel and rela relocations can both happen and skip one test if this
is not possible.
(ELF_DYNAMIC_DO_RELA, ELF_DYNAMIC_DO_REL): Call _ELF_DYNAMIC_DO_RELOC
appropriately.
* elf/dl-addr.c (_dl_addr): DT_SYMTAB and DT_STRTAB entries are
already relocated.
* elf/dl-deps.c (_dl_map_object_deps): DT_STRTAB entry is already
relocated.
* elf/dl-load.c (_dl_init_paths): DT_STRTAB entry is already relocated.
(_dl_map_object_from_fd): Call elf_get_dynamic_info with new argument.
(_dl_map_object): DT_STRTAB entry is already relocated.
* elf/dl-lookup.c (do_lookup): DT_STRTAB and DT_SYMTAB entries are
already relocated.
* elf/dl-reloc.c (_dl_relocate_object): DT_STRTAB entry is already
relocated.
* elf/dl-runtime.c (fixup): DT_SYMTAB, DT_STRTAB, DT_JMPREL, and
DT_VERSYM entries are already relocated.
(profile_fixup): Likewise.
* elf/dl-version.c: Rename VERSTAG macro into VERSYMIDX. Replace
all users.
(match_symbol): DT_STRTAB entry is already relocated.
(_dl_check_map_versions): Likewise. Also fo DT_VERSYM.
* elf/do-rel.h (elf_dynamic_do_rel): reladdr is now assumed to be
relocated already. DT_SYMTAB and DT_VERSYM entries are also relocated.
* elf/rtld.c (_dl_start): Pass extra argument to elf_get_dynamic_info.
(find_needed): DT_STRTAB entry is already relocated.
(dl_main): Pass extra argument to elf_get_dynamic_info.
DT_STRTAB entry is already relocated.
* sysdeps/alpha/dl-machine.h (elf_machine_fixup_plt): DT_JMPREL and
DT_PLTGOT entries are already relocated.
(elf_machine_rela): Likewise for DT_SYMTAB.
* sysdeps/arm/dl-machine.h (elf_machine_rel): DT_STRTAB is already
relocated.
* sysdeps/i386/dl-machine.h (elf_machine_rel): Likewise.
* sysdeps/m68k/dl-machine.h (elf_machine_rela): Likewise.
* sysdeps/sparc/sparc32/dl-machine.h (elf_machine_rela): Likewise.
* sysdeps/sparc/sparc64/dl-machine.h (elf_machine_rela): Likewise.
* sysdeps/powerpc/dl-machine.c (__process_machine_rela): Likewise.
* sysdeps/mips/dl-machine.h (elf_machine_got_rel): Likewise.
(elf_machine_got_rel): Likewise for DT_SYMTAB and DT_STRTAB.
* grp/initgroups.c (initgroups): If function in current module was
successful don't stop but continue to process to get all the groups.
1998-07-04 10:14 Ulrich Drepper <drepper@cygnus.com>
* libio/Makefile (routines): Add iofread_u and iofwrite_u.
* libio/Versions: Add fread_unlocked and fwrite_unlocked.
* Makerules (lib%.so): Adjust ignore pattern for last makefile change.
* time/tzfile.c (decode): Optimize by using bswap_32.
(__tzfile_read): Use _unlocked stream functions. Correct setting of
__tzname array values.
(__tzfile_compute): Correct setting of __tzname array values.
* time/tzset.c (__tzstring): Clean up a bit.
1998-06-29 19:01 Jim Wilson <wilson@cygnus.com>
* posix/regex.c (re_comp): Add cast to char * before gettext calls.
1998-06-30 Andreas Jaeger <aj@arthur.rhein-neckar.de>
* sysdeps/unix/bsd/poll.c (__poll): Allocate fd_set dynamically so
that fd can be bigger than FD_SETSIZE.
1998-07-01 Andreas Jaeger <aj@arthur.rhein-neckar.de>
* nscd/grpcache.c: Include <unistd.h>.
* nscd/pwdcache.c: Likewise.
* nis/nis_modify.c: Include <string.h>.
* nis/nis_add.c: Likewise.
* nis/nis_checkpoint.c: Likewise.
* posix/runptests.c: Likewise.
* sysdeps/generic/statvfs64.c: Likewise.
* sysdeps/generic/fstatvfs64.c: Likewise.
1998-07-03 13:16 Ulrich Drepper <drepper@cygnus.com>
* localedata/charmaps/ISO-8859-9: Change mapping for 0xea, 0xec, 0xef
to match data from Unicode.
Reported by Michael Deutschmann <michael@talamasca.wkpowerlink.com>.
1998-07-03 11:45 Ulrich Drepper <drepper@cygnus.com>
* stdio-common/printf.h: Define printf_function and
printf_arginfo_function types using __PMT not __P.
Reported by Marc Lehmann.
1998-07-02 14:07 -0400 Zack Weinberg <zack@rabi.phys.columbia.edu>
* assert/test-assert.c: New test.
* assert/test-assert-perr.c: New test.
* assert/Makefile (tests): Add test-assert and test-assert-perr.
1998-07-02 13:45 Zack Weinberg <zack@rabi.phys.columbia.edu>
BSD-style SCM_CREDS support.
* sysdeps/unix/sysv/linux/socket.h: Define struct cmsgcred and
SCM_CREDS.
* sysdeps/unix/sysv/linux/sendmsg.c: New file. Convert user
visible SCM_CREDS packet to what the kernel wants.
* sysdeps/unix/sysv/linux/recvmsg.c: New file. Convert
SCM_CREDS packet output by kernel to what users want.
* sysdeps/unix/sysv/linux/sendmsg.S: Moved to...
* sysdeps/unix/sysv/linux/__sendmsg.S: here.
* sysdeps/unix/sysv/linux/recvmsg.S: Moved to...
* sysdeps/unix/sysv/linux/__recvmsg.S: here.
* sysdeps/unix/sysv/linux/Makefile [subdir=socket]: Add
__sendmsg and __recvmsg to sysdep_routines.
* sysdeps/unix/sysv/linux/Dist: Add __sendmsg.S and __recvmsg.S.
1998-07-02 Thorsten Kukuk <kukuk@vt.uni-paderborn.de>
* nscd/grpcache.c: Fix gid pointer handling and debug messages.
* nscd/pwdcache.c: Fix uid pointer handling and debug messages.
* nscd/nscd.c: Check, if pthread_create fails.
1998-07-02 Andreas Jaeger <aj@arthur.rhein-neckar.de>
* stdio-common/test_rdwr.c (main): Use %Zu for size_t in printf
format strings.
* stdio-common/bug1.c (main): Likewise.
* stdio-common/bug5.c (main): Likewise.
* stdio-common/tstgetln.c (main): Likewise.
* elf/sprof.c (generate_call_graph): Likewise.
(load_shobj): Likewise.
* posix/runptests.c (main): Likewise.
* string/tst-strlen.c (main): Likewise.
* sysdeps/libm-ieee754/e_acos.c (__ieee754_acos): Remove unused
variable q3.
* sysdeps/libm-ieee754/e_asin.c (__ieee754_asin): Likewise
1998-07-03 Andreas Jaeger <aj@arthur.rhein-neckar.de>
* wctype/Versions: Add __towctrans.
Noticed by Alex Buell <alex.buell@tahallah.demon.co.uk>.
1998-07-02 Mark Kettenis <kettenis@phys.uva.nl>
* grp/initgroups.c (compat_call): Only call dynamically loaded
functions if they are really present.
1998-07-02 Mark Kettenis <kettenis@phys.uva.nl>
* sysdeps/unix/sysv/linux/bits/sched.h: Move __END_DECLS within
#ifdef that contains __BEGIN_DECLS.
1998-07-02 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* libio/iofwrite.c: Fix return value when size == 0.
1998-07-01 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* posix/Makefile (distribute): Add annexc.c.
(generated): Add $(objpfx)annexc and $(objpfx)annexc.out.
1998-07-01 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/unix/sysv/linux/Makefile (sysdep_headers): Add
bits/pthreadtypes.h here, and do not clobber headers.
* sysdeps/unix/sysv/linux/Dist: Add bits/pthreadtypes.h.
1998-07-03 Andreas Jaeger <aj@arthur.rhein-neckar.de>
* timezone/tst-timezone.c: Add tests for tzname variable.
1998-07-03 12:17 Zack Weinberg <zack@rabi.phys.columbia.edu>
* Makefile [versioning=yes]: Build the mapfiles with a pattern
rule that lists all of them as targets.
(sysd-versions): Depend only on Versions.def. Write a Makefile
fragment that defines $(vers-libs) based on contents of that file;
then include it.
(lib-noranlib): Depend on lib-mapfiles not sysd-versions.
(lib-mapfiles): New target, depends on sysd-versions and $(vers-libs).
Predicate all this on avoid-generated unset as well as versioning.
1998-07-03 14:35 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>