]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Updated to fedora-glibc-20050620T1530
authorJakub Jelinek <jakub@redhat.com>
Mon, 20 Jun 2005 15:59:03 +0000 (15:59 +0000)
committerJakub Jelinek <jakub@redhat.com>
Mon, 20 Jun 2005 15:59:03 +0000 (15:59 +0000)
173 files changed:
ChangeLog
config.h.in
config.make.in
configure
configure.in
debug/pread64_chk.c
dlfcn/dlerror.c
elf/dl-deps.c
elf/dl-error.c
elf/dl-libc.c
elf/dl-open.c
elf/elf.h
elf/rtld.c
elf/tls-macros.h
fedora/branch.mk
gmon/gmon.c
hesiod/README.hesiod
hesiod/hesiod.c
hesiod/hesiod_p.h
include/dlfcn.h
include/execinfo.h
include/libintl.h
include/string.h
intl/dcgettext.c
linuxthreads/ChangeLog
linuxthreads/sysdeps/unix/sysv/linux/mips/vfork.S
linuxthreads/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
linuxthreads/sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S
locale/Makefile
localedata/ChangeLog
localedata/locales/pa_IN
nptl/ChangeLog
nptl/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
nptl/tst-cancel4.c
nscd/Makefile
nscd/selinux.c
posix/tst-mmap.c
sysdeps/alpha/div_libc.h
sysdeps/alpha/divl.S
sysdeps/alpha/divq.S
sysdeps/alpha/divqu.S
sysdeps/alpha/dl-dtprocnum.h [new file with mode: 0644]
sysdeps/alpha/dl-machine.h
sysdeps/alpha/dl-trampoline.S
sysdeps/alpha/elf/start.S
sysdeps/alpha/htonl.S
sysdeps/alpha/htons.S
sysdeps/alpha/reml.S
sysdeps/alpha/remq.S
sysdeps/alpha/remqu.S
sysdeps/generic/backtrace.c
sysdeps/generic/backtracesymsfd.c
sysdeps/generic/elf/backtracesymsfd.c
sysdeps/generic/ldsodefs.h
sysdeps/generic/strnlen.c
sysdeps/i386/backtrace.c
sysdeps/i386/i386-mcount.S
sysdeps/i386/sysdep.h
sysdeps/ia64/backtrace.c
sysdeps/ia64/fpu/e_lgamma_r.c
sysdeps/ia64/fpu/e_lgammaf_r.c
sysdeps/ia64/fpu/e_lgammal_r.c
sysdeps/ia64/fpu/w_lgamma.c
sysdeps/ia64/fpu/w_lgammaf.c
sysdeps/ia64/fpu/w_lgammal.c
sysdeps/ia64/strchr.S
sysdeps/mach/hurd/readdir64_r.c
sysdeps/mach/hurd/sigaltstack.c
sysdeps/mach/i386/syscall.S
sysdeps/posix/posix_fallocate64.c
sysdeps/posix/sigignore.c
sysdeps/posix/signal.c
sysdeps/posix/sigset.c
sysdeps/posix/sysv_signal.c
sysdeps/powerpc/fpu/libm-test-ulps
sysdeps/powerpc/fpu/s_fabs.S
sysdeps/powerpc/fpu/s_fmax.S
sysdeps/powerpc/fpu/s_fmin.S
sysdeps/powerpc/powerpc32/backtrace.c
sysdeps/powerpc/powerpc32/configure [new file with mode: 0644]
sysdeps/powerpc/powerpc32/configure.in [new file with mode: 0644]
sysdeps/powerpc/powerpc32/dl-dtprocnum.h [new file with mode: 0644]
sysdeps/powerpc/powerpc32/dl-machine.h
sysdeps/powerpc/powerpc32/dl-start.S
sysdeps/powerpc/powerpc32/elf/start.S
sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S
sysdeps/powerpc/powerpc32/fpu/s_ceil.S
sysdeps/powerpc/powerpc32/fpu/s_ceilf.S
sysdeps/powerpc/powerpc32/fpu/s_copysign.S
sysdeps/powerpc/powerpc32/fpu/s_floor.S
sysdeps/powerpc/powerpc32/fpu/s_floorf.S
sysdeps/powerpc/powerpc32/fpu/s_lround.S
sysdeps/powerpc/powerpc32/fpu/s_rint.S
sysdeps/powerpc/powerpc32/fpu/s_rintf.S
sysdeps/powerpc/powerpc32/fpu/s_round.S
sysdeps/powerpc/powerpc32/fpu/s_roundf.S
sysdeps/powerpc/powerpc32/fpu/s_trunc.S
sysdeps/powerpc/powerpc32/fpu/s_truncf.S
sysdeps/powerpc/powerpc32/fpu/setjmp-common.S
sysdeps/powerpc/powerpc32/memset.S
sysdeps/powerpc/powerpc32/ppc-mcount.S
sysdeps/powerpc/powerpc32/sysdep.h
sysdeps/powerpc/powerpc64/backtrace.c
sysdeps/powerpc/powerpc64/fpu/s_copysign.S
sysdeps/s390/s390-32/backtrace.c
sysdeps/s390/s390-32/s390-mcount.S
sysdeps/s390/s390-64/backtrace.c
sysdeps/s390/s390-64/s390x-mcount.S
sysdeps/sparc/sparc32/memset.S
sysdeps/sparc/sparc32/stpcpy.S
sysdeps/sparc/sparc32/strchr.S
sysdeps/sparc/sparc64/memcmp.S
sysdeps/sparc/sparc64/memcpy.S
sysdeps/sparc/sparc64/memset.S
sysdeps/sparc/sparc64/sparcv9b/memcpy.S
sysdeps/unix/clock_gettime.c
sysdeps/unix/sysv/linux/alpha/bits/fcntl.h
sysdeps/unix/sysv/linux/alpha/bits/resource.h
sysdeps/unix/sysv/linux/alpha/clone.S
sysdeps/unix/sysv/linux/alpha/getcontext.S
sysdeps/unix/sysv/linux/alpha/getrusage.S
sysdeps/unix/sysv/linux/alpha/setcontext.S
sysdeps/unix/sysv/linux/alpha/sigsuspend.S
sysdeps/unix/sysv/linux/alpha/swapcontext.S
sysdeps/unix/sysv/linux/alpha/syscall.S
sysdeps/unix/sysv/linux/bits/resource.h
sysdeps/unix/sysv/linux/hppa/clone.S
sysdeps/unix/sysv/linux/i386/getcontext.S
sysdeps/unix/sysv/linux/i386/makecontext.S
sysdeps/unix/sysv/linux/i386/setcontext.S
sysdeps/unix/sysv/linux/i386/swapcontext.S
sysdeps/unix/sysv/linux/i386/sysdep.h
sysdeps/unix/sysv/linux/ia64/getcontext.S
sysdeps/unix/sysv/linux/ia64/setcontext.S
sysdeps/unix/sysv/linux/if_index.c
sysdeps/unix/sysv/linux/ifaddrs.c
sysdeps/unix/sysv/linux/mips/bits/resource.h
sysdeps/unix/sysv/linux/mips/clone.S
sysdeps/unix/sysv/linux/mips/vfork.S
sysdeps/unix/sysv/linux/netinet/if_tr.h
sysdeps/unix/sysv/linux/netlinkaccess.h
sysdeps/unix/sysv/linux/powerpc/powerpc32/brk.S
sysdeps/unix/sysv/linux/powerpc/powerpc32/ftruncate64.c
sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext.S
sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext.S
sysdeps/unix/sysv/linux/powerpc/powerpc32/socket.S
sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext.S
sysdeps/unix/sysv/linux/powerpc/powerpc32/truncate64.c
sysdeps/unix/sysv/linux/powerpc/powerpc64/makecontext.S
sysdeps/unix/sysv/linux/readdir64.c
sysdeps/unix/sysv/linux/readdir64_r.c
sysdeps/unix/sysv/linux/s390/s390-32/getcontext.S
sysdeps/unix/sysv/linux/s390/s390-32/setcontext.S
sysdeps/unix/sysv/linux/s390/s390-32/swapcontext.S
sysdeps/unix/sysv/linux/s390/s390-64/getcontext.S
sysdeps/unix/sysv/linux/s390/s390-64/setcontext.S
sysdeps/unix/sysv/linux/s390/s390-64/swapcontext.S
sysdeps/unix/sysv/linux/sleep.c
sysdeps/unix/sysv/linux/sparc/bits/resource.h
sysdeps/unix/sysv/linux/sparc/sparc32/clone.S
sysdeps/unix/sysv/linux/sparc/sparc64/clone.S
sysdeps/unix/sysv/linux/sparc/sparc64/getcontext.S
sysdeps/unix/sysv/linux/sparc/sparc64/longjmp.S
sysdeps/unix/sysv/linux/sys/quota.h
sysdeps/unix/sysv/linux/sysctl.c
sysdeps/unix/sysv/linux/system.c
sysdeps/unix/sysv/linux/wordsize-64/getdents.c
sysdeps/unix/sysv/linux/x86_64/getcontext.S
sysdeps/unix/sysv/linux/x86_64/makecontext.c
sysdeps/unix/sysv/linux/x86_64/setcontext.S
sysdeps/unix/sysv/linux/x86_64/swapcontext.S
sysdeps/x86_64/_mcount.S
time/mktime.c

index 6188d1cd31501f14300a7cd497e29510930d9bd4..47224b74cc1b736aaf01fd32d55c8a4a417f9176 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,9 +1,358 @@
+2005-06-20  Jakub Jelinek  <jakub@redhat.com>
+
+       * sysdeps/unix/sysv/linux/sys/quota.h: Add definitions and types for
+       _LINUX_QUOTA_VERSION >= 2.
+       (_LINUX_QUOTA_VERSION): Define if not yet defined.
+
+       * sysdeps/unix/sysv/linux/bits/resource.h (RLIMIT_NICE,
+       RLIMIT_RTPRIO): Add.
+       (RLIMIT_NLIMITS): Adjust.
+       * sysdeps/unix/sysv/linux/alpha/bits/resource.h (RLIMIT_NICE,
+       RLIMIT_RTPRIO): Add.
+       (RLIMIT_NLIMITS): Adjust.
+       * sysdeps/unix/sysv/linux/mips/bits/resource.h (RLIMIT_NICE,
+       RLIMIT_RTPRIO): Add.
+       (RLIMIT_NLIMITS): Adjust.
+       * sysdeps/unix/sysv/linux/sparc/bits/resource.h (RLIMIT_NICE,
+       RLIMIT_RTPRIO): Add.
+       (RLIMIT_NLIMITS): Adjust.
+
+2005-06-17  Ulrich Drepper  <drepper@redhat.com>
+
+       * time/mktime.c: Always include <string.h> for prototype of
+       implicitly used memcpy.
+
+       * sysdeps/unix/sysv/linux/powerpc/powerpc32/truncate64.c
+       (truncate64): Use __truncate, not truncate.
+       (__have_no_truncate64): Renamed from have_no_truncate64.
+       * sysdeps/unix/sysv/linux/powerpc/powerpc32/ftruncate64.c
+       (__have_no_truncate64): Renamed from have_no_truncate64.
+
+       * sysdeps/powerpc/fpu/libm-test-ulps: Adjust ulps for complex
+       float functions for gcc 4.
+
+2005-06-10  Jakub Jelinek  <jakub@redhat.com>
+
+       * sysdeps/powerpc/powerpc32/dl-machine.h (elf_machine_runtime_setup):
+       Handle prelinked libraries and binaries with new style PLT.
+
+2005-06-07  Jakub Jelinek  <jakub@redhat.com>
+
+       * elf/elf.h (R_PPC_REL16, R_PPC_REL16_LO, R_PPC_REL16_HI,
+       R_PPC_REL16_HA): Define.
+
+2005-06-14  Alan Modra  <amodra@bigpond.net.au>
+
+       * config.h.in (HAVE_ASM_PPC_REL16): Add.
+       * elf/elf.h (DT_PPC_GOT, DT_PPC_NUM): Define.
+       * elf/tls-macros.h (PowerPC32): Include config.h.  Add variants of
+       TLS_IE, TLS_LD and TLS_GD for new PLT/GOT layout.
+       * sysdeps/powerpc/powerpc32/configure.in: New file,
+       * sysdeps/powerpc/powerpc32/dl-dtprocnum.h: New file.
+       * sysdeps/powerpc/powerpc32/dl-machine.h (DT_PPC): Define.
+       (ppc_got): New inline function.
+       (elf_machine_dynamic): Use ppc_got.  Add attribute const.
+       (elf_machine_load_address): Add attribute const.  Don't use int vars.
+       Use bcl rather than bl to save trashing branch target stack.  Use
+       elf_machine_dynamic rather than duplicating code here.
+       (elf_machine_runtime_setup): New inline function replacing define.
+       Handle new PLT.
+       (elf_machine_fixup_plt): Handle new PLT.
+       (elf_machine_rela): Likewise.
+       * sysdeps/powerpc/powerpc32/sysdep.h: Include config.h.
+       (CALL_MCOUNT): Don't set up counter vars.
+       * sysdeps/powerpc/powerpc32/ppc-mcount.S: Correct comment.
+       * sysdeps/powerpc/powerpc32/elf/start.S (start_addressesp): Don't
+       define when HAVE_ASM_PPC_REL16.
+       (_start): Add HAVE_ASM_PPC_REL16 code.
+       * sysdeps/powerpc/powerpc32/dl-start.S (_dl_start_user): Don't bl
+       into the GOT when HAVE_ASM_PPC_REL16.
+       * sysdeps/powerpc/powerpc32/memset.S (memset): Likewise.
+       * sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S (__longjmp): Ditto.
+       * sysdeps/powerpc/powerpc32/fpu/s_ceil.S (__ceil): Likewise.
+       * sysdeps/powerpc/powerpc32/fpu/s_ceilf.S (__ceilf): Likewise.
+       * sysdeps/powerpc/powerpc32/fpu/s_floor.S (__floor): Likewise.
+       * sysdeps/powerpc/powerpc32/fpu/s_floorf.S (__floorf): Likewise.
+       * sysdeps/powerpc/powerpc32/fpu/s_lround.S (__lround): Likewise.
+       * sysdeps/powerpc/powerpc32/fpu/s_rint.S (__rint): Likewise.
+       * sysdeps/powerpc/powerpc32/fpu/s_rintf.S (__rintf): Likewise.
+       * sysdeps/powerpc/powerpc32/fpu/s_round.S (__round): Likewise.
+       * sysdeps/powerpc/powerpc32/fpu/s_roundf.S (__roundf): Likewise.
+       * sysdeps/powerpc/powerpc32/fpu/s_trunc.S (__trunc): Likewise.
+       * sysdeps/powerpc/powerpc32/fpu/s_truncf.S (__truncf): Likewise.
+       * sysdeps/powerpc/powerpc32/fpu/setjmp-common.S (__sigsetjmp):
+       Likewise.
+       * sysdeps/unix/sysv/linux/powerpc/powerpc32/brk.S (__brk): Likewise.
+       * sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext.S
+       (__getcontext): Likewise.
+       * sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext.S
+       (__setcontext): Likewise.
+       * sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext.S
+       (__swapcontext): Likewise.
+       * sysdeps/unix/sysv/linux/powerpc/powerpc32/socket.S (stackblock):
+       Comment.
+       (__socket): Bomb if NARGS >= 7.  Invoke CGOTSETUP and CGOTRESTORE.
+
+2005-06-17  Ulrich Drepper  <drepper@redhat.com>
+
+       * sysdeps/posix/sigignore.c: Include <string.h> to tell the compiler
+       to use __GI_memset.
+       * sysdeps/posix/signal.c: Likewise.
+       * sysdeps/posix/sigset.c: Likewise.
+       * sysdeps/posix/sysv_signal.c: Likewise.
+       * sysdeps/unix/sysv/linux/sleep.c: Likewise.
+       * sysdeps/unix/sysv/linux/sysctl.c: Likewise.
+       * sysdeps/unix/sysv/linux/system.c: Likewise.
+
+2005-06-15  Jakub Jelinek  <jakub@redhat.com>
+
+       * hesiod/hesiod.c (hesiod_init): Don't check for ctx->classes[0] == 0
+       or both classes equal here.
+       (parse_config_file): If both classes are equal, clear the second one.
+
+2005-06-08  Karl Kelley  <kekelley@iastate.edu>
+
+       * hesiod/hesiod_p.h (struct hesiod_p): Add classes array.
+       * hesiod/hesiod.c (hesiod_init): Initialize classes.  Fail if no
+       valid classes were given or if both are equal.
+       (hesiod_resolve): Use ctx->classes instead of hardcoded C_IN
+       and C_HS order.
+       (parse_config_file): Handle classes keyword.
+       * hesiod/README.hesiod: Mention addition of the classes keyword.
+
+2005-06-14  Ulrich Drepper  <drepper@redhat.com>
+
+       * configure.in: Add test for availability of libaudit.
+       * config.h.in: Define HAVE_LIBAUDIT.
+       * config.make.in: Define have-libaudit.
+       * nscd/Makefile: If libaudit is available, link nscd with it.
+       * nscd/selinux.c: If HAVE_LIBAUDIT is defined, log using libaudit.
+       Patch by Steve Grubb <sgrubb@redhat.com>.
+
+       * debug/pread64_chk.c: Use __libc_pread64 instead of __pread64.
+       * sysdeps/posix/posix_fallocate64.c: Likewise.
+       * include/string.h: Use libc_hidden_proto for strnlen.
+       * sysdeps/generic/strnlen.c: Add libc_hidden_def.
+       * include/libintl.h: Use libc_hidden_proto for __dcgettext.
+       * intl/dcgettext.c: Add libc_hidden_def.
+       * include/execinfo.h: Add libc_hidden_proto for __backtrace and
+       __backtrace_symbols_fd.
+       * sysdeps/generic/backtrace.c: Add libc_hidden_def.
+       * sysdeps/generic/backtracesymsfd.c: Likewise.
+       * sysdeps/generic/elf/backtracesymsfd.c: Likewise.
+       * sysdeps/i386/backtrace.c: Likewise.
+       * sysdeps/ia64/backtrace.c: Likewise.
+       * sysdeps/powerpc/powerpc32/backtrace.c: Likewise.
+       * sysdeps/powerpc/powerpc64/backtrace.c: Likewise.
+       * sysdeps/s390/s390-32/backtrace.c: Likewise.
+       * sysdeps/s390/s390-64/backtrace.c: Likewise.
+
+2005-06-13  Ulrich Drepper  <drepper@redhat.com>
+
+       * sysdeps/unix/clock_gettime.c (clock_gettime): Implement case
+       where HANDLED_REALTIME is not defined.  [BZ #966]
+
+2005-06-13  Jakub Jelinek  <jakub@redhat.com>
+
+       * sysdeps/unix/sysv/linux/netlinkaccess.h (__netlink_sendreq,
+       __netlink_receive): Remove prototypes.
+       (__netlink_request): New prototype.
+       * sysdeps/unix/sysv/linux/ifaddrs.c: Include <alloca.h> and
+       <stdint.h>.
+       (__netlink_sendreq): Make static.
+       (__netlink_receive): Rename to...
+       (__netlink_request): ... this.  Add type argument, call
+       __netlink_sendreq.  If MSG_TRUNC is set after recvmsg, retry
+       with a bigger buffer.  Don't record buffers that contain no
+       messages we are expecting.
+       (getifaddrs): Use __netlink_request instead of __netlink_sendreq
+       and __netlink_receive pairs.  Formatting.
+       * sysdeps/unix/sysv/linux/if_index.c (if_nameindex_netlink): Use
+       __netlink_request instead of __netlink_sendreq and __netlink_receive
+       pair.
+
+2005-06-13  Thorsten Kukuk  <kukuk@suse.de>
+
+       * sysdeps/unix/sysv/linux/netinet/if_tr.h: Don't include kernel
+       headers, instead copy important structs/defines.
+
+2005-06-13  Jakub Jelinek  <jakub@redhat.com>
+
+       * elf/rtld.c (dl_main): Move DT_DEBUG setup before first
+       _dl_debug_state call.
+
+2005-06-12  Ulrich Drepper  <drepper@redhat.com>
+
+       * elf/dl-error.c (_dl_signal_error): Store information about use of
+       real malloc in the catch object.
+       (_dl_catch_error): Forward information about malloc use to caller
+       in new parameter.
+       (_dl_out_of_memory): Make static.
+       * elf/dl-deps.c: Adjust callers of _dl_catch_error.
+       * elf/dl-libc.c: Likewise.
+       * elf/dl-open.c: Likewise.
+       * elf/rtld.c: Likewise.
+       Add new --audit option.
+       * sysdeps/generic/ldsodefs.h: Remove _dl_out_of_memory declaration.
+       (rtld_global_ro._dl_signal_error): Add new parameter.
+       * include/dlfcn.h (_dl_catch_error): Add new parameter.
+       * dlfcn/dlfcn.c (_dlerror_run): Pass additional parameter to
+       _dl_catch_error.  Only free if the returned newly value says so.
+
+2005-06-01  Roland McGrath  <roland@redhat.com>
+
+       [BZ #959]
+       * posix/tst-mmap.c (main): Fill the test file with enough data for the
+       page size.
+
 2005-05-30  Jakub Jelinek  <jakub@redhat.com>
 
        * sysdeps/unix/sysv/linux/dl-osinfo.h (DL_SYSDEP_OSCHECK): If
        GLRO(dl_osversion) has been already set to a value smaller than
        _dl_discover_osversion (), don't overwrite it here.
 
+2005-05-24  Thomas Schwinge  <schwinge@nic-nac-project.de>
+
+       * sysdeps/mach/i386/syscall.S (syscall): Call END.
+
+2005-05-28  Richard Henderson  <rth@redhat.com>
+
+       * elf/elf.h (DT_ALPHA_PLTRO, DT_ALPHA_NUM): New.
+       * sysdeps/alpha/dl-dtprocnum.h: New file.
+       * sysdeps/alpha/dl-machine.h (DT_ALPHA): New.
+       (elf_machine_load_address): Simplify to rely on gprel relocations.
+       (elf_machine_runtime_setup): Handle DT_ALPHA_PLTRO plt format.
+       Remove thread safety workaround for binutils 2.6.
+       (elf_machine_fixup_plt): Handle DT_ALPHA_PLTRO plt format.
+       * sysdeps/alpha/dl-trampoline.S (_dl_runtime_resolve_new): New.
+       (_dl_runtime_profile_new): New.
+       (_dl_runtime_resolve_old): Rename from _dl_runtime_resolve.
+       (_dl_runtime_profile_old): Rename from _dl_runtime_profile.  Fix
+       typo in _dl_call_pltexit argument loading.
+
+       * sysdeps/alpha/div_libc.h (funcnoplt): New.
+       * sysdeps/alpha/divl.S: Use it.
+       * sysdeps/alpha/divq.S: Likewise
+       * sysdeps/alpha/divqu.S: Likewise.
+       * sysdeps/alpha/reml.S: Likewise.
+       * sysdeps/alpha/remq.S: Likewise.
+       * sysdeps/alpha/remqu.S: Likewise.
+
+2005-05-26  Andreas Schwab  <schwab@suse.de>
+
+       * locale/Makefile (CFLAGS-loadlocale.c): Don't define.
+
+2005-05-26  Ulrich Drepper  <drepper@redhat.com>
+
+       * sysdeps/unix/sysv/linux/alpha/bits/fcntl.h (O_DIRECT): Fix value.
+       Reported by Colin Gibbs <colin@gibbsonline.net>.  [BZ #954]
+
+2005-05-17  Alan Modra  <amodra@bigpond.net.au>
+
+       * sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S (__longjmp): Corrent
+       _dl_hwcap access in PIC && !SHARED case.
+       * sysdeps/powerpc/powerpc32/fpu/setjmp-common.S: Likewise.
+
+2005-05-25  Dwayne Grant McConnell  <dgm69@us.ibm.com>
+
+       * gmon/gmon.c: Add space in weak_alias use.
+       * linuxthreads/sysdeps/unix/sysv/linux/mips/vfork.S: Likewise.
+       * sysdeps/alpha/htonl.S: Likewise.
+       * sysdeps/alpha/htons.S: Likewise.
+       * sysdeps/alpha/elf/start.S: Likewise.
+       * sysdeps/i386/i386-mcount.S: Likewise.
+       * sysdeps/ia64/strchr.S: Likewise.
+       * sysdeps/ia64/fpu/e_lgamma_r.c: Likewise.
+       * sysdeps/ia64/fpu/e_lgamma_r.c: Likewise.
+       * sysdeps/ia64/fpu/e_lgammaf_r.c: Likewise.
+       * sysdeps/ia64/fpu/e_lgammaf_r.c: Likewise.
+       * sysdeps/ia64/fpu/e_lgammal_r.c: Likewise.
+       * sysdeps/ia64/fpu/e_lgammal_r.c: Likewise.
+       * sysdeps/ia64/fpu/w_lgamma.c: Likewise.
+       * sysdeps/ia64/fpu/w_lgamma.c: Likewise.
+       * sysdeps/ia64/fpu/w_lgammaf.c: Likewise.
+       * sysdeps/ia64/fpu/w_lgammaf.c: Likewise.
+       * sysdeps/ia64/fpu/w_lgammal.c: Likewise.
+       * sysdeps/ia64/fpu/w_lgammal.c: Likewise.
+       * sysdeps/mach/hurd/readdir64_r.c: Likewise.
+       * sysdeps/mach/hurd/sigaltstack.c: Likewise.
+       * sysdeps/powerpc/fpu/s_fabs.S: Likewise.
+       * sysdeps/powerpc/fpu/s_fabs.S: Likewise.
+       * sysdeps/powerpc/fpu/s_fabs.S: Likewise.
+       * sysdeps/powerpc/fpu/s_fabs.S: Likewise.
+       * sysdeps/powerpc/fpu/s_fmax.S: Likewise.
+       * sysdeps/powerpc/fpu/s_fmax.S: Likewise.
+       * sysdeps/powerpc/fpu/s_fmax.S: Likewise.
+       * sysdeps/powerpc/fpu/s_fmax.S: Likewise.
+       * sysdeps/powerpc/fpu/s_fmin.S: Likewise.
+       * sysdeps/powerpc/fpu/s_fmin.S: Likewise.
+       * sysdeps/powerpc/fpu/s_fmin.S: Likewise.
+       * sysdeps/powerpc/fpu/s_fmin.S: Likewise.
+       * sysdeps/powerpc/powerpc32/fpu/s_copysign.S: Likewise.
+       * sysdeps/powerpc/powerpc32/fpu/s_copysign.S: Likewise.
+       * sysdeps/powerpc/powerpc32/fpu/s_copysign.S: Likewise.
+       * sysdeps/powerpc/powerpc64/fpu/s_copysign.S: Likewise.
+       * sysdeps/powerpc/powerpc64/fpu/s_copysign.S: Likewise.
+       * sysdeps/powerpc/powerpc64/fpu/s_copysign.S: Likewise.
+       * sysdeps/s390/s390-32/s390-mcount.S: Likewise.
+       * sysdeps/s390/s390-64/s390x-mcount.S: Likewise.
+       * sysdeps/sparc/sparc32/memset.S: Likewise.
+       * sysdeps/sparc/sparc32/stpcpy.S: Likewise.
+       * sysdeps/sparc/sparc32/strchr.S: Likewise.
+       * sysdeps/sparc/sparc32/strchr.S: Likewise.
+       * sysdeps/sparc/sparc64/memcmp.S: Likewise.
+       * sysdeps/sparc/sparc64/memcpy.S: Likewise.
+       * sysdeps/sparc/sparc64/memcpy.S: Likewise.
+       * sysdeps/sparc/sparc64/memset.S: Likewise.
+       * sysdeps/sparc/sparc64/sparcv9b/memcpy.S: Likewise.
+       * sysdeps/sparc/sparc64/sparcv9b/memcpy.S: Likewise.
+       * sysdeps/sparc/sparc64/sparcv9b/memcpy.S: Likewise.
+       * sysdeps/sparc/sparc64/sparcv9b/memcpy.S: Likewise.
+       * sysdeps/sparc/sparc64/sparcv9b/memcpy.S: Likewise.
+       * sysdeps/unix/sysv/linux/alpha/clone.S: Likewise.
+       * sysdeps/unix/sysv/linux/alpha/getcontext.S: Likewise.
+       * sysdeps/unix/sysv/linux/alpha/getrusage.S: Likewise.
+       * sysdeps/unix/sysv/linux/alpha/setcontext.S: Likewise.
+       * sysdeps/unix/sysv/linux/alpha/sigsuspend.S: Likewise.
+       * sysdeps/unix/sysv/linux/alpha/swapcontext.S: Likewise.
+       * sysdeps/unix/sysv/linux/alpha/syscall.S: Likewise.
+       * sysdeps/unix/sysv/linux/readdir64.c: Likewise.
+       * sysdeps/unix/sysv/linux/readdir64_r.c: Likewise.
+       * sysdeps/unix/sysv/linux/hppa/clone.S: Likewise.
+       * sysdeps/unix/sysv/linux/i386/getcontext.S: Likewise.
+       * sysdeps/unix/sysv/linux/i386/makecontext.S: Likewise.
+       * sysdeps/unix/sysv/linux/i386/setcontext.S: Likewise.
+       * sysdeps/unix/sysv/linux/i386/swapcontext.S: Likewise.
+       * sysdeps/unix/sysv/linux/ia64/getcontext.S: Likewise.
+       * sysdeps/unix/sysv/linux/ia64/setcontext.S: Likewise.
+       * sysdeps/unix/sysv/linux/mips/clone.S: Likewise.
+       * sysdeps/unix/sysv/linux/mips/vfork.S: Likewise.
+       * sysdeps/unix/sysv/linux/powerpc/powerpc64/makecontext.S: Likewise.
+       * sysdeps/unix/sysv/linux/s390/s390-32/getcontext.S: Likewise.
+       * sysdeps/unix/sysv/linux/s390/s390-32/setcontext.S: Likewise.
+       * sysdeps/unix/sysv/linux/s390/s390-32/swapcontext.S: Likewise.
+       * sysdeps/unix/sysv/linux/s390/s390-64/getcontext.S: Likewise.
+       * sysdeps/unix/sysv/linux/s390/s390-64/setcontext.S: Likewise.
+       * sysdeps/unix/sysv/linux/s390/s390-64/swapcontext.S: Likewise.
+       * sysdeps/unix/sysv/linux/sparc/sparc32/clone.S: Likewise.
+       * sysdeps/unix/sysv/linux/sparc/sparc64/clone.S: Likewise.
+       * sysdeps/unix/sysv/linux/sparc/sparc64/getcontext.S: Likewise.
+       * sysdeps/unix/sysv/linux/sparc/sparc64/longjmp.S: Likewise.
+       * sysdeps/unix/sysv/linux/sparc/sparc64/longjmp.S: Likewise.
+       * sysdeps/unix/sysv/linux/sparc/sparc64/longjmp.S: Likewise.
+       * sysdeps/unix/sysv/linux/wordsize-64/getdents.c: Likewise.
+       * sysdeps/unix/sysv/linux/x86_64/getcontext.S: Likewise.
+       * sysdeps/unix/sysv/linux/x86_64/makecontext.c: Likewise.
+       * sysdeps/unix/sysv/linux/x86_64/setcontext.S: Likewise.
+       * sysdeps/unix/sysv/linux/x86_64/swapcontext.S: Likewise.
+       * sysdeps/x86_64/_mcount.S: Likewise.
+
+2005-05-24  Roland McGrath  <roland@redhat.com>
+
+       * sysdeps/unix/sysv/linux/i386/sysdep.h
+       (SETUP_PIC_REG, LOAD_PIC_REG): Move these macros ...
+       * sysdeps/i386/sysdep.h [PIC]: ... to here.
+
 2005-05-23  Roland McGrath  <roland@redhat.com>
 
        * sysdeps/arm, sysdeps/unix/arm, sysdeps/unix/sysv/linux/arm:
index db3defc6b09502bab86879329c46c1eab0acbce4..70e67bb912c3508d96f31ec954f2b85e415966f2 100644 (file)
@@ -21,6 +21,9 @@
 /* Define if building with SELinux support.  Set by --with-selinux.  */
 #undef HAVE_SELINUX
 
+/* Defined if building with SELinux support & audit libs are detected. */
+#undef HAVE_LIBAUDIT
+
 /* Define if using XCOFF. Set by --with-xcoff.  */
 #undef HAVE_XCOFF
 
 /* Define if inlined system calls are available.  */
 #undef HAVE_INLINED_SYSCALLS
 
+/* Define if your assembler and linker support R_PPC_REL16* relocs.  */
+#undef HAVE_ASM_PPC_REL16
+
 /*
 \f */
 
index 1bd025e97ee89eeed47ecb926aa776d36a4bdb02..1ab4bfbfc427fae170d267729eb18098ac474a0a 100644 (file)
@@ -59,6 +59,7 @@ enable-check-abi = @enable_check_abi@
 have-forced-unwind = @libc_cv_forced_unwind@
 have-fpie = @libc_cv_fpie@
 have-selinux = @have_selinux@
+have-libaudit = @have_libaudit@
 have-cc-with-libunwind = @libc_cv_cc_with_libunwind@
 fno-unit-at-a-time = @fno_unit_at_a_time@
 bind-now = @bindnow@
index cb86530899942a3a876de71b64ed647a16ea0f8c..8c978e7512bb5a7a3eb0cc452f79e31e525400b3 100755 (executable)
--- a/configure
+++ b/configure
@@ -313,7 +313,7 @@ ac_includes_default="\
 # include <unistd.h>
 #endif"
 
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS with_fp with_cvs enable_check_abi oldest_abi bindnow force_install all_warnings build build_cpu build_vendor build_os host host_cpu host_vendor host_os subdirs add_ons base_machine sysnames INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC OBJEXT BUILD_CC cross_compiling CPP CXX CXXFLAGS ac_ct_CXX AR OBJDUMP RANLIB ac_ct_RANLIB MIG AS LD PWD_P MAKE MSGFMT MAKEINFO SED AUTOCONF SYSINCLUDES libc_cv_gcc_static_libgcc BASH libc_cv_have_bash2 KSH libc_cv_have_ksh AWK PERL INSTALL_INFO BISON VERSIONING libc_cv_asm_protected_directive libc_cv_initfinit_array libc_cv_cc_with_libunwind libc_cv_z_nodelete libc_cv_z_nodlopen libc_cv_z_initfirst libc_cv_z_relro libc_cv_Bgroup libc_cv_libgcc_s_suffix libc_cv_as_needed ASFLAGS_config libc_cv_z_combreloc libc_cv_z_execstack libc_cv_fpie fno_unit_at_a_time libc_cv_have_initfini no_whole_archive exceptions LIBGD have_selinux EGREP sizeof_long_double libc_cv_gcc_unwind_find_fde uname_sysname uname_release uname_version old_glibc_headers libc_cv_slibdir libc_cv_localedir libc_cv_sysconfdir libc_cv_rootsbindir libc_cv_forced_unwind use_ldconfig ldd_rewrite_script gnu_ld gnu_as elf xcoff static shared pic_default profile omitfp bounded static_nss nopic_initfini DEFINES mach_interface_list VERSION RELEASE LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS with_fp with_cvs enable_check_abi oldest_abi bindnow force_install all_warnings build build_cpu build_vendor build_os host host_cpu host_vendor host_os subdirs add_ons base_machine sysnames INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC OBJEXT BUILD_CC cross_compiling CPP CXX CXXFLAGS ac_ct_CXX AR OBJDUMP RANLIB ac_ct_RANLIB MIG AS LD PWD_P MAKE MSGFMT MAKEINFO SED AUTOCONF SYSINCLUDES libc_cv_gcc_static_libgcc BASH libc_cv_have_bash2 KSH libc_cv_have_ksh AWK PERL INSTALL_INFO BISON VERSIONING libc_cv_asm_protected_directive libc_cv_initfinit_array libc_cv_cc_with_libunwind libc_cv_z_nodelete libc_cv_z_nodlopen libc_cv_z_initfirst libc_cv_z_relro libc_cv_Bgroup libc_cv_libgcc_s_suffix libc_cv_as_needed ASFLAGS_config libc_cv_z_combreloc libc_cv_z_execstack libc_cv_fpie fno_unit_at_a_time libc_cv_have_initfini no_whole_archive exceptions LIBGD have_libaudit have_selinux EGREP sizeof_long_double libc_cv_gcc_unwind_find_fde uname_sysname uname_release uname_version old_glibc_headers libc_cv_slibdir libc_cv_localedir libc_cv_sysconfdir libc_cv_rootsbindir libc_cv_forced_unwind use_ldconfig ldd_rewrite_script gnu_ld gnu_as elf xcoff static shared pic_default profile omitfp bounded static_nss nopic_initfini DEFINES mach_interface_list VERSION RELEASE LIBOBJS LTLIBOBJS'
 ac_subst_files=''
 
 # Initialize some variables set by options.
@@ -1924,7 +1924,6 @@ fi
 test -n "$base_machine" || case "$machine" in
 a29k | am29000)        base_machine=a29k machine=a29k ;;
 alpha*)                base_machine=alpha machine=alpha/$machine ;;
-arm*)          base_machine=arm machine=arm/arm32/$machine ;;
 c3[012])       base_machine=cx0 machine=cx0/c30 ;;
 c4[04])                base_machine=cx0 machine=cx0/c40 ;;
 hppa*64*)      base_machine=hppa machine=hppa/hppa64 ;;
@@ -1980,7 +1979,6 @@ sparc64)
                base_machine=sparc machine=sparc/sparc64 ;;
 sparc64b)
                base_machine=sparc machine=sparc/sparc64/sparcv9b ;;
-thumb*)                base_machine=thumb machine=arm/thumb/$machine ;;
 *)             base_machine=$machine ;;
 esac
 
@@ -6731,6 +6729,86 @@ cat >>confdefs.h <<\_ACEOF
 #define HAVE_SELINUX 1
 _ACEOF
 
+
+  # See if we have the libaudit library
+  echo "$as_me:$LINENO: checking for audit_log_avc in -laudit" >&5
+echo $ECHO_N "checking for audit_log_avc in -laudit... $ECHO_C" >&6
+if test "${ac_cv_lib_audit_audit_log_avc+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-laudit  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char audit_log_avc ();
+int
+main ()
+{
+audit_log_avc ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_audit_audit_log_avc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_audit_audit_log_avc=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_audit_audit_log_avc" >&5
+echo "${ECHO_T}$ac_cv_lib_audit_audit_log_avc" >&6
+if test $ac_cv_lib_audit_audit_log_avc = yes; then
+  have_libaudit=yes
+else
+  have_libaudit=no
+fi
+
+  if test "x$have_libaudit" = xyes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LIBAUDIT 1
+_ACEOF
+
+  fi
+
 fi
 
 
@@ -8343,6 +8421,7 @@ s,@libc_cv_have_initfini@,$libc_cv_have_initfini,;t t
 s,@no_whole_archive@,$no_whole_archive,;t t
 s,@exceptions@,$exceptions,;t t
 s,@LIBGD@,$LIBGD,;t t
+s,@have_libaudit@,$have_libaudit,;t t
 s,@have_selinux@,$have_selinux,;t t
 s,@EGREP@,$EGREP,;t t
 s,@sizeof_long_double@,$sizeof_long_double,;t t
index 503611a6b9da90803760c9e6a58b3179ce2f74bc..5f46b5e4ef86b96fdf2c3d6100df617cffec257f 100644 (file)
@@ -1938,6 +1938,14 @@ fi
 # Check if we're building with SELinux support.
 if test "x$have_selinux" = xyes; then
   AC_DEFINE(HAVE_SELINUX,1,[SELinux support])
+
+  # See if we have the libaudit library
+  AC_CHECK_LIB(audit, audit_log_avc,
+              have_libaudit=yes, have_libaudit=no)
+  if test "x$have_libaudit" = xyes; then
+    AC_DEFINE(HAVE_LIBAUDIT,1,[SELinux libaudit support])
+  fi
+  AC_SUBST(have_libaudit)
 fi
 AC_SUBST(have_selinux)
 
index c0e0efdf85e3a95fe681e683860c1650ac9b02eb..9db18947650eb7800c3c2c8b0dbcd6e15e6c4064 100644 (file)
@@ -26,6 +26,6 @@ __pread64_chk (int fd, void *buf, size_t nbytes, off64_t offset, size_t buflen)
   if (nbytes > buflen)
     __chk_fail ();
 
-  return __pread64 (fd, buf, nbytes, offset);
+  return __libc_pread64 (fd, buf, nbytes, offset);
 }
 #endif
index 1254381f2ba64c368785f1af7dee223c4e14a7c2..7ea31d4392860fab3f4df6a81e361701720989db 100644 (file)
@@ -19,6 +19,7 @@
 
 #include <dlfcn.h>
 #include <libintl.h>
+#include <stdbool.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -40,6 +41,7 @@ struct dl_action_result
   {
     int errcode;
     int returned;
+    bool malloced;
     const char *objname;
     const char *errstring;
   };
@@ -154,13 +156,13 @@ _dlerror_run (void (*operate) (void *), void *args)
     {
       /* Free the error string from the last failed command.  This can
         happen if `dlerror' was not run after an error was found.  */
-      if (strcmp (result->errstring, "out of memory") != 0)
+      if (result->malloced)
        free ((char *) result->errstring);
       result->errstring = NULL;
     }
 
   result->errcode = GLRO(dl_catch_error) (&result->objname, &result->errstring,
-                                         operate, args);
+                                         &result->malloced, operate, args);
 
   /* If no error we mark that no error string is available.  */
   result->returned = result->errstring == NULL;
index 50d7a0e71c0d9005fd5423ca029343466762e1e1..a73e21db7bc3423d6b1146f4f258e38aa1445d8c 100644 (file)
@@ -235,16 +235,22 @@ _dl_map_object_deps (struct link_map *map,
              {
                /* Map in the needed object.  */
                struct link_map *dep;
-               int err;
 
                /* Recognize DSTs.  */
                name = expand_dst (l, strtab + d->d_un.d_val, 0);
                /* Store the tag in the argument structure.  */
                args.name = name;
 
-               err = _dl_catch_error (&objname, &errstring, openaux, &args);
+               bool malloced;
+               int err = _dl_catch_error (&objname, &errstring, &malloced,
+                                          openaux, &args);
                if (__builtin_expect (errstring != NULL, 0))
                  {
+                   char *new_errstring = strdupa (errstring);
+                   if (malloced)
+                     free ((char *) errstring);
+                   errstring = new_errstring;
+
                    if (err)
                      errno_reason = err;
                    else
@@ -288,8 +294,6 @@ _dl_map_object_deps (struct link_map *map,
 
                if (d->d_tag == DT_AUXILIARY)
                  {
-                   int err;
-
                    /* Say that we are about to load an auxiliary library.  */
                    if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_LIBS,
                                          0))
@@ -301,13 +305,14 @@ _dl_map_object_deps (struct link_map *map,
 
                    /* We must be prepared that the addressed shared
                       object is not available.  */
-                   err = _dl_catch_error (&objname, &errstring, openaux,
-                                          &args);
+                   bool malloced;
+                   (void) _dl_catch_error (&objname, &errstring, &malloced,
+                                           openaux, &args);
                    if (__builtin_expect (errstring != NULL, 0))
                      {
                        /* We are not interested in the error message.  */
                        assert (errstring != NULL);
-                       if (errstring != _dl_out_of_memory)
+                       if (malloced)
                          free ((char *) errstring);
 
                        /* Simply ignore this error and continue the work.  */
@@ -316,8 +321,6 @@ _dl_map_object_deps (struct link_map *map,
                  }
                else
                  {
-                   int err;
-
                    /* Say that we are about to load an auxiliary library.  */
                    if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_LIBS,
                                          0))
@@ -328,10 +331,16 @@ _dl_map_object_deps (struct link_map *map,
                                        ? l->l_name : rtld_progname);
 
                    /* For filter objects the dependency must be available.  */
-                   err = _dl_catch_error (&objname, &errstring, openaux,
-                                          &args);
+                   bool malloced;
+                   int err = _dl_catch_error (&objname, &errstring, &malloced,
+                                              openaux, &args);
                    if (__builtin_expect (errstring != NULL, 0))
                      {
+                       char *new_errstring = strdupa (errstring);
+                       if (malloced)
+                         free ((char *) errstring);
+                       errstring = new_errstring;
+
                        if (err)
                          errno_reason = err;
                        else
index 993b7c29abf18c647b27a9b8802b6c73922031e0..a63d801411e5504c8d8fc0bda03fd9faa7c81937 100644 (file)
@@ -19,6 +19,7 @@
 
 #include <libintl.h>
 #include <setjmp.h>
+#include <stdbool.h>
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
@@ -30,6 +31,8 @@ struct catch
   {
     const char *objname;       /* Object/File name.  */
     const char *errstring;     /* Error detail filled in here.  */
+    bool malloced;             /* Nonzero if the string is malloced
+                                  by the libc malloc.  */
     jmp_buf env;               /* longjmp here on error.  */
   };
 
@@ -44,8 +47,7 @@ struct catch
 /* This message we return as a last resort.  We define the string in a
    variable since we have to avoid freeing it and so have to enable
    a pointer comparison.  See below and in dlfcn/dlerror.c.  */
-const char _dl_out_of_memory[] = "out of memory";
-rtld_hidden_data_def (_dl_out_of_memory)
+static const char _dl_out_of_memory[] = "out of memory";
 
 
 /* This points to a function which is called when an continuable error is
@@ -87,15 +89,27 @@ _dl_signal_error (int errcode, const char *objname, const char *occation,
 
       lcatch->errstring = (char *) malloc (len_objname + len_errstring);
       if (lcatch->errstring != NULL)
-       /* Make a copy of the object file name and the error string.  */
-       lcatch->objname = memcpy (__mempcpy ((char *) lcatch->errstring,
-                                            errstring, len_errstring),
-                                 objname, len_objname);
+       {
+         /* Make a copy of the object file name and the error string.  */
+         lcatch->objname = memcpy (__mempcpy ((char *) lcatch->errstring,
+                                              errstring, len_errstring),
+                                   objname, len_objname);
+
+         /* If the main executable is relocated it means the libc's malloc
+            is used.  */
+#ifdef SHARED
+         lcatch->malloced = (GL(dl_ns)[LM_ID_BASE]._ns_loaded->l_relocated
+                             != 0);
+#else
+         lcatch->malloced = true;
+#endif
+       }
       else
        {
          /* This is better than nothing.  */
          lcatch->objname = "";
          lcatch->errstring = _dl_out_of_memory;
+         lcatch->malloced = false;
        }
       longjmp (lcatch->env, errcode ?: -1);
     }
@@ -140,7 +154,7 @@ _dl_signal_cerror (int errcode, const char *objname, const char *occation,
 int
 internal_function
 _dl_catch_error (const char **objname, const char **errstring,
-                void (*operate) (void *), void *args)
+                bool *mallocedp, void (*operate) (void *), void *args)
 {
   int errcode;
   struct catch *volatile old;
@@ -162,6 +176,7 @@ _dl_catch_error (const char **objname, const char **errstring,
       *catchp = old;
       *objname = NULL;
       *errstring = NULL;
+      *mallocedp = false;
       return 0;
     }
 
@@ -169,6 +184,7 @@ _dl_catch_error (const char **objname, const char **errstring,
   *catchp = old;
   *objname = c.objname;
   *errstring = c.errstring;
+  *mallocedp = c.malloced;
   return errcode == -1 ? 0 : errcode;
 }
 
index 5e76069139eb5886c70c8a0605ab0e2e21faf0f9..1b995eda92ce263588d8a539a326e6527682c836 100644 (file)
@@ -1,5 +1,5 @@
 /* Handle loading and unloading shared objects for internal libc purposes.
-   Copyright (C) 1999, 2000, 2001, 2002, 2004 Free Software Foundation, Inc.
+   Copyright (C) 1999,2000,2001,2002,2004,2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Zack Weinberg <zack@rabi.columbia.edu>, 1999.
 
@@ -42,12 +42,13 @@ dlerror_run (void (*operate) (void *), void *args)
 {
   const char *objname;
   const char *last_errstring = NULL;
-  int result;
+  bool malloced;
 
-  (void) GLRO(dl_catch_error) (&objname, &last_errstring, operate, args);
+  (void) GLRO(dl_catch_error) (&objname, &last_errstring, &malloced,
+                              operate, args);
 
-  result = last_errstring != NULL;
-  if (result && last_errstring != _dl_out_of_memory)
+  int result = last_errstring != NULL;
+  if (result && malloced)
     free ((char *) last_errstring);
 
   return result;
index a65690e5a390f55adbcf86a72bcbd8affceb4355..984f4a4ec65fefc75e9fc5b322245705ad042682 100644 (file)
@@ -504,11 +504,6 @@ void *
 _dl_open (const char *file, int mode, const void *caller_dlopen, Lmid_t nsid,
          int argc, char *argv[], char *env[])
 {
-  struct dl_open_args args;
-  const char *objname;
-  const char *errstring;
-  int errcode;
-
   if ((mode & RTLD_BINDING_MASK) == 0)
     /* One of the flags must be set.  */
     _dl_signal_error (EINVAL, file, NULL, N_("invalid mode for dlopen()"));
@@ -543,6 +538,7 @@ no more namespaces available for dlmopen()"));
     _dl_signal_error (EINVAL, file, NULL,
                      N_("invalid target namespace in dlmopen()"));
 
+  struct dl_open_args args;
   args.file = file;
   args.mode = mode;
   args.caller_dlopen = caller_dlopen;
@@ -552,7 +548,12 @@ no more namespaces available for dlmopen()"));
   args.argc = argc;
   args.argv = argv;
   args.env = env;
-  errcode = _dl_catch_error (&objname, &errstring, dl_open_worker, &args);
+
+  const char *objname;
+  const char *errstring;
+  bool malloced;
+  int errcode = _dl_catch_error (&objname, &errstring, &malloced,
+                                dl_open_worker, &args);
 
 #ifndef MAP_COPY
   /* We must munmap() the cache file.  */
@@ -603,7 +604,7 @@ no more namespaces available for dlmopen()"));
          memcpy (local_errstring, errstring, len_errstring);
        }
 
-      if (errstring != _dl_out_of_memory)
+      if (malloced)
        free ((char *) errstring);
 
       assert (_dl_debug_initialize (0, args.nsid)->r_state == RT_CONSISTENT);
index e246519fabe019b53bb572d2af89ec2f744e11d5..a09d279dbfe63aeea9d063d86152b5eb69a16c3b 100644 (file)
--- a/elf/elf.h
+++ b/elf/elf.h
@@ -1866,6 +1866,9 @@ typedef Elf32_Addr Elf32_Conflict;
 #define LITUSE_ALPHA_TLS_GD    4
 #define LITUSE_ALPHA_TLS_LDM   5
 
+/* Legal values for d_tag of Elf64_Dyn.  */
+#define DT_ALPHA_PLTRO         0x70000000
+#define DT_ALPHA_NUM           1
 
 /* PowerPC specific declarations */
 
@@ -1976,10 +1979,19 @@ typedef Elf32_Addr Elf32_Conflict;
 #define R_PPC_DIAB_RELSDA_HI   184     /* like EMB_RELSDA, but high 16 bit */
 #define R_PPC_DIAB_RELSDA_HA   185     /* like EMB_RELSDA, adjusted high 16 */
 
+/* GNU relocs used in PIC code sequences.  */
+#define R_PPC_REL16            249     /* word32   (sym-.) */
+#define R_PPC_REL16_LO         250     /* half16   (sym-.)@l */
+#define R_PPC_REL16_HI         251     /* half16   (sym-.)@h */
+#define R_PPC_REL16_HA         252     /* half16   (sym-.)@ha */
+
 /* This is a phony reloc to handle any old fashioned TOC16 references
    that may still be in object files.  */
 #define R_PPC_TOC16            255
 
+/* PowerPC specific values for the Dyn d_tag field.  */
+#define DT_PPC_GOT             (DT_LOPROC + 0)
+#define DT_PPC_NUM             1
 
 /* PowerPC64 relocations defined by the ABIs */
 #define R_PPC64_NONE           R_PPC_NONE
index b7f16f7b375020c8374a5cd9f28b4a4f5f07ee6e..a3dbb867f3f09a3d37c7bfaea4835e11211eda19 100644 (file)
@@ -61,6 +61,9 @@ static void print_missing_version (int errcode, const char *objname,
 /* Print the various times we collected.  */
 static void print_statistics (hp_timing_t *total_timep);
 
+/* Add audit objects.  */
+static void process_dl_audit (char *str);
+
 /* This is a list of all the modes the dynamic loader can be in.  */
 enum mode { normal, list, verify, trace };
 
@@ -771,6 +774,7 @@ do_preload (char *fname, struct link_map *main_map, const char *where)
   const char *objname;
   const char *err_str = NULL;
   struct map_args args;
+  bool malloced;
 
   args.str = fname;
   args.loader = main_map;
@@ -779,7 +783,7 @@ do_preload (char *fname, struct link_map *main_map, const char *where)
 
   unsigned int old_nloaded = GL(dl_ns)[LM_ID_BASE]._ns_nloaded;
 
-  (void) _dl_catch_error (&objname, &err_str, map_doit, &args);
+  (void) _dl_catch_error (&objname, &err_str, &malloced, map_doit, &args);
   if (__builtin_expect (err_str != NULL, 0))
     {
       _dl_error_printf ("\
@@ -923,6 +927,14 @@ dl_main (const ElfW(Phdr) *phdr,
          {
            GLRO(dl_inhibit_rpath) = INTUSE(_dl_argv)[2];
 
+           _dl_skip_args += 2;
+           _dl_argc -= 2;
+           INTUSE(_dl_argv) += 2;
+         }
+       else if (! strcmp (INTUSE(_dl_argv)[1], "--audit") && _dl_argc > 2)
+         {
+           process_dl_audit (INTUSE(_dl_argv)[2]);
+
            _dl_skip_args += 2;
            _dl_argc -= 2;
            INTUSE(_dl_argv) += 2;
@@ -983,12 +995,14 @@ of this helper program; chances are you did not intend to run this program.\n\
          const char *objname;
          const char *err_str = NULL;
          struct map_args args;
+         bool malloced;
 
          args.str = rtld_progname;
          args.loader = NULL;
          args.is_preloaded = 0;
          args.mode = __RTLD_OPENEXEC;
-         (void) _dl_catch_error (&objname, &err_str, map_doit, &args);
+         (void) _dl_catch_error (&objname, &err_str, &malloced, map_doit,
+                                 &args);
          if (__builtin_expect (err_str != NULL, 0))
            /* We don't free the returned string, the programs stops
               anyway.  */
@@ -1451,14 +1465,17 @@ ld.so does not support TLS, but program uses it!\n");
 
          const char *objname;
          const char *err_str = NULL;
-         (void) _dl_catch_error (&objname, &err_str, dlmopen_doit, &dlmargs);
+         bool malloced;
+         (void) _dl_catch_error (&objname, &err_str, &malloced, dlmopen_doit,
+                                 &dlmargs);
          if (__builtin_expect (err_str != NULL, 0))
            {
            not_loaded:
              _dl_error_printf ("\
 ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
                                al->name, err_str);
-             free ((char *) err_str);
+             if (malloced)
+               free ((char *) err_str);
            }
          else
            {
@@ -1467,7 +1484,8 @@ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
              largs.map = dlmargs.map;
 
              /* Check whether the interface version matches.  */
-             (void) _dl_catch_error (&objname, &err_str, lookup_doit, &largs);
+             (void) _dl_catch_error (&objname, &err_str, &malloced,
+                                     lookup_doit, &largs);
 
              unsigned int (*laversion) (unsigned int);
              unsigned int lav;
@@ -1508,8 +1526,8 @@ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
                  do
                    {
                      largs.name = cp;
-                     (void) _dl_catch_error (&objname, &err_str, lookup_doit,
-                                             &largs);
+                     (void) _dl_catch_error (&objname, &err_str, &malloced,
+                                             lookup_doit, &largs);
 
                      /* Store the pointer.  */
                      if (err_str == NULL && largs.result != NULL)
@@ -1593,6 +1611,23 @@ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
        }
     }
 
+  /* Set up debugging before the debugger is notified for the first time.  */
+#ifdef ELF_MACHINE_DEBUG_SETUP
+  /* Some machines (e.g. MIPS) don't use DT_DEBUG in this way.  */
+  ELF_MACHINE_DEBUG_SETUP (main_map, r);
+  ELF_MACHINE_DEBUG_SETUP (&GL(dl_rtld_map), r);
+#else
+  if (main_map->l_info[DT_DEBUG] != NULL)
+    /* There is a DT_DEBUG entry in the dynamic section.  Fill it in
+       with the run-time address of the r_debug structure  */
+    main_map->l_info[DT_DEBUG]->d_un.d_ptr = (ElfW(Addr)) r;
+
+  /* Fill in the pointer in the dynamic linker's own dynamic section, in
+     case you run gdb on the dynamic linker directly.  */
+  if (GL(dl_rtld_map).l_info[DT_DEBUG] != NULL)
+    GL(dl_rtld_map).l_info[DT_DEBUG]->d_un.d_ptr = (ElfW(Addr)) r;
+#endif
+
   /* We start adding objects.  */
   r->r_state = RT_ADD;
   _dl_debug_state ();
@@ -2162,30 +2197,6 @@ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
     }
 
 
-  {
-    struct link_map *l = main_map;
-
-#ifdef ELF_MACHINE_DEBUG_SETUP
-
-    /* Some machines (e.g. MIPS) don't use DT_DEBUG in this way.  */
-
-    ELF_MACHINE_DEBUG_SETUP (l, r);
-    ELF_MACHINE_DEBUG_SETUP (&GL(dl_rtld_map), r);
-
-#else
-
-    if (l->l_info[DT_DEBUG] != NULL)
-      /* There is a DT_DEBUG entry in the dynamic section.  Fill it in
-        with the run-time address of the r_debug structure  */
-      l->l_info[DT_DEBUG]->d_un.d_ptr = (ElfW(Addr)) r;
-
-    /* Fill in the pointer in the dynamic linker's own dynamic section, in
-       case you run gdb on the dynamic linker directly.  */
-    if (GL(dl_rtld_map).l_info[DT_DEBUG] != NULL)
-      GL(dl_rtld_map).l_info[DT_DEBUG]->d_un.d_ptr = (ElfW(Addr)) r;
-#endif
-  }
-
   /* Now set up the variable which helps the assembler startup code.  */
   GL(dl_ns)[LM_ID_BASE]._ns_main_searchlist = &main_map->l_searchlist;
   GL(dl_ns)[LM_ID_BASE]._ns_global_scope[0] = &main_map->l_searchlist;
index 0ae9e65dc00e3fb00f5f0bd401587e01f9b3df18..37cbe7514f71a37f479c8a53b666f17f4a605767 100644 (file)
@@ -703,6 +703,8 @@ register void *__gp __asm__("$29");
 
 #elif defined __powerpc__ && !defined __powerpc64__
 
+#include "config.h"
+
 # define __TLS_CALL_CLOBBERS                                           \
        "0", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12",       \
        "lr", "ctr", "cr0", "cr1", "cr5", "cr6", "cr7"
@@ -715,7 +717,20 @@ register void *__gp __asm__("$29");
      __result; })
 
 /* PowerPC32 Initial Exec TLS access.  */
-# define TLS_IE(x)                                     \
+# ifdef HAVE_ASM_PPC_REL16
+#  define TLS_IE(x)                                    \
+  ({ int *__result;                                    \
+     asm ("bcl 20,31,1f\n1:\t"                         \
+         "mflr %0\n\t"                                 \
+         "addis %0,%0,_GLOBAL_OFFSET_TABLE_-1b@ha\n\t" \
+         "addi %0,%0,_GLOBAL_OFFSET_TABLE_-1b@l\n\t"   \
+         "lwz %0," #x "@got@tprel(%0)\n\t"             \
+         "add %0,%0," #x "@tls"                        \
+         : "=b" (__result) :                           \
+         : "lr");                                      \
+     __result; })
+# else
+#  define TLS_IE(x)                                    \
   ({ int *__result;                                    \
      asm ("bl _GLOBAL_OFFSET_TABLE_@local-4\n\t"       \
          "mflr %0\n\t"                                 \
@@ -724,9 +739,24 @@ register void *__gp __asm__("$29");
          : "=b" (__result) :                           \
          : "lr");                                      \
      __result; })
+# endif
 
 /* PowerPC32 Local Dynamic TLS access.  */
-# define TLS_LD(x)                                     \
+# ifdef HAVE_ASM_PPC_REL16
+#  define TLS_LD(x)                                    \
+  ({ int *__result;                                    \
+     asm ("bcl 20,31,1f\n1:\t"                         \
+         "mflr 3\n\t"                                  \
+         "addis 3,3,_GLOBAL_OFFSET_TABLE_-1b@ha\n\t"   \
+         "addi 3,3,_GLOBAL_OFFSET_TABLE_-1b@l\n\t"     \
+         "addi 3,3," #x "@got@tlsld\n\t"               \
+         "bl __tls_get_addr@plt\n\t"                   \
+         "addi %0,3," #x "@dtprel"                     \
+         : "=r" (__result) :                           \
+         : __TLS_CALL_CLOBBERS);                       \
+     __result; })
+# else
+#  define TLS_LD(x)                                    \
   ({ int *__result;                                    \
      asm ("bl _GLOBAL_OFFSET_TABLE_@local-4\n\t"       \
          "mflr 3\n\t"                                  \
@@ -736,9 +766,23 @@ register void *__gp __asm__("$29");
          : "=r" (__result) :                           \
          : __TLS_CALL_CLOBBERS);                       \
      __result; })
+# endif
 
 /* PowerPC32 General Dynamic TLS access.  */
-# define TLS_GD(x)                                     \
+# ifdef HAVE_ASM_PPC_REL16
+#  define TLS_GD(x)                                    \
+  ({ register int *__result __asm__ ("r3");            \
+     asm ("bcl 20,31,1f\n1:\t"                         \
+         "mflr 3\n\t"                                  \
+         "addis 3,3,_GLOBAL_OFFSET_TABLE_-1b@ha\n\t"   \
+         "addi 3,3,_GLOBAL_OFFSET_TABLE_-1b@l\n\t"     \
+         "addi 3,3," #x "@got@tlsgd\n\t"               \
+         "bl __tls_get_addr@plt"                       \
+         : :                                           \
+         : __TLS_CALL_CLOBBERS);                       \
+     __result; })
+# else
+#  define TLS_GD(x)                                    \
   ({ register int *__result __asm__ ("r3");            \
      asm ("bl _GLOBAL_OFFSET_TABLE_@local-4\n\t"       \
          "mflr 3\n\t"                                  \
@@ -747,6 +791,7 @@ register void *__gp __asm__("$29");
          : :                                           \
          : __TLS_CALL_CLOBBERS);                       \
      __result; })
+# endif
 
 #elif defined __powerpc__ && defined __powerpc64__
 
index 022b255fbb51abcccc2751ecc11318ddd56fff99..90bf380a3c5a9383e8f7eb4b4a21bf0d5833762a 100644 (file)
@@ -1,5 +1,5 @@
 # This file is updated automatically by Makefile.
 glibc-branch := fedora
 glibc-base := HEAD
-fedora-sync-date := 2005-05-24 16:06 UTC
-fedora-sync-tag := fedora-glibc-20050524T1606
+fedora-sync-date := 2005-06-20 15:30 UTC
+fedora-sync-tag := fedora-glibc-20050620T1530
index 575adbcd8b7190394010fc0b18b50cfc3ef5d81d..8eb073619319022559e34894cda21abfe702a3ab 100644 (file)
@@ -171,7 +171,7 @@ __monstartup (lowpc, highpc)
 
   __moncontrol(1);
 }
-weak_alias(__monstartup, monstartup)
+weak_alias (__monstartup, monstartup)
 
 
 static void
index 18cd5d45dd4ddf567a434aa3bd40ffb711993d17..259ce8d44756619176b7476240a4264c61202074 100644 (file)
@@ -71,6 +71,14 @@ will want to create your own.  It should look something like:
 
   rhs=.your.domain
   lhs=.ns
+  classes=in,hs
+
+The optional classes settings specifies which DNS classes Hesiod
+should do lookups in.  Possible values are IN (the preferred class)
+and  HS (the deprecated class, still used by some sites).
+You may specify both classes separated by a comma to try one class
+first and then the other if no entry is available in the first
+class.  The default value of the classes variable is `IN,HS'.
 
 The value of rhs can be overridden by the environment variable
 `HES_DOMAIN'.
index 7fffb310f1a741733c3e2dc6cb9dd108d025be91..b73aa3ce94ed2edbeae7b967a60f0774e14d0f93 100644 (file)
@@ -83,6 +83,9 @@ hesiod_init(void **context) {
        ctx->LHS = NULL;
        ctx->RHS = NULL;
        ctx->res = NULL;
+       /* Set default query classes. */
+       ctx->classes[0] = C_IN;
+       ctx->classes[1] = C_HS;
 
        configname = __secure_getenv("HESIOD_CONFIG");
        if (!configname)
@@ -234,15 +237,12 @@ hesiod_resolve(void *context, const char *name, const char *type) {
                return (NULL);
        }
 
-       if ((retvec = get_txt_records(ctx, C_IN, bindname))) {
-               free(bindname);
-               return (retvec);
-       }
+       retvec = get_txt_records(ctx, ctx->classes[0], bindname);
+
+       if (retvec == NULL && (errno == ENOENT || errno == ECONNREFUSED) && ctx->classes[1])
+               retvec = get_txt_records(ctx, ctx->classes[1], bindname);
 
-       if (errno != ENOENT && errno != ECONNREFUSED)
-               return (NULL);
 
-       retvec = get_txt_records(ctx, C_HS, bindname);
        free(bindname);
        return (retvec);
 }
@@ -261,7 +261,6 @@ hesiod_free_list(void *context, char **list) {
  */
 static int
 parse_config_file(struct hesiod_p *ctx, const char *filename) {
-       char *key, *data, *cp, **cpp;
        char buf[MAXDNAME+7];
        FILE *fp;
 
@@ -272,6 +271,9 @@ parse_config_file(struct hesiod_p *ctx, const char *filename) {
        free(ctx->RHS);
        free(ctx->LHS);
        ctx->RHS = ctx->LHS = 0;
+       /* Set default query classes. */
+       ctx->classes[0] = C_IN;
+       ctx->classes[1] = C_HS;
 
        /*
         * Now open and parse the file...
@@ -280,6 +282,8 @@ parse_config_file(struct hesiod_p *ctx, const char *filename) {
                return (-1);
 
        while (fgets(buf, sizeof(buf), fp) != NULL) {
+               char *key, *data, *cp, **cpp;
+
                cp = buf;
                if (*cp == '#' || *cp == '\n' || *cp == '\r')
                        continue;
@@ -297,17 +301,36 @@ parse_config_file(struct hesiod_p *ctx, const char *filename) {
                        cp++;
                *cp++ = '\0';
 
-               if (strcmp(key, "lhs") == 0)
+               cpp = NULL;
+               if (strcasecmp(key, "lhs") == 0)
                        cpp = &ctx->LHS;
-               else if (strcmp(key, "rhs") == 0)
+               else if (strcasecmp(key, "rhs") == 0)
                        cpp = &ctx->RHS;
-               else
-                       continue;
-
-               *cpp = malloc(strlen(data) + 1);
-               if (!*cpp)
-                       goto cleanup;
-               strcpy(*cpp, data);
+               if (cpp) {
+                       *cpp = strdup(data);
+                       if (!*cpp)
+                               goto cleanup;
+               } else if (strcasecmp(key, "classes") == 0) {
+                       int n = 0;
+                       while (*data && n < 2) {
+                               cp = strchrnul(data, ',');
+                               if (*cp != '\0')
+                                       *cp++ = '\0';
+                               if (strcasecmp(data, "IN") == 0)
+                                       ctx->classes[n++] = C_IN;
+                               else if (strcasecmp(data, "HS") == 0)
+                                       ctx->classes[n++] = C_HS;
+                               data = cp;
+                       }
+                       if (n == 0) {
+                               /* Restore the default.  Better than
+                                  nother at all.  */
+                               ctx->classes[0] = C_IN;
+                               ctx->classes[1] = C_HS;
+                       } else if (n == 1
+                                  || ctx->classes[0] == ctx->classes[1])
+                               ctx->classes[1] = 0;
+               }
        }
        fclose(fp);
        return (0);
index 71aca0976d54a68e57b7f0f8bd2e0889555c1275..5010d71bc91879c46e3ece62d951d442835fb9af 100644 (file)
@@ -41,6 +41,7 @@ struct hesiod_p {
        void            (*res_set)(struct hesiod_p *, struct __res_state *,
                                   void (*)(void *));
        struct __res_state * (*res_get)(struct hesiod_p *);
+       int             classes[2];     /* The class search order. */
 };
 
 #define MAX_HESRESP    1024
index 460c037ed1aac4e22df13fd87edda1f52c2fafdb..9144dd2f3fb368d30a4e68eaf5dc4cf33f7ddded 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _DLFCN_H
 #include <dlfcn/dlfcn.h>
 #include <link.h>              /* For ElfW.  */
+#include <stdbool.h>
 
 /* Internally used flag.  */
 #define __RTLD_DLOPEN  0x80000000
@@ -67,9 +68,10 @@ extern void *_dl_vsym (void *handle, const char *name, const char *version,
    and the error code passed is the return value and *OBJNAME is set to
    the object name which experienced the problems.  ERRSTRING if nonzero
    points to a malloc'ed string which the caller has to free after use.
-   ARGS is passed as argument to OPERATE.  */
+   ARGS is passed as argument to OPERATE.  MALLOCEDP is set to true only
+   if the returned string is allocated using the libc's malloc.  */
 extern int _dl_catch_error (const char **objname, const char **errstring,
-                           void (*operate) (void *),
+                           bool *mallocedp, void (*operate) (void *),
                            void *args)
      internal_function;
 
index 143a9cc4ce3382d7e3ff8f2d15416ef8c10ac40c..840a0818cba4bc204eab1cd184c73a80531a386e 100644 (file)
@@ -2,10 +2,12 @@
 #include <debug/execinfo.h>
 
 extern int __backtrace (void **__array, int __size);
+libc_hidden_proto (__backtrace)
 
 extern char **__backtrace_symbols (void *__const *__array, int __size);
 
 extern void __backtrace_symbols_fd (void *__const *__array, int __size,
                                    int __fd);
+libc_hidden_proto (__backtrace_symbols_fd)
 
 #endif
index 20083d42649d61c484a31b18253bac1183846d0d..8875c9444f431b1871aca6ca54c32a4e7b6518c5 100644 (file)
@@ -11,6 +11,7 @@ extern char *__dgettext (__const char *__domainname,
 extern char *__dcgettext (__const char *__domainname,
                          __const char *__msgid, int __category)
      __attribute_format_arg__ (2);
+libc_hidden_proto (__dcgettext)
 extern char *__dcgettext_internal (__const char *__domainname,
                                   __const char *__msgid, int __category)
      __attribute_format_arg__ (2)
index 738dd8e27c83b0a1b3ac40acc80c663cc32a7d1d..532d5ed33300a07a826838dc5449a4f08554d700 100644 (file)
@@ -96,6 +96,7 @@ libc_hidden_builtin_proto (strcmp)
 libc_hidden_builtin_proto (strcpy)
 libc_hidden_builtin_proto (strcspn)
 libc_hidden_builtin_proto (strlen)
+libc_hidden_builtin_proto (strnlen)
 libc_hidden_builtin_proto (strncmp)
 libc_hidden_builtin_proto (strncpy)
 libc_hidden_builtin_proto (strpbrk)
index 55f81eb8874a5db40dfa17c37ef79d4efbd6b29d..edf98b69735d674be4075373b4df3b6c61dabd73 100644 (file)
@@ -1,5 +1,5 @@
 /* Implementation of the dcgettext(3) function.
-   Copyright (C) 1995-1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+   Copyright (C) 1995-2002, 2005 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
@@ -57,4 +57,5 @@ DCGETTEXT (domainname, msgid, category)
 /* Alias for function name in GNU C Library.  */
 INTDEF(__dcgettext)
 weak_alias (__dcgettext, dcgettext);
+libc_hidden_def (__dcgettext)
 #endif
index 1ae8d3fd3a0be8e7e73dea4ce93da2b07a2e5fc2..d952f9c1646dff6b64423fcf64cffafc8a013c51 100644 (file)
@@ -1,3 +1,12 @@
+2005-06-14  Alan Modra  <amodra@bigpond.net.au>
+
+       * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
+       Invoke CGOTSETUP and CGOTRESTORE.
+       (CGOTSETUP, CGOTRESTORE): Define.
+       (SINGLE_THREAD_P): Add variant for new PLT/GOT layout.
+       * sysdeps/unix/sysv/linux/powerpc/powerpc32/vfork.S (__vfork): Avoid
+       bl into the GOT when HAVE_ASM_PPC_REL16.
+
 2005-05-30  Jakub Jelinek  <jakub@redhat.com>
 
        * man/Makefile (SOURCES): Remove all man pages but
index bf541439b54624a6c970b68f9e7b40f1589fd860..7bbab5c59c2fdc0aac36be39aa5f851ddef94ca2 100644 (file)
@@ -101,4 +101,4 @@ L(call_fork):
        END(__vfork)
 
 libc_hidden_def(__vfork)
-weak_alias(__vfork, vfork)
+weak_alias (__vfork, vfork)
index 2f7c546a4c62e917ad05a3bf7895f5fcb36db5ca..865da8e8ca92827829a94685a758eb61036e4c46 100644 (file)
@@ -37,6 +37,7 @@
     stwu 1,-48(1);                                                     \
     mflr 9;                                                            \
     stw 9,52(1);                                                       \
+    CGOTSETUP;                                                         \
     DOCARGS_##args;    /* save syscall args around CENABLE.  */        \
     CENABLE;                                                           \
     stw 3,16(1);       /* store CENABLE return value (MASK).  */       \
@@ -50,6 +51,7 @@
     lwz 4,52(1);                                                       \
     lwz 0,12(1);       /* restore CR/R3. */                            \
     lwz 3,8(1);                                                                \
+    CGOTRESTORE;                                                       \
     mtlr 4;                                                            \
     mtcr 0;                                                            \
     addi 1,1,48;
@@ -75,6 +77,9 @@
 # define DOCARGS_6     stw 8,40(1); DOCARGS_5
 # define UNDOCARGS_6   lwz 8,40(1); UNDOCARGS_5
 
+# define CGOTSETUP
+# define CGOTRESTORE
+
 # ifdef IS_IN_libpthread
 #  define CENABLE      bl __pthread_enable_asynccancel@local
 #  define CDISABLE     bl __pthread_disable_asynccancel@local
 # else
 #  define CENABLE      bl JUMPTARGET(__librt_enable_asynccancel)
 #  define CDISABLE     bl JUMPTARGET(__librt_disable_asynccancel)
+#  if defined HAVE_AS_REL16 && defined PIC
+#   undef CGOTSETUP
+#   define CGOTSETUP                                                   \
+    bcl 20,31,1f;                                                      \
+ 1: stw 30,44(1);                                                      \
+    mflr 30;                                                           \
+    addis 30,30,_GLOBAL_OFFSET_TABLE-1b@ha;                            \
+    addi 30,30,_GLOBAL_OFFSET_TABLE-1b@l
+#   undef CGOTRESTORE
+#   define CGOTRESTORE                                                 \
+    lwz 30,44(1)
+#  endif
 # endif
 
 # ifdef HAVE_TLS_SUPPORT
@@ -111,7 +128,17 @@ extern int __local_multiple_threads attribute_hidden;
   lwz 10,__local_multiple_threads@l(10);                               \
   cmpwi 10,0
 #   else
-#    define SINGLE_THREAD_P                                            \
+#    ifdef HAVE_ASM_PPC_REL16
+#     define SINGLE_THREAD_P                                           \
+  mflr 9;                                                              \
+  bcl 20,31,1f;                                                                \
+1:mflr 10;                                                             \
+  addis 10,10,__local_multiple_threads-1b@ha;                          \
+  lwz 10,__local_multiple_threads-1b@l(10);                            \
+  mtlr 9;                                                              \
+  cmpwi 10,0
+#    else
+#     define SINGLE_THREAD_P                                           \
   mflr 9;                                                              \
   bl _GLOBAL_OFFSET_TABLE_@local-4;                                    \
   mflr 10;                                                             \
@@ -119,6 +146,7 @@ extern int __local_multiple_threads attribute_hidden;
   lwz 10,__local_multiple_threads@got(10);                             \
   lwz 10,0(10);                                                                \
   cmpwi 10,0
+#    endif
 #   endif
 #  endif
 # endif
index 920c45eee26ad7fae08d6a88c6f638548ef87df7..724d4cc5410fba9c67acfed499be2e033c34a64e 100644 (file)
@@ -31,11 +31,19 @@ ENTRY (__vfork)
 #ifdef __NR_vfork
 # ifdef SHARED
        mflr    9
+#  ifdef HAVE_ASM_PPC_REL16
+       bcl     20,31,1f
+1:     mflr    10
+       addis   10,10,__libc_pthread_functions-1b@ha
+       lwz     10,__libc_pthread_functions-1b@l(10)
+       mtlr    9
+#  else
        bl      _GLOBAL_OFFSET_TABLE_@local-4
        mflr    10
        mtlr    9
        lwz     10,__libc_pthread_functions@got(10)
        lwz     10,0(10)
+#  endif
 # else
        .weak   pthread_create
        lis     10,pthread_create@ha
index b493c1c9b96c6caa45d12b7bf6aa5a77ee11329f..2f2d2ba5f1964d7dbe3bd46bcbdb673cc56c150e 100644 (file)
@@ -100,7 +100,6 @@ locale-CPPFLAGS := -DLOCALE_PATH='$(localepath)' \
 CFLAGS-charmap.c = -Wno-write-strings -Wno-char-subscripts
 CFLAGS-locfile.c = -Wno-write-strings -Wno-char-subscripts
 CFLAGS-charmap-dir.c = -Wno-write-strings
-CFLAGS-loadlocale.c = $(fno-unit-at-a-time)
 
 # This makes sure -DNOT_IN_libc is passed for all these modules.
 cpp-srcs-left := $(addsuffix .c,$(localedef-modules) $(localedef-aux) \
index d5b6cdd26ea4ec7e9a623c52a4fee57eb3c97a8b..d375eb62d9bb2b865630f921a83e993d89fc51f9 100644 (file)
@@ -1,3 +1,9 @@
+2005-05-28  Jakub Jelinek  <jakub@redhat.com>
+
+       [BZ #622]
+       * locales/pa_IN (am_pm): Fix typos.
+       Patch by Denis Barbier <barbier@linuxfr.org>.
+
 2005-05-22  Ulrich Drepper  <drepper@redhat.com>
 
        * locales/mn_MN: Update.  Patch by Sanlig Badral <s_badral@yahoo.com>.
index 96fa896e85bf7fba4a8f81986024e641b389ca2c..f7b0bf217371d768d4752462d5210aaaab5bcf08 100644 (file)
@@ -122,8 +122,8 @@ mon         "<U0A1C><U0A28><U0A35><U0A30><U0A40>";/
 
 %
 % Equivalent of AM PM
-am_pm       "<U0A38><U0035><U0A47><U0A30><U0A47>";/
-            "<U0A36><U0A3E><U002E>"
+am_pm       "<U0A38><U0A35><U0A47><U0A30><U0A47>";/
+            "<U0A36><U0A3E><U0A2E>"
 
 %
 % Appropriate date and time representation
index 0452afe8b569a92821627d180c678667d376aac5..470d4b9887d9755857463cf9d9edc2c020f95e4b 100644 (file)
@@ -1,3 +1,16 @@
+2005-06-14  Alan Modra  <amodra@bigpond.net.au>
+
+       * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h (PSEUDO):
+       Invoke CGOTSETUP and CGOTRESTORE.
+       (CGOTSETUP, CGOTRESTORE): Define.
+
+2005-05-29  Richard Henderson  <rth@redhat.com>
+
+       * tst-cancel4.c (WRITE_BUFFER_SIZE): New.
+       (tf_write, tf_writev): Use it.
+       (do_test): Use socketpair instead of pipe.  Set SO_SNDBUF to
+       the system minimum.
+
 2005-05-23  Jakub Jelinek  <jakub@redhat.com>
 
        * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep-cancel.h
index 393c171eef84f15768f0980bd66451facb2948c8..84acf3843437e368202648ff152f1573c2eb7e27 100644 (file)
@@ -45,6 +45,7 @@
     mflr 9;                                                            \
     stw 9,52(1);                                                       \
     cfi_offset (lr, 4);                                                        \
+    CGOTSETUP;                                                         \
     DOCARGS_##args;    /* save syscall args around CENABLE.  */        \
     CENABLE;                                                           \
     stw 3,16(1);       /* store CENABLE return value (MASK).  */       \
@@ -58,6 +59,7 @@
     lwz 4,52(1);                                                       \
     lwz 0,12(1);       /* restore CR/R3. */                            \
     lwz 3,8(1);                                                                \
+    CGOTRESTORE;                                                       \
     mtlr 4;                                                            \
     mtcr 0;                                                            \
     addi 1,1,48;                                                       \
@@ -84,6 +86,9 @@
 # define DOCARGS_6     stw 8,40(1); DOCARGS_5
 # define UNDOCARGS_6   lwz 8,40(1); UNDOCARGS_5
 
+# define CGOTSETUP
+# define CGOTRESTORE
+
 # ifdef IS_IN_libpthread
 #  define CENABLE      bl __pthread_enable_asynccancel@local
 #  define CDISABLE     bl __pthread_disable_asynccancel@local
 # elif defined IS_IN_librt
 #  define CENABLE      bl JUMPTARGET(__librt_enable_asynccancel)
 #  define CDISABLE     bl JUMPTARGET(__librt_disable_asynccancel)
+#  if defined HAVE_AS_REL16 && defined PIC
+#   undef CGOTSETUP
+#   define CGOTSETUP                                                   \
+    bcl 20,31,1f;                                                      \
+ 1: stw 30,44(1);                                                      \
+    mflr 30;                                                           \
+    addis 30,30,_GLOBAL_OFFSET_TABLE-1b@ha;                            \
+    addi 30,30,_GLOBAL_OFFSET_TABLE-1b@l
+#   undef CGOTRESTORE
+#   define CGOTRESTORE                                                 \
+    lwz 30,44(1)
+#  endif
 # else
 #  error Unsupported library
 # endif
index c3e527fd1cd40c9cfd7b503db4657a00055be134..cb7619688e26a8e414f0e04309e910cad95d4d39 100644 (file)
@@ -84,6 +84,8 @@ static pthread_barrier_t b2;
 # define IPC_ADDVAL 0
 #endif
 
+#define WRITE_BUFFER_SIZE 4096
+
 /* Cleanup handling test.  */
 static int cl_called;
 
@@ -220,7 +222,7 @@ tf_write  (void *arg)
   ssize_t s;
   pthread_cleanup_push (cl, NULL);
 
-  char buf[100000];
+  char buf[WRITE_BUFFER_SIZE];
   memset (buf, '\0', sizeof (buf));
   s = write (fd, buf, sizeof (buf));
 
@@ -266,7 +268,7 @@ tf_writev  (void *arg)
   ssize_t s;
   pthread_cleanup_push (cl, NULL);
 
-  char buf[100000];
+  char buf[WRITE_BUFFER_SIZE];
   memset (buf, '\0', sizeof (buf));
   struct iovec iov[1] = { [0] = { .iov_base = buf, .iov_len = sizeof (buf) } };
   s = writev (fd, iov, 1);
@@ -2043,11 +2045,29 @@ static struct
 static int
 do_test (void)
 {
-  if (pipe (fds) != 0)
+  int val;
+  socklen_t len;
+
+  if (socketpair (AF_UNIX, SOCK_STREAM, PF_UNIX, fds) != 0)
+    {
+      perror ("socketpair");
+      exit (1);
+    }
+
+  val = 1;
+  len = sizeof(val);
+  setsockopt (fds[1], SOL_SOCKET, SO_SNDBUF, &val, sizeof(val));
+  if (getsockopt (fds[1], SOL_SOCKET, SO_SNDBUF, &val, &len) < 0)
+    {
+      perror ("getsockopt");
+      exit (1);
+    }
+  if (val >= WRITE_BUFFER_SIZE)
     {
-      puts ("pipe failed");
+      puts ("minimum write buffer size too large");
       exit (1);
     }
+  setsockopt (fds[1], SOL_SOCKET, SO_SNDBUF, &val, sizeof(val));
 
   int result = 0;
   size_t cnt;
index 7e0c4eb30a787ddb37154e09d52d3515972661f0..2ebd90b989be67dd44e852298335f389db23f26f 100644 (file)
@@ -53,8 +53,12 @@ endif
 
 all-nscd-modules := $(nscd-modules) selinux
 ifeq (yes,$(have-selinux))
+ifeq (yes,$(have-libaudit))
+libaudit = -laudit
+endif
+
 nscd-modules += selinux
-selinux-LIBS := -lselinux
+selinux-LIBS := -lselinux $(libaudit)
 endif
 
 LDLIBS-nscd = $(selinux-LIBS)
index f57f0920aea78534f39cc8c27c790aaa512e94dd..4dc4df36488ac10299c707b1f75a02120ea62ca2 100644 (file)
@@ -18,6 +18,7 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#include "config.h"
 #include <error.h>
 #include <errno.h>
 #include <libintl.h>
@@ -30,6 +31,9 @@
 #include <selinux/avc.h>
 #include <selinux/flask.h>
 #include <selinux/selinux.h>
+#ifdef HAVE_LIBAUDIT
+#include <libaudit.h>
+#endif
 
 #include "dbg_log.h"
 #include "selinux.h"
@@ -66,6 +70,11 @@ static struct avc_entry_ref aeref;
 /* Thread to listen for SELinux status changes via netlink.  */
 static pthread_t avc_notify_thread;
 
+#ifdef HAVE_LIBAUDIT
+/* Prototype for supporting the audit daemon */
+static void log_callback (const char *fmt, ...);
+#endif
+
 /* Prototypes for AVC callback functions.  */
 static void *avc_create_thread (void (*run) (void));
 static void avc_stop_thread (void *thread);
@@ -77,7 +86,11 @@ static void avc_free_lock (void *lock);
 /* AVC callback structures for use in avc_init.  */
 static const struct avc_log_callback log_cb =
 {
+#ifdef HAVE_LIBAUDIT
+  .func_log = log_callback,
+#else
   .func_log = dbg_log,
+#endif
   .func_audit = NULL
 };
 static const struct avc_thread_callback thread_cb =
@@ -93,6 +106,30 @@ static const struct avc_lock_callback lock_cb =
   .func_free_lock = avc_free_lock
 };
 
+#ifdef HAVE_LIBAUDIT
+/* The audit system's netlink socket descriptor */
+static int audit_fd = -1;
+
+/* When an avc denial occurs, log it to audit system */
+static void 
+log_callback (const char *fmt, ...)
+{
+  va_list ap;
+
+  va_start (ap, fmt);
+  audit_log_avc (audit_fd, AUDIT_USER_AVC, fmt, ap);
+  va_end (ap);
+}
+
+/* Initialize the connection to the audit system */
+static void 
+audit_init (void)
+{
+  audit_fd = audit_open ();
+  if (audit_fd < 0)
+     dbg_log (_("Failed opening connection to the audit subsystem"));
+}
+#endif /* HAVE_LIBAUDIT */
 
 /* Determine if we are running on an SELinux kernel. Set selinux_enabled
    to the result.  */
@@ -182,6 +219,9 @@ nscd_avc_init (void)
     error (EXIT_FAILURE, errno, _("Failed to start AVC"));
   else
     dbg_log (_("Access Vector Cache (AVC) started"));
+#ifdef HAVE_LIBAUDIT
+  audit_init ();
+#endif
 }
 
 
@@ -262,6 +302,9 @@ void
 nscd_avc_destroy (void)
 {
   avc_destroy ();
+#ifdef HAVE_LIBAUDIT
+  audit_close (audit_fd);
+#endif
 }
 
 #endif /* HAVE_SELINUX */
index 355a7841241533a9d13867eb175100900d992b5c..c03acf5e16fe560a15c2d8058614643b1dd0e877 100644 (file)
@@ -30,7 +30,7 @@ main (void)
   for (c = 0; c < sizeof (buf); ++c)
     buf[c] = '0' + (c % 10);
 
-  for (c = 0; c < 20; ++c)
+  for (c = 0; c < (ps * 4) / sizeof (buf); ++c)
     if (fwrite (buf, 1, sizeof (buf), fp) != sizeof (buf))
       {
        printf ("`fwrite' failed: %m\n");
@@ -40,7 +40,7 @@ main (void)
   assert (ps + 1000 < c * sizeof (buf));
 
   /* First try something which is not allowed: map at an offset which is
-     not module the pagesize.  */
+     not modulo the pagesize.  */
   ptr = mmap (NULL, 1000, PROT_READ, MAP_SHARED, fd, ps - 1);
   if (ptr != MAP_FAILED)
     {
index 62b447035510cdb236529bc5b6a4aab5a129f5c3..b731b02e25ade3859788ec055a9db0b4bb2795cb 100644 (file)
 #define RV     t12
 #define RA     t9
 
+/* The secureplt format does not allow the division routines to be called
+   via plt; there aren't enough registers free to be clobbered.  Avoid 
+   setting the symbol type to STT_FUNC, so that the linker won't be tempted
+   to create a plt entry.  */
+#define funcnoplt notype
+
 /* None of these functions should use implicit anything.  */
        .set    nomacro
        .set    noat
index 408d66db00747a4ed1de7eb56fffe4fad070d4f1..9bac0450d01ec7f1c7796529c80a628c8d84e978 100644 (file)
@@ -36,7 +36,7 @@
        .text
        .align  4
        .globl  __divl
-       .type   __divl, @function
+       .type   __divl, @funcnoplt
        .usepv  __divl, no
 
        cfi_startproc
index 7f245ac056bc904eb5407759cf123c5d2b1efc99..d2ed2c5af655b10aed9b5895920d5c460f664169 100644 (file)
@@ -43,7 +43,7 @@
        .text
        .align  4
        .globl  __divq
-       .type   __divq, @function
+       .type   __divq, @funcnoplt
        .usepv  __divq, no
 
        cfi_startproc
index fc00fa133c97b38e7817c396b671e157d851ff91..f2a8a4d53335e44a4b47265e17d946505874f1ba 100644 (file)
@@ -43,7 +43,7 @@
        .text
        .align  4
        .globl  __divqu
-       .type   __divqu, @function
+       .type   __divqu, @funcnoplt
        .usepv  __divqu, no
 
        cfi_startproc
diff --git a/sysdeps/alpha/dl-dtprocnum.h b/sysdeps/alpha/dl-dtprocnum.h
new file mode 100644 (file)
index 0000000..67845cd
--- /dev/null
@@ -0,0 +1,3 @@
+/* Number of extra dynamic section entries for this architecture.  By
+   default there are none.  */
+#define DT_THISPROCNUM DT_ALPHA_NUM
index 173a4111f89ddb2c29ad5188f67798d3e96c81c1..88c357ea07b246e9ef9f3c2876b07b99316beafe 100644 (file)
@@ -33,6 +33,9 @@
    where the dynamic linker should not map anything.  */
 #define ELF_MACHINE_USER_ADDRESS_MASK  0x120000000UL
 
+/* Translate a processor specific dynamic tag to the index in l_info array.  */
+#define DT_ALPHA(x) (DT_ALPHA_##x - DT_LOPROC + DT_NUM)
+
 /* Return nonzero iff ELF header is compatible with the running host.  */
 static inline int
 elf_machine_matches_host (const Elf64_Ehdr *ehdr)
@@ -55,105 +58,74 @@ elf_machine_dynamic (void)
 }
 
 /* Return the run-time load address of the shared object.  */
+
 static inline Elf64_Addr
 elf_machine_load_address (void)
 {
-  /* NOTE: While it is generally unfriendly to put data in the text
-     segment, it is only slightly less so when the "data" is an
-     instruction.  While we don't have to worry about GLD just yet, an
-     optimizing linker might decide that our "data" is an unreachable
-     instruction and throw it away -- with the right switches, DEC's
-     linker will do this.  What ought to happen is we should add
-     something to GAS to allow us access to the new GPREL_HI32/LO32
-     relocation types stolen from OSF/1 3.0.  */
-  /* This code relies on the fact that BRADDR relocations do not
-     appear in dynamic relocation tables.  Not that that would be very
-     useful anyway -- br/bsr has a 4MB range and the shared libraries
-     are usually many many terabytes away.  */
-
-  Elf64_Addr dot;
-  long int zero_disp;
-
-  asm("br %0, 1f\n"
-      "0:\n\t"
-      "br $0, 2f\n"
-      "1:\n\t"
-      ".section\t.data\n"
-      "2:\n\t"
-      ".quad 0b\n\t"
-      ".previous"
-      : "=r"(dot));
-
-  zero_disp = *(int *) dot;
-  zero_disp = (zero_disp << 43) >> 41;
-
-  return dot - *(Elf64_Addr *) (dot + 4 + zero_disp);
+  /* This relies on the compiler using gp-relative addresses for static symbols.  */
+  static void *dot = &dot;
+  return (void *)&dot - dot;
 }
 
 /* Set up the loaded object described by L so its unrelocated PLT
    entries will jump to the on-demand fixup code in dl-runtime.c.  */
 
 static inline int
-elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
+elf_machine_runtime_setup (struct link_map *map, int lazy, int profile)
 {
-  Elf64_Addr plt;
-  extern void _dl_runtime_resolve (void);
-  extern void _dl_runtime_profile (void);
+  extern char _dl_runtime_resolve_new[] attribute_hidden;
+  extern char _dl_runtime_profile_new[] attribute_hidden;
+  extern char _dl_runtime_resolve_old[] attribute_hidden;
+  extern char _dl_runtime_profile_old[] attribute_hidden;
+
+  struct pltgot {
+    char *resolve;
+    struct link_map *link;
+  };
+
+  struct pltgot *pg;
+  long secureplt;
+  char *resolve;
+
+  if (map->l_info[DT_JMPREL] == 0 || !lazy)
+    return lazy;
+
+  /* Check to see if we're using the read-only plt form.  */
+  secureplt = map->l_info[DT_ALPHA(PLTRO)] != 0;
+
+  /* If the binary uses the read-only secure plt format, PG points to
+     the .got.plt section, which is the right place for ld.so to place
+     its hooks.  Otherwise, PG is currently pointing at the start of
+     the plt; the hooks go at offset 16.  */
+  pg = (struct pltgot *) D_PTR (map, l_info[DT_PLTGOT]);
+  pg += !secureplt;
+
+  /* This function will be called to perform the relocation.  They're
+     not declared as functions to convince the compiler to use gp
+     relative relocations for them.  */
+  if (secureplt)
+    resolve = _dl_runtime_resolve_new;
+  else
+    resolve = _dl_runtime_resolve_old;
 
-  if (l->l_info[DT_JMPREL] && lazy)
+  if (__builtin_expect (profile, 0))
     {
-      /* The GOT entries for the functions in the PLT have not been
-        filled in yet.  Their initial contents are directed to the
-        PLT which arranges for the dynamic linker to be called.  */
-      plt = D_PTR (l, l_info[DT_PLTGOT]);
-
-      /* This function will be called to perform the relocation.  */
-      if (__builtin_expect (profile, 0))
-       {
-         *(Elf64_Addr *)(plt + 16) = (Elf64_Addr) &_dl_runtime_profile;
-
-         if (GLRO(dl_profile) != NULL
-             && _dl_name_match_p (GLRO(dl_profile), l))
-           {
-             /* This is the object we are looking for.  Say that we really
-                want profiling and the timers are started.  */
-             GL(dl_profile_map) = l;
-           }
-       }
+      if (secureplt)
+       resolve = _dl_runtime_profile_new;
       else
-        *(Elf64_Addr *)(plt + 16) = (Elf64_Addr) &_dl_runtime_resolve;
-
-      /* Identify this shared object */
-      *(Elf64_Addr *)(plt + 24) = (Elf64_Addr) l;
+       resolve = _dl_runtime_profile_old;
 
-      /* If the first instruction of the plt entry is not
-        "br $28, plt0", we have to reinitialize .plt for lazy relocation.  */
-      if (*(unsigned int *)(plt + 32) != 0xc39ffff7)
+      if (GLRO(dl_profile) && _dl_name_match_p (GLRO(dl_profile), map))
        {
-         unsigned int val = 0xc39ffff7;
-         unsigned int *slot, *end;
-         const Elf64_Rela *rela = (const Elf64_Rela *)
-                                  D_PTR (l, l_info[DT_JMPREL]);
-         Elf64_Addr l_addr = l->l_addr;
-
-         /* br t12,.+4; ldq t12,12(t12); nop; jmp t12,(t12),.+4 */
-         *(unsigned long *)plt = 0xa77b000cc3600000;
-         *(unsigned long *)(plt + 8) = 0x6b7b000047ff041f;
-         slot = (unsigned int *)(plt + 32);
-         end = (unsigned int *)(plt + 32
-                                + l->l_info[DT_PLTRELSZ]->d_un.d_val / 2);
-         while (slot < end)
-           {
-             /* br at,.plt+0 */
-             *slot = val;
-             *(Elf64_Addr *) rela->r_offset = (Elf64_Addr) slot - l_addr;
-             val -= 3;
-             slot += 3;
-             ++rela;
-           }
+         /* This is the object we are looking for.  Say that we really
+            want profiling and the timers are started.  */
+         GL(dl_profile_map) = map;
        }
     }
 
+  pg->resolve = resolve;
+  pg->link = map;
+
   return lazy;
 }
 
@@ -280,7 +252,7 @@ $fixup_stack:                                                       \n\
 /* Fix up the instructions of a PLT entry to invoke the function
    rather than the dynamic linker.  */
 static inline Elf64_Addr
-elf_machine_fixup_plt (struct link_map *l, lookup_t t,
+elf_machine_fixup_plt (struct link_map *map, lookup_t t,
                       const Elf64_Rela *reloc,
                       Elf64_Addr *got_addr, Elf64_Addr value)
 {
@@ -291,10 +263,16 @@ elf_machine_fixup_plt (struct link_map *l, lookup_t t,
   /* Store the value we are going to load.  */
   *got_addr = value;
 
+  /* If this binary uses the read-only secure plt format, we're done.  */
+  if (map->l_info[DT_ALPHA(PLTRO)])
+    return value;
+
+  /* Otherwise we have to modify the plt entry in place to do the branch.  */
+
   /* Recover the PLT entry address by calculating reloc's index into the
      .rela.plt, and finding that entry in the .plt.  */
-  rela_plt = (void *) D_PTR (l, l_info[DT_JMPREL]);
-  plte = (void *) (D_PTR (l, l_info[DT_PLTGOT]) + 32);
+  rela_plt = (const Elf64_Rela *) D_PTR (map, l_info[DT_JMPREL]);
+  plte = (Elf64_Word *) (D_PTR (map, l_info[DT_PLTGOT]) + 32);
   plte += 3 * (reloc - rela_plt);
 
   /* Find the displacement from the plt entry to the function.  */
index 42350836eff60740dd3f706a23c7d5a743fb54f4..c52efbb3bc569506371b0546a7c15136bb91fc95 100644 (file)
 
        .set noat
 
-       .globl  _dl_runtime_resolve
-       .ent    _dl_runtime_resolve
+.macro savei regno, offset
+       stq     $\regno, \offset($30)
+       cfi_rel_offset(\regno, \offset)
+.endm
+
+.macro savef regno, offset
+       stt     $f\regno, \offset($30)
+       cfi_rel_offset(\regno+32, \offset)
+.endm
+
+       .align  4
+       .globl  _dl_runtime_resolve_new
+       .ent    _dl_runtime_resolve_new
+
+#undef FRAMESIZE
+#define FRAMESIZE      14*8
+
+_dl_runtime_resolve_new:
+       .frame  $30, FRAMESIZE, $26, 0
+       .mask   0x4000000, 0
+
+       ldah    $29, 0($27)             !gpdisp!1
+       lda     $30, -FRAMESIZE($30)
+       stq     $26, 0*8($30)
+       stq     $16, 2*8($30)
+
+       stq     $17, 3*8($30)
+       lda     $29, 0($29)             !gpdisp!1
+       stq     $18, 4*8($30)
+       mov     $28, $16                /* link_map from .got.plt */
+
+       stq     $19, 5*8($30)
+       mov     $25, $17                /* offset of reloc entry */
+       stq     $20, 6*8($30)
+       mov     $26, $18                /* return address */
+
+       stq     $21, 7*8($30)
+       stt     $f16, 8*8($30)
+       stt     $f17, 9*8($30)
+       stt     $f18, 10*8($30)
+
+       stt     $f19, 11*8($30)
+       stt     $f20, 12*8($30)
+       stt     $f21, 13*8($30)
+       .prologue 2
+
+       bsr     $26, _dl_fixup          !samegp
+       mov     $0, $27
+
+       ldq     $26, 0*8($30)
+       ldq     $16, 2*8($30)
+       ldq     $17, 3*8($30)
+       ldq     $18, 4*8($30)
+       ldq     $19, 5*8($30)
+       ldq     $20, 6*8($30)
+       ldq     $21, 7*8($30)
+       ldt     $f16, 8*8($30)
+       ldt     $f17, 9*8($30)
+       ldt     $f18, 10*8($30)
+       ldt     $f19, 11*8($30)
+       ldt     $f20, 12*8($30)
+       ldt     $f21, 13*8($30)
+       lda     $30, FRAMESIZE($30)
+       jmp     $31, ($27), 0
+       .end    _dl_runtime_resolve_new
+
+       .globl  _dl_runtime_profile_new
+       .type   _dl_runtime_profile_new, @function
+
+#undef FRAMESIZE
+#define FRAMESIZE      20*8
+
+       /* We save the registers in a different order than desired by
+          .mask/.fmask, so we have to use explicit cfi directives.  */
+       cfi_startproc
+
+_dl_runtime_profile_new:
+       ldah    $29, 0($27)             !gpdisp!2
+       lda     $30, -FRAMESIZE($30)
+       savei   26, 0*8
+       stq     $16, 2*8($30)
+
+       stq     $17, 3*8($30)
+       lda     $29, 0($29)             !gpdisp!2
+       stq     $18, 4*8($30)
+       lda     $1, FRAMESIZE($30)      /* incoming sp value */
+
+       stq     $1, 1*8($30)
+       stq     $19, 5*8($30)
+       stq     $20, 6*8($30)
+       mov     $28, $16                /* link_map from .got.plt */
+
+       stq     $21, 7*8($30)
+       mov     $25, $17                /* offset of reloc entry */
+       stt     $f16, 8*8($30)
+       mov     $26, $18                /* return address */
+
+       stt     $f17, 9*8($30)
+       mov     $30, $19                /* La_alpha_regs address */
+       stt     $f18, 10*8($30)
+       lda     $20, 14*8($30)          /* framesize address */
+
+       stt     $f19, 11*8($30)
+       stt     $f20, 12*8($30)
+       stt     $f21, 13*8($30)
+       stq     $28, 16*8($30)
+       stq     $25, 17*8($30)
+
+       bsr     $26, _dl_profile_fixup  !samegp
+       mov     $0, $27
+
+       /* Discover if we're wrapping this call.  */
+       ldq     $18, 14*8($30)
+       bge     $18, 1f
+
+       ldq     $26, 0*8($30)
+       ldq     $16, 2*8($30)
+       ldq     $17, 3*8($30)
+       ldq     $18, 4*8($30)
+       ldq     $19, 5*8($30)
+       ldq     $20, 6*8($30)
+       ldq     $21, 7*8($30)
+       ldt     $f16, 8*8($30)
+       ldt     $f17, 9*8($30)
+       ldt     $f18, 10*8($30)
+       ldt     $f19, 11*8($30)
+       ldt     $f20, 12*8($30)
+       ldt     $f21, 13*8($30)
+       lda     $30, FRAMESIZE($30)
+       jmp     $31, ($27), 0
+
+1:
+       /* Create a frame pointer and allocate a new argument frame.  */
+       savei   15, 15*8
+       mov     $30, $15
+       cfi_def_cfa_register (15)
+       addq    $18, 15, $18
+       bic     $18, 15, $18
+       subq    $30, $18, $30
+
+       /* Save the call destination around memcpy.  */
+       stq     $0, 14*8($30)
+
+       /* Copy the stack arguments into place.  */
+       lda     $16, 0($30)
+       lda     $17, FRAMESIZE($15)
+       jsr     $26, memcpy
+       ldgp    $29, 0($26)
+
+       /* Reload the argument registers.  */
+       ldq     $27, 14*8($30)
+       ldq     $16, 2*8($15)
+       ldq     $17, 3*8($15)
+       ldq     $18, 4*8($15)
+       ldq     $19, 5*8($15)
+       ldq     $20, 6*8($15)
+       ldq     $21, 7*8($15)
+       ldt     $f16, 8*8($15)
+       ldt     $f17, 9*8($15)
+       ldt     $f18, 10*8($15)
+       ldt     $f19, 11*8($15)
+       ldt     $f20, 12*8($15)
+       ldt     $f21, 13*8($15)
+
+       jsr     $26, ($27), 0
+       ldgp    $29, 0($26)
+
+       /* Set up for call to _dl_call_pltexit.  */
+       ldq     $16, 16*8($15)
+       ldq     $17, 17*8($15)
+       stq     $0, 16*8($15)
+       lda     $18, 0($15)
+       stq     $1, 17*8($15)
+       lda     $19, 16*8($15)
+       stt     $f0, 18*8($15)
+       stt     $f1, 19*8($15)
+       bsr     $26, _dl_call_pltexit   !samegp
+
+       mov     $15, $30
+       cfi_def_cfa_register (30)
+       ldq     $26, 0($30)
+       ldq     $15, 15*8($30)
+       lda     $30, FRAMESIZE($30)
+       ret
+
+       cfi_endproc
+       .size   _dl_runtime_profile_new, .-_dl_runtime_profile_new
+
+       .align  4
+       .globl  _dl_runtime_resolve_old
+       .ent    _dl_runtime_resolve_old
 
 #undef FRAMESIZE
 #define FRAMESIZE      44*8
 
-_dl_runtime_resolve:
+_dl_runtime_resolve_old:
        lda     $30, -FRAMESIZE($30)
        .frame  $30, FRAMESIZE, $26
        /* Preserve all registers that C normally doesn't.  */
@@ -146,30 +335,21 @@ _dl_runtime_resolve:
        lda     $30, FRAMESIZE($30)
        jmp     $31, ($27)
 
-       .end    _dl_runtime_resolve
+       .end    _dl_runtime_resolve_old
 
-       .globl  _dl_runtime_profile
-       .usepv  _dl_runtime_profile, no
-       .type   _dl_runtime_profile, @function
+       .globl  _dl_runtime_profile_old
+       .usepv  _dl_runtime_profile_old, no
+       .type   _dl_runtime_profile_old, @function
 
        /* We save the registers in a different order than desired by
           .mask/.fmask, so we have to use explicit cfi directives.  */
        cfi_startproc
 
-.macro savei regno, offset
-       stq     $\regno, \offset($30)
-       cfi_rel_offset(\regno, \offset)
-.endm
-
-.macro savef regno, offset
-       stt     $f\regno, \offset($30)
-       cfi_rel_offset(\regno+32, \offset)
-.endm
-
 #undef FRAMESIZE
 #define FRAMESIZE      50*8
 
-_dl_runtime_profile:
+       .align  4
+_dl_runtime_profile_old:
        lda     $30, -FRAMESIZE($30)
        cfi_adjust_cfa_offset (FRAMESIZE)
 
@@ -340,8 +520,8 @@ _dl_runtime_profile:
        ldgp    $29, 0($26)
 
        /* Set up for call to _dl_call_pltexit.  */
-       ldq     $16, 48($15)
-       ldq     $17, 49($15)
+       ldq     $16, 48*8($15)
+       ldq     $17, 49*8($15)
        stq     $0, 46*8($15)
        lda     $18, 0($15)
        stq     $1, 47*8($15)
@@ -358,4 +538,4 @@ _dl_runtime_profile:
        ret
 
        cfi_endproc
-       .size   _dl_runtime_profile, .-_dl_runtime_profile
+       .size   _dl_runtime_profile_old, .-_dl_runtime_profile_old
index 3c2bc59adcb7460850129dcd6fd2d36506a49e6a..ebe14b4c8ecbdb0176ce3325028c51a4da3ba801 100644 (file)
@@ -77,7 +77,7 @@ _start:
        .end _start
 
 /* For ECOFF backwards compatibility. */
-weak_alias(_start, __start)
+weak_alias (_start, __start)
 
 /* Define a symbol for the first piece of initialized data.  */
        .data
index eb4fbd2ab4e176561e2b539d10475d7b5bb4ddf9..ef2a5759957248904ff5d3f095ea5e70e910c53b 100644 (file)
@@ -41,4 +41,4 @@ ENTRY(htonl)
 
        END(htonl)
 
-weak_alias(htonl, ntohl)
+weak_alias (htonl, ntohl)
index f1ef75481441089abe024c47eceaebef1a33c92d..7c6270226d172d77eade11f0368b0f50d95843e9 100644 (file)
@@ -37,4 +37,4 @@ ENTRY(htons)
 
        END(htons)
 
-weak_alias(htons, ntohs)
+weak_alias (htons, ntohs)
index bfc3be5c3fbecf84e706560c94440aa7f29ebcb5..ae291b0505c91c62776e5d2945f1f4b753ccd039 100644 (file)
@@ -38,7 +38,7 @@
        .text
        .align  4
        .globl  __reml
-       .type   __reml, @function
+       .type   __reml, @funcnoplt
        .usepv  __reml, no
 
        cfi_startproc
index 645a83445346eff71bddc08eeaf7516362184fc1..64e958bb951a6ddb7190ce2f871e10ce7e0225cb 100644 (file)
@@ -43,7 +43,7 @@
        .text
        .align  4
        .globl  __remq
-       .type   __remq, @function
+       .type   __remq, @funcnoplt
        .usepv  __remq, no
 
        cfi_startproc
index bfa78dff5739e3a694b96264923af152170b08b3..dcc1c88b3c5c0d3f6fb3255817baba6a858fa63d 100644 (file)
@@ -43,7 +43,7 @@
        .text
        .align  4
        .globl  __remqu
-       .type   __remqu, @function
+       .type   __remqu, @funcnoplt
        .usepv  __remqu, no
 
        cfi_startproc
index 6a3336c6d222745dd4e31cc3ef37da60629cc81e..f2d52372d52854b2af45b3e026c36614b6ab86ed 100644 (file)
@@ -1,5 +1,5 @@
 /* Return backtrace of current program state.  Generic version.
-   Copyright (C) 1998, 2000, 2002, 2004 Free Software Foundation, Inc.
+   Copyright (C) 1998, 2000, 2002, 2004, 2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
 
@@ -91,3 +91,4 @@ __backtrace (array, size)
   return cnt;
 }
 weak_alias (__backtrace, backtrace)
+libc_hidden_def (__backtrace)
index c704362ec700370bd7feb614243823ad884212c5..b01f8b0094524d2ac7d1b8093733d5b53d387b83 100644 (file)
@@ -1,5 +1,5 @@
 /* Write formatted list with names for addresses in backtrace to a file.
-   Copyright (C) 1998, 2003 Free Software Foundation, Inc.
+   Copyright (C) 1998, 2003, 2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
 
@@ -61,3 +61,4 @@ __backtrace_symbols_fd (array, size, fd)
     }
 }
 weak_alias (__backtrace_symbols_fd, backtrace_symbols_fd)
+libc_hidden_def (__backtrace_symbols_fd)
index 16df53883cae19ad87f901e283802ad660819122..6754d145b01d270fdeb4f3f37e6ff06157c77f9c 100644 (file)
@@ -1,5 +1,5 @@
 /* Write formatted list with names for addresses in backtrace to a file.
-   Copyright (C) 1998, 2000, 2003 Free Software Foundation, Inc.
+   Copyright (C) 1998, 2000, 2003, 2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
 
@@ -107,3 +107,4 @@ __backtrace_symbols_fd (array, size, fd)
     }
 }
 weak_alias (__backtrace_symbols_fd, backtrace_symbols_fd)
+libc_hidden_def (__backtrace_symbols_fd)
index 2e3254356bc819023744d60a97592fe5856905f5..a24c2ff58e98fc024d8b7dd0ca6aee395e9ac1a8 100644 (file)
@@ -674,7 +674,7 @@ struct rtld_global_ro
   void (*_dl_debug_printf) (const char *, ...)
        __attribute__ ((__format__ (__printf__, 1, 2)));
   int (internal_function *_dl_catch_error) (const char **, const char **,
-                                           void (*) (void *), void *);
+                                           bool *, void (*) (void *), void *);
   void (internal_function *_dl_signal_error) (int, const char *, const char *,
                                              const char *);
   void (*_dl_mcount) (ElfW(Addr) frompc, ElfW(Addr) selfpc);
@@ -754,10 +754,6 @@ extern char **_dl_argv_internal attribute_hidden
 # define rtld_progname _dl_argv[0]
 #endif
 
-/* The array with message we print as a last resort.  */
-extern const char _dl_out_of_memory[];
-rtld_hidden_proto (_dl_out_of_memory)
-
 /* Flag set at startup and cleared when the last initializer has run.  */
 extern int _dl_starting_up;
 weak_extern (_dl_starting_up)
index c83520e3495cf71ab115ba29e9bd9362d00fbc33..454257b2bcc881525e4bc6901ef80c5fc27d088c 100644 (file)
@@ -1,5 +1,5 @@
 /* Find the length of STRING, but scan at most MAXLEN characters.
-   Copyright (C) 1991, 1993, 1997, 2000, 2001 Free Software Foundation, Inc.
+   Copyright (C) 1991,1993,1997,2000,2001,2005 Free Software Foundation, Inc.
    Contributed by Jakub Jelinek <jakub@redhat.com>.
 
    Based on strlen written by Torbjorn Granlund (tege@sics.se),
@@ -158,3 +158,4 @@ __strnlen (const char *str, size_t maxlen)
   return char_ptr - str;
 }
 weak_alias (__strnlen, strnlen)
+libc_hidden_def (strnlen)
index cb7530396bd11b6d0f0cd4b6d2807dbc68205b0a..8b61913dde968b0c9dc0c3a5cb8c90a0442d52ea 100644 (file)
@@ -1,5 +1,5 @@
 /* Return backtrace of current program state.
-   Copyright (C) 1998, 2000, 2003, 2004 Free Software Foundation, Inc.
+   Copyright (C) 1998, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
 
@@ -141,3 +141,4 @@ __backtrace (array, size)
   return arg.cnt != -1 ? arg.cnt : 0;
 }
 weak_alias (__backtrace, backtrace)
+libc_hidden_def (__backtrace)
index 727d7a0ab8f99bdaa710c218e1ddaf25c37d2c00..8b11adb2e33fed10182d0286e7379d84e12741c6 100644 (file)
@@ -52,4 +52,4 @@ C_LABEL(_mcount)
        ASM_SIZE_DIRECTIVE(C_SYMBOL_NAME(_mcount))
 
 #undef mcount
-weak_alias(_mcount, mcount)
+weak_alias (_mcount, mcount)
index 56ba304328d443cc2d3daae64bec60d7ed840d26..2739cb00b381fe63f58135d78498c6955eb93736 100644 (file)
@@ -131,6 +131,33 @@ lose: SYSCALL_PIC_SETUP                                                          \
 0:  popl %ebx;                                                               \
     cfi_adjust_cfa_offset (-4);                                                      \
     addl $_GLOBAL_OFFSET_TABLE+[.-0b], %ebx;
+
+# ifndef HAVE_HIDDEN
+#  define SETUP_PIC_REG(reg) \
+  call 1f;                                                                   \
+  .subsection 1;                                                             \
+1:movl (%esp), %e##reg;                                                              \
+  ret;                                                                       \
+  .previous
+# else
+#  define SETUP_PIC_REG(reg) \
+  .ifndef __i686.get_pc_thunk.reg;                                           \
+  .section .gnu.linkonce.t.__i686.get_pc_thunk.reg,"ax",@progbits;           \
+  .globl __i686.get_pc_thunk.reg;                                            \
+  .hidden __i686.get_pc_thunk.reg;                                           \
+  .type __i686.get_pc_thunk.reg,@function;                                   \
+__i686.get_pc_thunk.reg:                                                     \
+  movl (%esp), %e##reg;                                                              \
+  ret;                                                                       \
+  .size __i686.get_pc_thunk.reg, . - __i686.get_pc_thunk.reg;                \
+  .previous;                                                                 \
+  .endif;                                                                    \
+  call __i686.get_pc_thunk.reg
+# endif
+
+# define LOAD_PIC_REG(reg) \
+  SETUP_PIC_REG(reg); addl $_GLOBAL_OFFSET_TABLE_, %e##reg
+
 #else
 #define JUMPTARGET(name)       name
 #define SYSCALL_PIC_SETUP      /* Nothing.  */
index efacccce15a7d22fc10a22152690308f78afa72d..3f2b75ec03a980aa2eb9530c944ff1198d62b68b 100644 (file)
@@ -1,5 +1,5 @@
 /* Return backtrace of current program state.
-   Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
 
@@ -90,3 +90,4 @@ __backtrace (array, size)
   return arg.cnt != -1 ? arg.cnt : 0;
 }
 weak_alias (__backtrace, backtrace)
+libc_hidden_def (__backtrace)
index ebc90fc8f30c8ae801d2ce37d60e5c6f2500cae5..cb9efbfe02787e2f007b208cf7633e27c4585f8e 100644 (file)
@@ -60,12 +60,12 @@ double __ieee754_lgamma_r(double x, int* signgam)
 {
     return __libm_lgamma(x, signgam, sizeof(*signgam));
 }
-weak_alias(__ieee754_lgamma_r, lgamma_r)
+weak_alias (__ieee754_lgamma_r, lgamma_r)
 
 #ifndef _LIBC
 double __ieee754_gamma_r(double x, int* signgam)
 {
     return __libm_lgamma(x, signgam, sizeof(*signgam));
 }
-weak_alias(__ieee754_gamma_r, gamma_r)
+weak_alias (__ieee754_gamma_r, gamma_r)
 #endif
index 4efa84064c7e03195c859105ac7841ac4ab0a052..44911aeabd0c7a278188c4543fea22ef5930bc84 100644 (file)
@@ -60,12 +60,12 @@ float __ieee754_lgammaf_r(float x, int* signgam)
 {
     return __libm_lgammaf(x, signgam, sizeof(*signgam));
 }
-weak_alias(__ieee754_lgammaf_r, lgammaf_r)
+weak_alias (__ieee754_lgammaf_r, lgammaf_r)
 
 #ifndef _LIBC
 float __ieee754_gammaf_r(float x, int* signgam)
 {
     return __libm_lgammaf(x, signgam, sizeof(*signgam));
 }
-weak_alias(__ieee754_gammaf_r, gammaf_r)
+weak_alias (__ieee754_gammaf_r, gammaf_r)
 #endif
index 3fbea703c801af80c701b5e477ebe4b219cdb449..4451201b77e65da583f6d8d51f1d7b74e3597b13 100644 (file)
@@ -59,12 +59,12 @@ long double __ieee754_lgammal_r(long double x, int* signgam)
 {
     return __libm_lgammal(x, signgam, sizeof(*signgam));
 }
-weak_alias(__ieee754_lgammal_r, lgammal_r)
+weak_alias (__ieee754_lgammal_r, lgammal_r)
 
 #ifndef _LIBC
 long double __ieee754_gammal_r(long double x, int* signgam)
 {
     return __libm_lgammal(x, signgam, sizeof(*signgam));
 }
-weak_alias(__ieee754_gammal_r, gammal_r)
+weak_alias (__ieee754_gammal_r, gammal_r)
 #endif
index f16256ee1bd921f3734ea482262a10e5809f2b59..2006d3e806e4f3145531316e800519e1f149ea6c 100644 (file)
@@ -66,7 +66,7 @@ double __ieee754_lgamma(double x)
 #endif
     return __libm_lgamma(x, &signgam, sizeof(signgam));
 }
-weak_alias(__ieee754_lgamma, lgamma)
+weak_alias (__ieee754_lgamma, lgamma)
 
 double __ieee754_gamma(double x)
 {
@@ -77,4 +77,4 @@ double __ieee754_gamma(double x)
 #endif
     return __libm_lgamma(x, &signgam, sizeof(signgam));
 }
-weak_alias(__ieee754_gamma, gamma)
+weak_alias (__ieee754_gamma, gamma)
index 5ac3b8227858a2faafcfb0000f0f10b63101e7e5..cd0b4f666605d9628d5769788d5de8f52eea3974 100644 (file)
@@ -66,7 +66,7 @@ float __ieee754_lgammaf(float x)
 #endif
     return __libm_lgammaf(x, &signgam, sizeof(signgam));
 }
-weak_alias(__ieee754_lgammaf, lgammaf)
+weak_alias (__ieee754_lgammaf, lgammaf)
 
 float __ieee754_gammaf(float x)
 {
@@ -77,4 +77,4 @@ float __ieee754_gammaf(float x)
 #endif
     return __libm_lgammaf(x, &signgam, sizeof(signgam));
 }
-weak_alias(__ieee754_gammaf, gammaf)
+weak_alias (__ieee754_gammaf, gammaf)
index 8ddbb749ce68ccf3ce51cb27bf62b3e4926c4360..e3885296eb473d4a3d18302d1074a4d31aad26a0 100644 (file)
@@ -65,7 +65,7 @@ long double __ieee754_lgammal(long double x)
 #endif
     return __libm_lgammal(x, &signgam, sizeof(signgam));
 }
-weak_alias(__ieee754_lgammal, lgammal)
+weak_alias (__ieee754_lgammal, lgammal)
 
 long double __ieee754_gammal(long double x)
 {
@@ -76,4 +76,4 @@ long double __ieee754_gammal(long double x)
 #endif
     return __libm_lgammal(x, &signgam, sizeof(signgam));
 }
-weak_alias(__ieee754_gammal, gammal)
+weak_alias (__ieee754_gammal, gammal)
index 258562796a6b6b29d68f337e6c8ed5c8cc10c003..63db7ff7e57cf65ef1c86433d2d7e9346564cc13 100644 (file)
@@ -108,5 +108,5 @@ ENTRY(strchr)
        br.cond.sptk    .back
 END(strchr)
 
-weak_alias(strchr, index)
+weak_alias (strchr, index)
 libc_hidden_builtin_def (strchr)
index c26b35bb70101f889fe7351ef2b200427daf769a..5b5a7fe362651c0bc992feda424c04298a913dce 100644 (file)
@@ -109,4 +109,4 @@ __readdir64_r (DIR *dirp, struct dirent64 *entry, struct dirent64 **result)
   return dp ? 0 : err ? errno : 0;
 }
 
-weak_alias(__readdir64_r, readdir64_r)
+weak_alias (__readdir64_r, readdir64_r)
index ea3e07d26b422cdf5cd89d99bcb230741a866143..5b2f06561b2c2fcdd45b6e0e2ed2e2a6cc3a1a19 100644 (file)
@@ -60,4 +60,4 @@ __sigaltstack (argss, oss)
 
   return 0;
 }
-weak_alias(__sigaltstack, sigaltstack)
+weak_alias (__sigaltstack, sigaltstack)
index 9e718f354d81ad6b1812b6accd2b55adb587cd53..ff50e971cc5f57ba6320e8fd9cd03836250c2814 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1997, 2005 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
@@ -24,3 +24,4 @@ ENTRY (syscall)
        pushl %ecx              /* Push back return address.  */
        .byte 0x9a, 0, 0, 0, 0, 7, 0 /* lcall $7, $0 -- gas bug */
        ret
+END (syscall)
index 91e71b74ac47cff366b9690bd76441fa74358d06..64ca9ae83d49f149ffd9110cd4f161b87c953704 100644 (file)
@@ -76,7 +76,7 @@ __posix_fallocate64_l64 (int fd, __off64_t offset, __off64_t len)
       if (offset < st.st_size)
        {
          unsigned char c;
-         ssize_t rsize = __pread64 (fd, &c, 1, offset);
+         ssize_t rsize = __libc_pread64 (fd, &c, 1, offset);
 
          if (rsize < 0)
            return errno;
@@ -86,7 +86,7 @@ __posix_fallocate64_l64 (int fd, __off64_t offset, __off64_t len)
            continue;
        }
 
-      if (__pwrite64 (fd, "", 1, offset) != 1)
+      if (__libc_pwrite64 (fd, "", 1, offset) != 1)
        return errno;
     }
 
index 361a19e0dcb1c28c45ca546cd34774ef14287549..9787e8d234402a95a95e8e62fc56c915cf7809e5 100644 (file)
@@ -1,5 +1,5 @@
 /* Set the disposition of SIG to SIG_IGN.
-   Copyright (C) 1998 Free Software Foundation, Inc.
+   Copyright (C) 1998, 2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
 
@@ -22,6 +22,8 @@
 #define __need_NULL
 #include <stddef.h>
 #include <signal.h>
+#include <string.h>    /* For the real memset prototype.  */
+
 
 int
 sigignore (sig)
index 9a8efee043a3398d97c972c9add6c43db8244f2c..9fc514c72908a576def87fc3347ed940ba009e36 100644 (file)
@@ -1,5 +1,6 @@
 /* BSD-like signal function.
-   Copyright (C) 1991,1992,1996,1997,2000,2002 Free Software Foundation, Inc.
+   Copyright (C) 1991,1992,1996,1997,2000,2002,2005
+   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
@@ -19,6 +20,7 @@
 
 #include <errno.h>
 #include <signal.h>
+#include <string.h>    /* For the real memset prototype.  */
 
 
 sigset_t _sigintr attribute_hidden;            /* Set by siginterrupt.  */
index 873c1cb1e61e5a6e87a7ee57830458708ecbc890..31e39d78b5b618d1fad883a37bc61dc46ef6a3be 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 2000, 2005 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
@@ -20,6 +20,7 @@
 #define __need_NULL
 #include <stddef.h>
 #include <signal.h>
+#include <string.h>    /* For the real memset prototype.  */
 
 
 /* Set the disposition for SIG.  */
index ca2e84f3727925b16849efdc71aac737de14d94f..16fcd2c2ab7946a0c7fcb696eadf58aff66987aa 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992, 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1996, 1997, 2005 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
@@ -18,6 +18,8 @@
 
 #include <errno.h>
 #include <signal.h>
+#include <string.h>    /* For the real memset prototype.  */
+
 
 /* Tolerate non-threads versions of Posix */
 #ifndef SA_ONESHOT
index 6dd3940d22f43016c541a8e2070812c73894b7f1..850a10746c712b84d5d3bfeaef3cc834787e47b2 100644 (file)
@@ -226,9 +226,9 @@ idouble: 2
 ifloat: 3
 Test "Real part of: cpow (2 + 3 i, 4 + 0 i) == -119.0 - 120.0 i":
 double: 1
-float: 4
+float: 5
 idouble: 1
-ifloat: 4
+ifloat: 5
 Test "Imaginary part of: cpow (2 + 3 i, 4 + 0 i) == -119.0 - 120.0 i":
 float: 2
 ifloat: 2
@@ -351,6 +351,9 @@ double: 1
 float: 1
 idouble: 1
 ifloat: 1
+Test "j0 (2.0) == 0.223890779141235668051827454649948626":
+float: 2
+ifloat: 2
 Test "j0 (10.0) == -0.245935764451348335197760862485328754":
 double: 2
 float: 1
@@ -382,6 +385,9 @@ double: 1
 float: 1
 idouble: 1
 ifloat: 1
+Test "jn (0, 2.0) == 0.223890779141235668051827454649948626":
+float: 2
+ifloat: 2
 Test "jn (0, 10.0) == -0.245935764451348335197760862485328754":
 double: 2
 float: 1
@@ -418,8 +424,8 @@ Test "jn (10, 10.0) == 0.207486106633358857697278723518753428":
 float: 1
 ifloat: 1
 Test "jn (10, 2.0) == 0.251538628271673670963516093751820639e-6":
-float: 3
-ifloat: 3
+float: 4
+ifloat: 4
 Test "jn (3, 0.125) == 0.406503832554912875023029337653442868e-4":
 double: 1
 float: 1
@@ -435,9 +441,9 @@ idouble: 3
 ifloat: 1
 Test "jn (3, 2.0) == 0.128943249474402051098793332969239835":
 double: 1
-float: 1
+float: 2
 idouble: 1
-ifloat: 1
+ifloat: 2
 
 # lgamma
 Test "lgamma (0.7) == 0.260867246531666514385732417016759578":
@@ -730,9 +736,9 @@ ifloat: 1
 
 Function: Real part of "cpow":
 double: 2
-float: 4
+float: 5
 idouble: 2
-ifloat: 4
+ifloat: 5
 
 Function: Imaginary part of "cpow":
 double: 2
@@ -800,9 +806,9 @@ ifloat: 1
 
 Function: "j0":
 double: 2
-float: 1
+float: 2
 idouble: 2
-ifloat: 1
+ifloat: 2
 
 Function: "j1":
 double: 1
@@ -812,9 +818,9 @@ ifloat: 2
 
 Function: "jn":
 double: 3
-float: 3
+float: 4
 idouble: 3
-ifloat: 3
+ifloat: 4
 
 Function: "lgamma":
 double: 1
index 157ef0950763804963b539ce5766ee13273061a8..ab9a3a99bbbee5213b34840f55f1b33b79608259 100644 (file)
@@ -25,13 +25,13 @@ ENTRY(__fabs)
        blr
 END(__fabs)
 
-weak_alias(__fabs,fabs)
+weak_alias (__fabs,fabs)
 
 /* It turns out that it's safe to use this code even for single-precision.  */
 strong_alias(__fabs,__fabsf)
-weak_alias(__fabs,fabsf)
+weak_alias (__fabs,fabsf)
 
 #ifdef NO_LONG_DOUBLE
-weak_alias(__fabs,__fabsl)
-weak_alias(__fabs,fabsl)
+weak_alias (__fabs,__fabsl)
+weak_alias (__fabs,fabsl)
 #endif
index 5666cdd079412a74983dd761b531de1ffe9bb0b0..8502c863b25b9c8326065506bf5da3f6ad6b9c65 100644 (file)
@@ -31,13 +31,13 @@ ENTRY(__fmax)
        blr
 END(__fmax)
 
-weak_alias(__fmax,fmax)
+weak_alias (__fmax,fmax)
 
 /* It turns out that it's safe to use this code even for single-precision.  */
 strong_alias(__fmax,__fmaxf)
-weak_alias(__fmax,fmaxf)
+weak_alias (__fmax,fmaxf)
 
 #ifdef NO_LONG_DOUBLE
-weak_alias(__fmax,__fmaxl)
-weak_alias(__fmax,fmaxl)
+weak_alias (__fmax,__fmaxl)
+weak_alias (__fmax,fmaxl)
 #endif
index 96387d9ae1b41119237a99711c4183fbe0cd0f7b..5f788d06f355298dbcb8e4777ead7a90d3f3f828 100644 (file)
@@ -31,13 +31,13 @@ ENTRY(__fmin)
        blr
 END(__fmin)
 
-weak_alias(__fmin,fmin)
+weak_alias (__fmin,fmin)
 
 /* It turns out that it's safe to use this code even for single-precision.  */
 strong_alias(__fmin,__fminf)
-weak_alias(__fmin,fminf)
+weak_alias (__fmin,fminf)
 
 #ifdef NO_LONG_DOUBLE
-weak_alias(__fmin,__fminl)
-weak_alias(__fmin,fminl)
+weak_alias (__fmin,__fminl)
+weak_alias (__fmin,fminl)
 #endif
index 118f0d61752516b91c8c89984971d3295046fa47..e7e12544c53e1b3fe6739e3f501da5e18bfd4369 100644 (file)
@@ -1,5 +1,5 @@
 /* Return backtrace of current program state.
-   Copyright (C) 1998, 2000 Free Software Foundation, Inc.
+   Copyright (C) 1998, 2000, 2005 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
@@ -64,3 +64,4 @@ __backtrace (void **array, int size)
   return count;
 }
 weak_alias (__backtrace, backtrace)
+libc_hidden_def (__backtrace)
diff --git a/sysdeps/powerpc/powerpc32/configure b/sysdeps/powerpc/powerpc32/configure
new file mode 100644 (file)
index 0000000..9ebac38
--- /dev/null
@@ -0,0 +1,33 @@
+# This file is generated from configure.in by Autoconf.  DO NOT EDIT!
+ # Local configure fragment for sysdeps/powerpc/powerpc32.
+
+# See whether gas has R_PPC_REL16 relocs.
+echo "$as_me:$LINENO: checking for R_PPC_REL16 gas support" >&5
+echo $ECHO_N "checking for R_PPC_REL16 gas support... $ECHO_C" >&6
+if test "${libc_cv_ppc_rel16+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat > conftest.s <<\EOF
+       .text
+       addis 11,30,_GLOBAL_OFFSET_TABLE_-.@ha
+EOF
+if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  libc_cv_ppc_rel16=yes
+else
+  libc_cv_ppc_rel16=no
+fi
+rm -f conftest*
+fi
+echo "$as_me:$LINENO: result: $libc_cv_ppc_rel16" >&5
+echo "${ECHO_T}$libc_cv_ppc_rel16" >&6
+if test $libc_cv_ppc_rel16 = yes; then
+  cat >>confdefs.h <<\_ACEOF
+#define HAVE_ASM_PPC_REL16 1
+_ACEOF
+
+fi
diff --git a/sysdeps/powerpc/powerpc32/configure.in b/sysdeps/powerpc/powerpc32/configure.in
new file mode 100644 (file)
index 0000000..6d2c41c
--- /dev/null
@@ -0,0 +1,18 @@
+GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
+# Local configure fragment for sysdeps/powerpc/powerpc32.
+
+# See whether gas has R_PPC_REL16 relocs.
+AC_CACHE_CHECK(for R_PPC_REL16 gas support, libc_cv_ppc_rel16, [dnl
+cat > conftest.s <<\EOF
+       .text
+       addis 11,30,_GLOBAL_OFFSET_TABLE_-.@ha
+EOF
+if AC_TRY_COMMAND(${CC-cc} -c $CFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then
+  libc_cv_ppc_rel16=yes
+else
+  libc_cv_ppc_rel16=no
+fi
+rm -f conftest*])
+if test $libc_cv_ppc_rel16 = yes; then
+  AC_DEFINE(HAVE_ASM_PPC_REL16)
+fi
diff --git a/sysdeps/powerpc/powerpc32/dl-dtprocnum.h b/sysdeps/powerpc/powerpc32/dl-dtprocnum.h
new file mode 100644 (file)
index 0000000..7fe2be7
--- /dev/null
@@ -0,0 +1,3 @@
+/* Number of extra dynamic section entries for this architecture.  By
+   default there are none.  */
+#define DT_THISPROCNUM DT_PPC_NUM
index 545c19b300dd463af09a07c428d75554b79e0b72..496fa71ecc03a0bf1684eb112a39d829c456dc62 100644 (file)
 #include <assert.h>
 #include <dl-tls.h>
 
+/* Translate a processor specific dynamic tag to the index
+   in l_info array.  */
+#define DT_PPC(x) (DT_PPC_##x - DT_LOPROC + DT_NUM)
+
 /* Return nonzero iff ELF header is compatible with the running host.  */
 static inline int
 elf_machine_matches_host (const Elf32_Ehdr *ehdr)
@@ -32,24 +36,38 @@ elf_machine_matches_host (const Elf32_Ehdr *ehdr)
   return ehdr->e_machine == EM_PPC;
 }
 
+/* Return the value of the GOT pointer.  */
+static inline Elf32_Addr * __attribute__ ((const))
+ppc_got (void)
+{
+  Elf32_Addr *got;
+#ifdef HAVE_ASM_PPC_REL16
+  asm ("bcl 20,31,1f\n"
+       "1:     mflr %0\n"
+       "       addis %0,%0,_GLOBAL_OFFSET_TABLE_-1b@ha\n"
+       "       addi %0,%0,_GLOBAL_OFFSET_TABLE_-1b@l\n"
+       : "=b" (got) : : "lr");
+#else
+  asm (" bl _GLOBAL_OFFSET_TABLE_-4@local"
+       : "=l" (got));
+#endif
+  return got;
+}
 
 /* Return the link-time address of _DYNAMIC, stored as
    the first value in the GOT. */
-static inline Elf32_Addr
+static inline Elf32_Addr __attribute__ ((const))
 elf_machine_dynamic (void)
 {
-  Elf32_Addr *got;
-  asm (" bl _GLOBAL_OFFSET_TABLE_-4@local"
-       : "=l"(got));
-  return *got;
+  return *ppc_got ();
 }
 
 /* Return the run-time load address of the shared object.  */
-static inline Elf32_Addr
+static inline Elf32_Addr __attribute__ ((const))
 elf_machine_load_address (void)
 {
-  unsigned int *got;
-  unsigned int *branchaddr;
+  Elf32_Addr *branchaddr;
+  Elf32_Addr runtime_dynamic;
 
   /* This is much harder than you'd expect.  Possibly I'm missing something.
      The 'obvious' way:
@@ -80,19 +98,17 @@ elf_machine_load_address (void)
      the address ourselves. That gives us the following code: */
 
   /* Get address of the 'b _DYNAMIC@local'...  */
-  asm ("bl 0f ;"
+  asm ("bcl 20,31,0f;"
        "b _DYNAMIC@local;"
        "0:"
-       : "=l"(branchaddr));
-
-  /* ... and the address of the GOT.  */
-  asm (" bl _GLOBAL_OFFSET_TABLE_-4@local"
-       : "=l"(got));
+       : "=l" (branchaddr));
 
   /* So now work out the difference between where the branch actually points,
      and the offset of that location in memory from the start of the file.  */
-  return ((Elf32_Addr)branchaddr - *got
-         + ((int)(*branchaddr << 6 & 0xffffff00) >> 6));
+  runtime_dynamic = ((Elf32_Addr) branchaddr
+                    + ((Elf32_Sword) (*branchaddr << 6 & 0xffffff00) >> 6));
+
+  return runtime_dynamic - elf_machine_dynamic ();
 }
 
 #define ELF_MACHINE_BEFORE_RTLD_RELOC(dynamic_info) /* nothing */
@@ -144,13 +160,69 @@ __elf_preferred_address(struct link_map *loader, size_t maplength,
 /* The PowerPC never uses REL relocations.  */
 #define ELF_MACHINE_NO_REL 1
 
-/* Set up the loaded object described by L so its unrelocated PLT
+/* Set up the loaded object described by MAP so its unrelocated PLT
    entries will jump to the on-demand fixup code in dl-runtime.c.
    Also install a small trampoline to be used by entries that have
    been relocated to an address too far away for a single branch.  */
 extern int __elf_machine_runtime_setup (struct link_map *map,
                                        int lazy, int profile);
-#define elf_machine_runtime_setup __elf_machine_runtime_setup
+
+static inline int
+elf_machine_runtime_setup (struct link_map *map,
+                          int lazy, int profile)
+{
+  if (map->l_info[DT_JMPREL] == 0)
+    return lazy;
+
+  if (map->l_info[DT_PPC(GOT)] == 0)
+    /* Handle old style PLT.  */
+    return __elf_machine_runtime_setup (map, lazy, profile);
+
+  /* New style non-exec PLT consisting of an array of addresses.  */
+  map->l_info[DT_PPC(GOT)]->d_un.d_ptr += map->l_addr;
+  if (lazy)
+    {
+      Elf32_Addr *plt, *got, glink;
+      Elf32_Word num_plt_entries;
+      void (*dlrr) (void);
+      extern void _dl_runtime_resolve (void);
+      extern void _dl_prof_resolve (void);
+
+      if (__builtin_expect (!profile, 1))
+       dlrr = _dl_runtime_resolve;
+      else
+       {
+         if (GLRO(dl_profile) != NULL
+             &&_dl_name_match_p (GLRO(dl_profile), map))
+           GL(dl_profile_map) = map;
+         dlrr = _dl_prof_resolve;
+       }
+      got = (Elf32_Addr *) map->l_info[DT_PPC(GOT)]->d_un.d_ptr;
+      glink = got[1];
+      got[1] = (Elf32_Addr) dlrr;
+      got[2] = (Elf32_Addr) map;
+
+      /* Relocate everything in .plt by the load address offset.  */
+      plt = (Elf32_Addr *) D_PTR (map, l_info[DT_PLTGOT]);
+      num_plt_entries = (map->l_info[DT_PLTRELSZ]->d_un.d_val
+                        / sizeof (Elf32_Rela));
+
+      /* If a library is prelinked but we have to relocate anyway,
+        we have to be able to undo the prelinking of .plt section.
+        The prelinker saved us at got[1] address of .glink
+        section's start.  */
+      if (glink)
+       {
+         glink += map->l_addr;
+         while (num_plt_entries-- != 0)
+           *plt++ = glink, glink += 4;
+       }
+      else
+       while (num_plt_entries-- != 0)
+         *plt++ += map->l_addr;
+    }
+  return lazy;
+}
 
 /* Change the PLT entry whose reloc is 'reloc' to call the actual routine.  */
 extern Elf32_Addr __elf_machine_fixup_plt (struct link_map *map,
@@ -163,7 +235,12 @@ elf_machine_fixup_plt (struct link_map *map, lookup_t t,
                       const Elf32_Rela *reloc,
                       Elf32_Addr *reloc_addr, Elf64_Addr finaladdr)
 {
-  return __elf_machine_fixup_plt (map, reloc, reloc_addr, finaladdr);
+  if (map->l_info[DT_PPC(GOT)] == 0)
+    /* Handle old style PLT.  */
+    return __elf_machine_fixup_plt (map, reloc, reloc_addr, finaladdr);
+
+  *reloc_addr = finaladdr;
+  return finaladdr;
 }
 
 /* Return the final value of a plt relocation.  */
@@ -286,11 +363,16 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
       break;
 #endif /* USE_TLS etc. */
 
-#ifdef RESOLVE_CONFLICT_FIND_MAP
     case R_PPC_JMP_SLOT:
+#ifdef RESOLVE_CONFLICT_FIND_MAP
       RESOLVE_CONFLICT_FIND_MAP (map, reloc_addr);
-      /* FALLTHROUGH */
 #endif
+      if (map->l_info[DT_PPC(GOT)] != 0)
+       {
+         *reloc_addr = value;
+         break;
+       }
+      /* FALLTHROUGH */
 
     default:
       __process_machine_rela (map, reloc, sym_map, sym, refsym,
index d72202d4a4c62ad1b687807054ed013a210492e3..e1f7f6e24ae2cf3f9a986392aacc92952b6c2f2a 100644 (file)
@@ -47,8 +47,15 @@ ENTRY(_dl_start_user)
    passed by value!).  */
 
 /*  Put our GOT pointer in r31, */
+#ifdef HAVE_ASM_PPC_REL16
+       bcl     20,31,1f
+1:     mflr    r31
+       addis   r31,r31,_GLOBAL_OFFSET_TABLE_-1b@ha
+       addi    r31,r31,_GLOBAL_OFFSET_TABLE_-1b@l
+#else
        bl      _GLOBAL_OFFSET_TABLE_-4@local
        mflr    r31
+#endif
 /*  the address of _start in r30, */
        mr      r30,r3
 /*  &_dl_argc in 29, &_dl_argv in 27, and _dl_loaded in 28.  */
index 7827357a6c2bf4569f249469e3a250c4643fd8e6..bafd2ae00109daa40b574abbb7bf8c0c8d7907a6 100644 (file)
@@ -52,7 +52,7 @@ L(start_addresses):
        ASM_SIZE_DIRECTIVE(L(start_addresses))
 
        .section ".text"
-#ifdef PIC
+#if defined PIC && !defined HAVE_ASM_PPC_REL16
 L(start_addressesp):
        .long   L(start_addresses)-L(branch)
 #endif
@@ -73,11 +73,19 @@ L(branch):
        mtlr    r0
        stw     r0,0(r1)
  /* Set r13 to point at the 'small data area', and put the address of
-    start_addresses in r8...  */
+    start_addresses in r8.  Also load the GOT pointer so that new PLT
+    calls work, like the one to __libc_start_main.  */
 #ifdef PIC
+# ifdef HAVE_ASM_PPC_REL16
+       addis   r30,r13,_GLOBAL_OFFSET_TABLE_-L(branch)@ha
+       addis   r8,r13,L(start_addresses)-L(branch)@ha
+       addi    r30,r30,_GLOBAL_OFFSET_TABLE_-L(branch)@l
+       lwzu    r13,L(start_addresses)-L(branch)@l(r8)
+# else
        lwz     r8,L(start_addressesp)-L(branch)(r13)
        add     r8,r13,r8
        lwz     r13,0(r8)
+# endif
 #else
        lis     r8,L(start_addresses)@ha
        lwzu    r13,L(start_addresses)@l(r8)
index a2415b9542a70e1ae8cdea7c8b2487a28f959bfc..73cc8181f9ee4ea1a4ca6b82b7b7e0c27791600a 100644 (file)
@@ -34,14 +34,21 @@ ENTRY (BP_SYM (__longjmp))
 #ifndef __NO_VMX__
 # ifdef PIC
        mflr    r6
+#  ifdef HAVE_ASM_PPC_REL16
+       bcl     20,31,1f
+1:     mflr    r5
+       addis   r5,r5,_GLOBAL_OFFSET_TABLE_-1b@ha
+       addi    r5,r5,_GLOBAL_OFFSET_TABLE_-1b@l
+#  else
        bl      _GLOBAL_OFFSET_TABLE_@local-4
        mflr    r5
+#  endif
 #  ifdef SHARED
        lwz     r5,_rtld_global_ro@got(r5)
        mtlr    r6
        lwz     r5,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET(r5)
 #  else
-       lwz     r5,_rtld_global_ro@got(r5)
+       lwz     r5,_dl_hwcap@got(r5)
        mtlr    r6
        lwz     r5,0(r5)
 #  endif
index 7924e34648c0390cbd55591ea0a387e0edfe7d64..13afba88f02b89f927bf74da1e38223cb4e87b9a 100644 (file)
@@ -29,11 +29,19 @@ ENTRY (__ceil)
        mffs    fp11            /* Save current FPU rounding mode.  */
 #ifdef SHARED
        mflr    r11
+# ifdef HAVE_ASM_PPC_REL16
+       bcl     20,31,1f
+1:     mflr    r9
+       addis   r9,r9,.LC0-1b@ha
+       mtlr    r11
+       lfs     fp13,.LC0-1b@l(r9)
+# else
        bl      _GLOBAL_OFFSET_TABLE_@local-4
        mflr    r10
        lwz     r9,.LC0@got(10)
        mtlr    r11
        lfs     fp13,0(r9)
+# endif
 #else
        lis     r9,.LC0@ha
        lfs     fp13,.LC0@l(r9)
index 9315d8d2df12a306c20f49742e27cf8287000658..f8ca1de08c8be0423da59acfd022fcbe60e2b9d2 100644 (file)
@@ -20,7 +20,7 @@
 #include <sysdep.h>
 
        .section        .rodata.cst4,"aM",@progbits,4
-       .align 2
+       .align  2
 .LC0:  /* 2**23 */
        .long 0x4b000000
 
@@ -29,11 +29,19 @@ ENTRY (__ceilf)
        mffs    fp11            /* Save current FPU rounding mode.  */
 #ifdef SHARED
        mflr    r11
+# ifdef HAVE_ASM_PPC_REL16
+       bcl     20,31,1f
+1:     mflr    r9
+       addis   r9,r9,.LC0-1b@ha
+       mtlr    r11
+       lfs     fp13,.LC0-1b@l(r9)
+# else
        bl      _GLOBAL_OFFSET_TABLE_@local-4
        mflr    r10
        lwz     r9,.LC0@got(10)
        mtlr    r11
        lfs     fp13,0(r9)
+# endif
 #else
        lis     r9,.LC0@ha
        lfs     fp13,.LC0@l(r9)
index 933435da3d08deb7687684dd57fc3f8000e32296..ee2c09cba8cdb0bc42763cd66e85e189d15fc57a 100644 (file)
@@ -38,13 +38,13 @@ L(0):       fnabs   fp1,fp1
        blr
        END (__copysign)
 
-weak_alias(__copysign,copysign)
+weak_alias (__copysign,copysign)
 
 /* It turns out that it's safe to use this code even for single-precision.  */
-weak_alias(__copysign,copysignf)
+weak_alias (__copysign,copysignf)
 strong_alias(__copysign,__copysignf)
 
 #ifdef NO_LONG_DOUBLE
-weak_alias(__copysign,copysignl)
+weak_alias (__copysign,copysignl)
 strong_alias(__copysign,__copysignl)
 #endif
index c8f59c24a6e8b69dadccbe75ce767ae892d36b87..5dfe8f2d9a12d70134bee63ffea76f420cab58a1 100644 (file)
@@ -29,11 +29,19 @@ ENTRY (__floor)
        mffs    fp11            /* Save current FPU rounding mode.  */
 #ifdef SHARED
        mflr    r11
+# ifdef HAVE_ASM_PPC_REL16
+       bcl     20,31,1f
+1:     mflr    r9
+       addis   r9,r9,.LC0-1b@ha
+       mtlr    r11
+       lfs     fp13,.LC0-1b@l(r9)
+# else
        bl      _GLOBAL_OFFSET_TABLE_@local-4
        mflr    r10
        lwz     r9,.LC0@got(10)
        mtlr    r11
        lfs     fp13,0(r9)
+# endif
 #else
        lis     r9,.LC0@ha
        lfs     fp13,.LC0@l(r9)
index 8ee0644ac9022d8f8cb6a675b5e034e951191f2b..31b71ad229652d49e67f92241179e46abd077df9 100644 (file)
@@ -20,7 +20,7 @@
 #include <sysdep.h>
 
        .section        .rodata.cst4,"aM",@progbits,4
-       .align 2
+       .align  2
 .LC0:  /* 2**23 */
        .long 0x4b000000
 
@@ -29,11 +29,19 @@ ENTRY (__floorf)
        mffs    fp11            /* Save current FPU rounding mode.  */
 #ifdef SHARED
        mflr    r11
+# ifdef HAVE_ASM_PPC_REL16
+       bcl     20,31,1f
+1:     mflr    r9
+       addis   r9,r9,.LC0-1b@ha
+       mtlr    r11
+       lfs     fp13,.LC0-1b@l(r9)
+# else
        bl      _GLOBAL_OFFSET_TABLE_@local-4
        mflr    r10
        lwz     r9,.LC0@got(10)
        mtlr    r11
        lfs     fp13,0(r9)
+# endif
 #else
        lis     r9,.LC0@ha
        lfs     fp13,.LC0@l(r9)
index 72fd49ba463c9b51486456aa4e0048181940abae..a85743164c051b72cecf07ffcd06c87d7a69b3aa 100644 (file)
 ENTRY (__lround)
 #ifdef SHARED
        mflr    r11
+# ifdef HAVE_ASM_PPC_REL16
+       bcl     20,31,1f
+1:     mflr    r9
+       addis   r9,r9,.LC0-1b@ha
+       addi    r9,r9,.LC0-1b@l
+# else
        bl      _GLOBAL_OFFSET_TABLE_@local-4
        mflr    r10
        lwz     r9,.LC0@got(10)
+# endif
        mtlr    r11
        lfs     fp12,0(r9)
 #else
index 4abdcedfe8d02e985e84ca7c2e6892a20b091a24..1cfcd78b5c21ff22a961af6bd5c5c4db073d530f 100644 (file)
 ENTRY (__rint)
 #ifdef SHARED
        mflr    r11
+# ifdef HAVE_ASM_PPC_REL16
+       bcl     20,31,1f
+1:     mflr    r9
+       addis   r9,r9,.LC0-1b@ha
+       mtlr    r11
+       lfs     fp13,.LC0-1b@l(r9)
+# else
        bl      _GLOBAL_OFFSET_TABLE_@local-4
        mflr    r10
        lwz     r9,.LC0@got(10)
        mtlr    r11
        lfs     fp13,0(r9)
+# endif
 #else
        lis     r9,.LC0@ha
        lfs     fp13,.LC0@l(r9)
index d02bd066b81ff95a6b19ad7bd7c478180f60cf99..93c02667fe9add58602d9a818287b2d1f4f3288b 100644 (file)
@@ -20,7 +20,7 @@
 #include <sysdep.h>
 
        .section        .rodata.cst4,"aM",@progbits,4
-       .align 2
+       .align  2
 .LC0:  /* 2**23 */
        .long 0x4b000000
 
 ENTRY (__rintf)
 #ifdef SHARED
        mflr    r11
+# ifdef HAVE_ASM_PPC_REL16
+       bcl     20,31,1f
+1:     mflr    r9
+       addis   r9,r9,.LC0-1b@ha
+       mtlr    r11
+       lfs     fp13,.LC0-1b@l(r9)
+# else
        bl      _GLOBAL_OFFSET_TABLE_@local-4
        mflr    r10
        lwz     r9,.LC0@got(10)
        mtlr    r11
        lfs     fp13,0(r9)
+# endif
 #else
        lis     r9,.LC0@ha
        lfs     fp13,.LC0@l(r9)
index 96fc2984fd451f3b1c5831a0cee08b4bea97c440..53b45916d10d21a0874ae95cbab35d4a541e6dcc 100644 (file)
@@ -41,9 +41,16 @@ ENTRY (__round)
        mffs    fp11            /* Save current FPU rounding mode.  */
 #ifdef SHARED
        mflr    r11
+# ifdef HAVE_ASM_PPC_REL16
+       bcl     20,31,1f
+1:     mflr    r9
+       addis   r9,r9,.LC0-1b@ha
+       addi    r9,r9,.LC0-1b@l
+# else
        bl      _GLOBAL_OFFSET_TABLE_@local-4
        mflr    r10
        lwz     r9,.LC0@got(10)
+# endif
        mtlr    r11
        lfs     fp13,0(r9)
 #else
index 87965dea8088074ea414a4eff6fd4333cd990a64..39ba08655adbc9ca805287483137effb5a90d786 100644 (file)
@@ -41,9 +41,16 @@ ENTRY (__roundf )
        mffs    fp11            /* Save current FPU rounding mode.  */
 #ifdef SHARED
        mflr    r11
+# ifdef HAVE_ASM_PPC_REL16
+       bcl     20,31,1f
+1:     mflr    r9
+       addis   r9,r9,.LC0-1b@ha
+       addi    r9,r9,.LC0-1b@l
+# else
        bl      _GLOBAL_OFFSET_TABLE_@local-4
        mflr    r10
        lwz     r9,.LC0@got(10)
+# endif
        mtlr    r11
        lfs     fp13,0(r9)
 #else
index 7a3e705a81fcd0ed00571c879321f871a10ba88c..827e8cb940c747c253b399f1cc78c2bf40afbb01 100644 (file)
@@ -36,11 +36,19 @@ ENTRY (__trunc)
        mffs    fp11            /* Save current FPU rounding mode.  */
 #ifdef SHARED
        mflr    r11
+# ifdef HAVE_ASM_PPC_REL16
+       bcl     20,31,1f
+1:     mflr    r9
+       addis   r9,r9,.LC0-1b@ha
+       mtlr    r11
+       lfs     fp13,.LC0-1b@l(r9)
+# else
        bl      _GLOBAL_OFFSET_TABLE_@local-4
        mflr    r10
        lwz     r9,.LC0@got(10)
        mtlr    r11
        lfs     fp13,0(r9)
+# endif
 #else
        lis     r9,.LC0@ha
        lfs     fp13,.LC0@l(r9)
index 5275c69d292981a007ff026a48eb70f92b8c3f52..55e7a74b417b2cb7e375d07af90ae493e04e8311 100644 (file)
@@ -20,7 +20,7 @@
 #include <sysdep.h>
 
        .section        .rodata.cst4,"aM",@progbits,4
-       .align 2
+       .align  2
 .LC0:  /* 2**23 */
        .long 0x4b000000
 
@@ -36,11 +36,19 @@ ENTRY (__truncf)
        mffs    fp11            /* Save current FPU rounding mode.  */
 #ifdef SHARED
        mflr    r11
+# ifdef HAVE_ASM_PPC_REL16
+       bcl     20,31,1f
+1:     mflr    r9
+       addis   r9,r9,.LC0-1b@ha
+       mtlr    r11
+       lfs     fp13,.LC0-1b@l(r9)
+# else
        bl      _GLOBAL_OFFSET_TABLE_@local-4
        mflr    r10
        lwz     r9,.LC0@got(10)
        mtlr    r11
        lfs     fp13,0(r9)
+# endif
 #else
        lis     r9,.LC0@ha
        lfs     fp13,.LC0@l(r9)
index e0c0606da434be682959ab67348066e687d2058a..cf3f215f2d3e13e9d568c16c58f24e3ff43019df 100644 (file)
@@ -74,20 +74,27 @@ ENTRY (BP_SYM (__sigsetjmp))
        stw  r31,((JB_GPRS+17)*4)(3)
        stfd fp31,((JB_FPRS+17*2)*4)(3)
 #ifndef __NO_VMX__
-#ifdef PIC
+# ifdef PIC
        mflr    r6
+#  ifdef HAVE_ASM_PPC_REL16
+       bcl     20,31,1f
+1:     mflr    r5
+       addis   r5,r5,_GLOBAL_OFFSET_TABLE_-1b@ha
+       addi    r5,r5,_GLOBAL_OFFSET_TABLE_-1b@l
+#  else
        bl      _GLOBAL_OFFSET_TABLE_@local-4
        mflr    r5
-#ifdef SHARED
+#  endif
+#  ifdef SHARED
        lwz     r5,_rtld_global_ro@got(r5)
        mtlr    r6
        lwz     r5,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET(r5)
-#else
-       lwz     r5,_rtld_global_ro@got(r5)
+#  else
+       lwz     r5,_dl_hwcap@got(r5)
        mtlr    r6
        lwz     r5,0(r5)
-#endif
-#else
+#  endif
+# else
        lis     r5,_dl_hwcap@ha
        lwz     r5,_dl_hwcap@l(r5)
 #endif
index 4c0edc8e45f99b7e00a97f96ec8b9a0f85b2ffd4..f09c2946748ce924bb8f076623b1a6b0593b274c 100644 (file)
@@ -264,10 +264,17 @@ L(checklinesize):
        beq     L(medium)
 /* Establishes GOT addressability so we can load __cache_line_size
    from static. This value was set from the aux vector during startup.  */
+# ifdef HAVE_ASM_PPC_REL16
+       bcl     20,31,1f
+1:     mflr    rGOT
+       addis   rGOT,rGOT,__cache_line_size-1b@ha
+       lwz     rCLS,__cache_line_size-1b@l(rGOT)
+# else
        bl      _GLOBAL_OFFSET_TABLE_@local-4
        mflr    rGOT
        lwz     rGOT,__cache_line_size@got(rGOT)
        lwz     rCLS,0(rGOT)
+# endif
        mtlr    rTMP
 #else
 /* Load __cache_line_size from static. This value was set from the
index 314c8ee703a1c3a8afe14a5cc91b56797afb030c..c1a08d379c28e58fdf1947cc5d43383bf9d63989 100644 (file)
@@ -1,5 +1,5 @@
 /* PowerPC-specific implementation of profiling support.
-   Copyright (C) 1997, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1999, 2005 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
 
 #include <sysdep.h>
 
-/* We do profiling as described in the SYSV ELF ABI, _mcount is called
-   with the address of a data word in r0 (that is different for every
-   routine, initialised to 0, and otherwise unused).  The caller has put
-   the address the caller will return to in the usual place on the stack,
-   4(r1).  _mcount is responsible for ensuring that when it returns no
-   argument-passing registers are disturbed, and that the LR is set back
-   to (what the caller sees as) 4(r1).
+/* We do profiling as described in the SYSV ELF ABI, except that glibc
+   _mcount manages its own counters.  The caller has put the address the
+   caller will return to in the usual place on the stack, 4(r1).  _mcount
+   is responsible for ensuring that when it returns no argument-passing
+   registers are disturbed, and that the LR is set back to (what the
+   caller sees as) 4(r1).
 
    This is intended so that the following code can be inserted at the
    front of any routine without changing the routine:
 
        .data
-       .align  2
-   0:  .long   0
-       .previous
        mflr    r0
-       lis     r11,0b@ha
        stw     r0,4(r1)
-       addi    r0,r11,0b@l
        bl      _mcount
 */
 
index 775073f32513c567853fd211c538868a94e71f87..552f595a10f607c17346a02b60d238b62ec20e88 100644 (file)
 /* The mcount code relies on a the return address being on the stack
    to locate our caller and so it can restore it; so store one just
    for its benefit.  */
-# ifdef PIC
-#  define CALL_MCOUNT                                                        \
-  .pushsection;                                                                      \
-  .section ".data";                                                                  \
-  .align ALIGNARG(2);                                                        \
-0:.long 0;                                                                   \
-  .previous;                                                                 \
-  mflr  r0;                                                                  \
-  stw   r0,4(r1);                                                            \
-  bl    _GLOBAL_OFFSET_TABLE_@local-4;                                       \
-  mflr  r11;                                                                 \
-  lwz   r0,0b@got(r11);                                                              \
-  bl    JUMPTARGET(_mcount);
-# else  /* PIC */
-#  define CALL_MCOUNT                                                        \
-  .section ".data";                                                          \
-  .align ALIGNARG(2);                                                        \
-0:.long 0;                                                                   \
-  .previous;                                                                 \
+# define CALL_MCOUNT                                                         \
   mflr  r0;                                                                  \
-  lis   r11,0b@ha;                                                           \
   stw   r0,4(r1);                                                            \
-  addi  r0,r11,0b@l;                                                         \
   bl    JUMPTARGET(_mcount);
-# endif /* PIC */
 #else  /* PROF */
 # define CALL_MCOUNT           /* Do nothing.  */
 #endif /* PROF */
index 8669b6a689961cc4f1569d7115291c9cd728090c..9c8ebbb18db8062976beb581cef59d1dbce6b5db 100644 (file)
@@ -1,5 +1,5 @@
 /* Return backtrace of current program state.
-   Copyright (C) 1998, 2000, 2002 Free Software Foundation, Inc.
+   Copyright (C) 1998, 2000, 2002, 2005 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
@@ -67,3 +67,4 @@ __backtrace (void **array, int size)
   return count;
 }
 weak_alias (__backtrace, backtrace)
+libc_hidden_def (__backtrace)
index a43ed12cf0e978b7e056a92ab455d504cc4d1182..f083d2b7ead95c3004d413145280f2a1e49072af 100644 (file)
@@ -39,13 +39,13 @@ L(0):       fnabs   fp1,fp1
        blr
        END (__copysign)
 
-weak_alias(__copysign,copysign)
+weak_alias (__copysign,copysign)
 
 /* It turns out that it's safe to use this code even for single-precision.  */
-weak_alias(__copysign,copysignf)
+weak_alias (__copysign,copysignf)
 strong_alias(__copysign,__copysignf)
 
 #ifdef NO_LONG_DOUBLE
-weak_alias(__copysign,copysignl)
+weak_alias (__copysign,copysignl)
 strong_alias(__copysign,__copysignl)
 #endif
index 7a632572b597b746426825d7de7b7a4aa910b875..6adc3bc3d17c2fba51db2df2409014e4c16c9b4d 100644 (file)
@@ -1,6 +1,6 @@
 /* Return backtrace of current program state.
-   Copyright (C) 2000, 2001, 2003, 2004 Free Software Foundation, Inc.
-   Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
+   Copyright (C) 2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc.
+   Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com>.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -142,3 +142,4 @@ __backtrace (void **array, int size)
 }
 
 weak_alias (__backtrace, backtrace)
+libc_hidden_def (__backtrace)
index 8ecdd0edae510f0dbf55320a095cec921745bdd8..6d11f9bbdbd577cf37680776d456527dc48c9ef7 100644 (file)
@@ -81,4 +81,4 @@ C_LABEL(_mcount)
        ASM_SIZE_DIRECTIVE(C_SYMBOL_NAME(_mcount))
 
 #undef mcount
-weak_alias(_mcount, mcount)
+weak_alias (_mcount, mcount)
index 05321349ca66d0d566be35d57944cbb152505c69..7ba195cb7ae59815389e78e05e01a99ace7101d0 100644 (file)
@@ -1,6 +1,6 @@
 /* Return backtrace of current program state.  64 bit S/390 version.
-   Copyright (C) 2001, 2003, 2004 Free Software Foundation, Inc.
-   Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
+   Copyright (C) 2001, 2003, 2004, 2005 Free Software Foundation, Inc.
+   Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com>.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -141,3 +141,4 @@ __backtrace (void **array, int size)
 }
 
 weak_alias (__backtrace, backtrace)
+libc_hidden_def (__backtrace)
index 5e3890b4f6c6decb9e6a7bc8a5b355c439a0fd73..0fa614cbf42139db7f21234606fcc5b1b35ea78b 100644 (file)
@@ -69,4 +69,4 @@ C_LABEL(_mcount)
        ASM_SIZE_DIRECTIVE(C_SYMBOL_NAME(_mcount))
 
 #undef mcount
-weak_alias(_mcount, mcount)
+weak_alias (_mcount, mcount)
index 8e91e998bf568852674ef336fe71bbd22a2bce81..e6204e8ac9983b67b3bf7bd7d70de840bc13c57e 100644 (file)
@@ -152,4 +152,4 @@ ENTRY(memset)
 END(memset)
 libc_hidden_builtin_def (memset)
 
-weak_alias(__bzero, bzero)
+weak_alias (__bzero, bzero)
index 937fed35f85717716945cf22da0722d961f77427..e6688a9b21c6769c4f35bd1c29cb3a92792966f4 100644 (file)
@@ -160,6 +160,6 @@ ENTRY(__stpcpy)
         nop
 END(__stpcpy)
 
-weak_alias(__stpcpy, stpcpy)
+weak_alias (__stpcpy, stpcpy)
 libc_hidden_def (__stpcpy)
 libc_hidden_builtin_def (stpcpy)
index b5be3adf604816d673642ea0eee1f71eef0c2048..6120ecd6a35d443a521c4160a4f9a47c70984c6b 100644 (file)
@@ -278,7 +278,7 @@ ENTRY(strrchr)
         mov            %o5, %o0
 END(strrchr)
 
-weak_alias(strchr, index)
-weak_alias(strrchr, rindex)
+weak_alias (strchr, index)
+weak_alias (strrchr, rindex)
 libc_hidden_builtin_def (strchr)
 libc_hidden_builtin_def (strrchr)
index 074767b983c9a911bcf9558e232dff9d723661fa..f9502d63f55ef992b84102b763452ef58a3a9cf8 100644 (file)
@@ -139,5 +139,5 @@ ENTRY(memcmp)
 END(memcmp)
 
 #undef bcmp
-weak_alias(memcmp, bcmp)
+weak_alias (memcmp, bcmp)
 libc_hidden_builtin_def (memcmp)
index 3742573248d89577ca9ff50f4a6119879900c620..a3f7b96a91eb7b0f0f4d9346d3c5a6213e0b8f92 100644 (file)
@@ -914,8 +914,8 @@ ENTRY(memmove)
 END(memmove)
 
 #ifdef USE_BPR
-weak_alias(memcpy, __align_cpy_1)
-weak_alias(memcpy, __align_cpy_2)
+weak_alias (memcpy, __align_cpy_1)
+weak_alias (memcpy, __align_cpy_2)
 #endif
 libc_hidden_builtin_def (memcpy)
 libc_hidden_builtin_def (memmove)
index b34ccc8869d3de21ecf4ccf743f5e5a30b377fb4..99624ba9d7865186509c6f30abd4416d3f310998 100644 (file)
@@ -312,4 +312,4 @@ ENTRY(__bzero)
         mov            %o5, %o0
 END(__bzero)
 
-weak_alias(__bzero, bzero)
+weak_alias (__bzero, bzero)
index 8b70b0a932621a94ef3f4bc96698fb2ee8a18d2c..760d526630d89afd70e2d02a0923e7c21c088598 100644 (file)
@@ -600,11 +600,11 @@ ENTRY(memmove)
 END(memmove)
 
 #ifdef USE_BPR
-weak_alias(memcpy, __align_cpy_1)
-weak_alias(memcpy, __align_cpy_2)
-weak_alias(memcpy, __align_cpy_4)
-weak_alias(memcpy, __align_cpy_8)
-weak_alias(memcpy, __align_cpy_16)
+weak_alias (memcpy, __align_cpy_1)
+weak_alias (memcpy, __align_cpy_2)
+weak_alias (memcpy, __align_cpy_4)
+weak_alias (memcpy, __align_cpy_8)
+weak_alias (memcpy, __align_cpy_16)
 #endif
 libc_hidden_builtin_def (memcpy)
 libc_hidden_builtin_def (memmove)
index 3a1717daf3fb3db59c7ca8b3cf08d6ef9e79d499..8f82ac848d7c7e4e5ef1db9eb181e00c9478b17a 100644 (file)
@@ -93,6 +93,7 @@ int
 clock_gettime (clockid_t clock_id, struct timespec *tp)
 {
   int retval = -1;
+  struct timeval tv;
 
   switch (clock_id)
     {
@@ -102,7 +103,9 @@ clock_gettime (clockid_t clock_id, struct timespec *tp)
 
 #ifndef HANDLED_REALTIME
     case CLOCK_REALTIME:
-      HANDLE_REALTIME;
+      retval = gettimeofday (&tv, NULL);
+      if (retval == 0)
+       TIMEVAL_TO_TIMESPEC (&tv, tp);
       break;
 #endif
 
index ce4a5da37f194f544574ecbe2c609de29e3c890f..c4a9b77e2eae9bb5037b266d92f94ca5b8d70245 100644 (file)
@@ -1,5 +1,5 @@
 /* O_*, F_*, FD_* bit values for Linux.
-   Copyright (C) 1995-1999, 2000, 2004 Free Software Foundation, Inc.
+   Copyright (C) 1995-1999, 2000, 2004, 2005 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
@@ -44,9 +44,9 @@
 #define O_ASYNC                020000  /* fcntl, for BSD compatibility */
 
 #ifdef __USE_GNU
-# define O_DIRECT      040000  /* Direct disk access.  */
 # define O_DIRECTORY   0100000 /* Must be a directory.  */
 # define O_NOFOLLOW    0200000 /* Do not follow links.  */
+# define O_DIRECT      02000000 /* Direct disk access.  */
 # define O_NOATIME     04000000 /* Do not set atime.  */
 #endif
 
index 54d68194121063c67237d64188a4e052ae19c9ca..8bbd301dd991f89774953bc5735e6fe729714c7a 100644 (file)
@@ -1,5 +1,5 @@
 /* Bit values & structures for resource limits.  Alpha/Linux version.
-   Copyright (C) 1994, 1996, 1997, 1998, 1999, 2000, 2004
+   Copyright (C) 1994, 1996, 1997, 1998, 1999, 2000, 2004, 2005
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -89,7 +89,18 @@ enum __rlimit_resource
   __RLIMIT_MSGQUEUE = 12,
 #define RLIMIT_MSGQUEUE __RLIMIT_MSGQUEUE
 
-  __RLIMIT_NLIMITS = 13,
+  /* Maximum nice priority allowed to raise to.
+     Nice levels 19 .. -20 correspond to 0 .. 39
+     values of this resource limit.  */
+  __RLIMIT_NICE = 13,
+#define RLIMIT_NICE __RLIMIT_NICE
+
+  /* Maximum realtime priority allowed for non-priviledged
+     processes.  */
+  __RLIMIT_RTPRIO = 14,
+#define RLIMIT_RTPRIO _RLIMIT_RTPRIO
+
+  __RLIMIT_NLIMITS = 15,
   __RLIM_NLIMITS = __RLIMIT_NLIMITS
 #define RLIMIT_NLIMITS __RLIMIT_NLIMITS
 #define RLIM_NLIMITS __RLIM_NLIMITS
index 1c450d173730493b450b12d77e2b97c0633e1192..5e0b21ea1574bc177d8f4ae7b41113e5aca44325 100644 (file)
@@ -146,4 +146,4 @@ thread_start:
 
        .end thread_start
 
-weak_alias(__clone, clone)
+weak_alias (__clone, clone)
index 3566890cf99e4f98d1cc6f62c1833730a62fc63c..bf9820ac7320d01ccd5330539d823a090c63cc32 100644 (file)
@@ -41,7 +41,7 @@ ENTRY (__getcontext)
        ret
 
 END(__getcontext)
-weak_alias(__getcontext, getcontext)
+weak_alias (__getcontext, getcontext)
 
 
 /* An internal routine used by getcontext and setcontext.
index 2c34e98ce69714b5006a2c820b6c646033159f47..46797aa83ba01bc9bdb3c94a2aefb48d69c09254 100644 (file)
@@ -145,5 +145,5 @@ strong_alias(__getrusage_tv64, ____getrusage_tv64)
 default_symbol_version (____getrusage_tv64, __getrusage, GLIBC_2.1)
 default_symbol_version (__getrusage_tv64, getrusage, GLIBC_2.1)
 #else
-weak_alias(__getrusage, getrusage)
+weak_alias (__getrusage, getrusage)
 #endif
index 7d443d41c78f1e1f72b88864cbe4ec5c8885d725..27abfd0c12171af993da45f4afe8695fe12d1ed8 100644 (file)
@@ -32,4 +32,4 @@
 PSEUDO(__setcontext, sigreturn, 1)
        ret
 PSEUDO_END(__setcontext)
-weak_alias(__setcontext, setcontext)
+weak_alias (__setcontext, setcontext)
index e5de55faebddef1f8768575d4885b8f0c3664525..48c3f271c7bca3841f0151dc0fbde0a4477fe9ba 100644 (file)
@@ -29,5 +29,5 @@ PSEUDO(__sigsuspend, sigsuspend, 1)
        ret
 PSEUDO_END(__sigsuspend)
 libc_hidden_def (__sigsuspend)
-weak_alias(__sigsuspend, sigsuspend)
+weak_alias (__sigsuspend, sigsuspend)
 strong_alias (__sigsuspend, __libc_sigsuspend)
index 5f6615e0b624472143de000d93f07490ae36f03d..1221f67f781acd4f54a10309107b97d96ee0719c 100644 (file)
@@ -48,4 +48,4 @@ ENTRY(__swapcontext)
 #endif
 
 END(__swapcontext)
-weak_alias(__swapcontext, swapcontext)
+weak_alias (__swapcontext, swapcontext)
index 10a32d5dc81168496d54e31a0c24fa162fe66959..0c4081363a9b75a06d36fa279fd71ef1d3311eb6 100644 (file)
@@ -74,4 +74,4 @@ $error:
 
 END(__syscall)
 
-weak_alias(__syscall, syscall)
+weak_alias (__syscall, syscall)
index c186a3a5d0324098f2fb795d6597f5c3bc0b4acf..115739d43927b267fb56074a8be54db83e14127d 100644 (file)
@@ -1,5 +1,5 @@
 /* Bit values & structures for resource limits.  Linux version.
-   Copyright (C) 1994, 1996, 1997, 1998, 1999, 2000, 2004
+   Copyright (C) 1994, 1996, 1997, 1998, 1999, 2000, 2004, 2005
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -89,7 +89,18 @@ enum __rlimit_resource
   __RLIMIT_MSGQUEUE = 12,
 #define RLIMIT_MSGQUEUE __RLIMIT_MSGQUEUE
 
-  __RLIMIT_NLIMITS = 13,
+  /* Maximum nice priority allowed to raise to.
+     Nice levels 19 .. -20 correspond to 0 .. 39
+     values of this resource limit.  */
+  __RLIMIT_NICE = 13,
+#define RLIMIT_NICE __RLIMIT_NICE
+
+  /* Maximum realtime priority allowed for non-priviledged
+     processes.  */
+  __RLIMIT_RTPRIO = 14,
+#define RLIMIT_RTPRIO _RLIMIT_RTPRIO
+
+  __RLIMIT_NLIMITS = 15,
   __RLIM_NLIMITS = __RLIMIT_NLIMITS
 #define RLIMIT_NLIMITS __RLIMIT_NLIMITS
 #define RLIM_NLIMITS __RLIM_NLIMITS
index 4f3bb9e2067d9b84e13e36dfe4312ff99d02083b..f497bca13d13935ca39c1f815a71db867ac2976b 100644 (file)
@@ -96,4 +96,4 @@ thread_start:
 
 PSEUDO_END(__clone)
 
-weak_alias(__clone, clone)
+weak_alias (__clone, clone)
index 76ba6047c153aee1a1dc1bb6b71b965ecf4ccff1..fe28f1e0e1e260cb1959bf52e4e85ac916b7aaf9 100644 (file)
@@ -82,4 +82,4 @@ L(pseudo_end):
        ret
 PSEUDO_END(__getcontext)
 
-weak_alias(__getcontext, getcontext)
+weak_alias (__getcontext, getcontext)
index 03dc648c59c7080f822e0e81afdc95604c41f5d7..12ba4e2d67e91c340516cd2954dfe0341118d5b1 100644 (file)
@@ -114,4 +114,4 @@ L(exitcode):
        cfi_startproc
 END(__makecontext)
 
-weak_alias(__makecontext, makecontext)
+weak_alias (__makecontext, makecontext)
index c493cf9798ecd52bd0e58e2f6af944d197c637c8..bf2d7d2bad36cc4ba89499c440146c0c3059a474 100644 (file)
@@ -94,4 +94,4 @@ L(pseudo_end):
        ret
 PSEUDO_END(__setcontext)
 
-weak_alias(__setcontext, setcontext)
+weak_alias (__setcontext, setcontext)
index d909e659e410dd7560254c1ddeaef1d3c36e33ce..27c16200b22cc382448b7296d9b67dad754e1174 100644 (file)
@@ -109,4 +109,4 @@ L(pseudo_end):
        ret
 PSEUDO_END(__swapcontext)
 
-weak_alias(__swapcontext, swapcontext)
+weak_alias (__swapcontext, swapcontext)
index a9637be33de0fce1714459fe1e50ce74cc6c8dd5..99f9bf1edf04cc8db429da3caf3273b4414815a4 100644 (file)
 # define SYSCALL_ERROR_HANDLER /* Nothing here; code in sysdep.S is used.  */
 #else
 
-# ifndef HAVE_HIDDEN
-#  define SETUP_PIC_REG(reg) \
-  call 1f;                                                                   \
-  .subsection 1;                                                             \
-1:movl (%esp), %e##reg;                                                              \
-  ret;                                                                       \
-  .previous
-# else
-#  define SETUP_PIC_REG(reg) \
-  .ifndef __i686.get_pc_thunk.reg;                                           \
-  .section .gnu.linkonce.t.__i686.get_pc_thunk.reg,"ax",@progbits;           \
-  .globl __i686.get_pc_thunk.reg;                                            \
-  .hidden __i686.get_pc_thunk.reg;                                           \
-  .type __i686.get_pc_thunk.reg,@function;                                   \
-__i686.get_pc_thunk.reg:                                                     \
-  movl (%esp), %e##reg;                                                              \
-  ret;                                                                       \
-  .size __i686.get_pc_thunk.reg, . - __i686.get_pc_thunk.reg;                \
-  .previous;                                                                 \
-  .endif;                                                                    \
-  call __i686.get_pc_thunk.reg
-# endif
-
-# define LOAD_PIC_REG(reg) \
-  SETUP_PIC_REG(reg); addl $_GLOBAL_OFFSET_TABLE_, %e##reg
-
 # if RTLD_PRIVATE_ERRNO
 #  define SYSCALL_ERROR_HANDLER                                                      \
 0:SETUP_PIC_REG(cx);                                                         \
index 0f9cc5db19de797a7d93fedc16172f965665a4db..4e18bace2d12a32c9b5ae5b694bea92c2bd61ddc 100644 (file)
@@ -155,4 +155,4 @@ ENTRY(__getcontext)
        ret
 END(__getcontext)
 
-weak_alias(__getcontext, getcontext)
+weak_alias (__getcontext, getcontext)
index e18c40fa4ce37c851bdaea9135c07c73158b0883..ef0a93c0c06006a8a1843fa20bb18a5aab4d85ee 100644 (file)
@@ -150,4 +150,4 @@ ENTRY(__setcontext)
        ret
 END(__setcontext)
 
-weak_alias(__setcontext, setcontext)
+weak_alias (__setcontext, setcontext)
index 377ccf51993c2a488fdf31170d4c5763b9777aa5..66f0ac131733ff398642e82fac01086228ff4d8d 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (C) 1997,98,99,2000,2002,2003,2004 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2005
+   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
@@ -188,12 +189,8 @@ if_nameindex_netlink (void)
 
 
   /* Tell the kernel that we wish to get a list of all
-     active interfaces.  */
-  if (__netlink_sendreq (&nh, RTM_GETLINK) < 0)
-    goto exit_close;
-
-  /* Collect all data for every interface.  */
-  if (__netlink_receive (&nh) < 0)
+     active interfaces.  Collect all data for every interface.  */
+  if (__netlink_request (&nh, RTM_GETLINK) < 0)
     goto exit_free;
 
   /* Count the interfaces.  */
@@ -290,7 +287,6 @@ if_nameindex_netlink (void)
 
  exit_free:
   __netlink_free_handle (&nh);
- exit_close:
   __netlink_close (&nh);
 
   return idx;
index 8a052e212db41e0513c08d87a9ce5d866e756a82..f743f702f0445e9b3076827aee2bb9f6ef1e9a21 100644 (file)
@@ -1,5 +1,5 @@
 /* getifaddrs -- get names and addresses of all network interfaces
-   Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2004, 2005 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
@@ -17,6 +17,7 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#include <alloca.h>
 #include <assert.h>
 #include <errno.h>
 #include <ifaddrs.h>
@@ -24,6 +25,7 @@
 #include <netinet/in.h>
 #include <netpacket/packet.h>
 #include <stdbool.h>
+#include <stdint.h>
 #include <stdlib.h>
 #include <string.h>
 #include <sys/ioctl.h>
@@ -84,7 +86,7 @@ __netlink_free_handle (struct netlink_handle *h)
 }
 
 
-int
+static int
 __netlink_sendreq (struct netlink_handle *h, int type)
 {
   struct
@@ -114,15 +116,39 @@ __netlink_sendreq (struct netlink_handle *h, int type)
 
 
 int
-__netlink_receive (struct netlink_handle *h)
+__netlink_request (struct netlink_handle *h, int type)
 {
   struct netlink_res *nlm_next;
-  char buf[4096];
-  struct iovec iov = { buf, sizeof (buf) };
+  struct netlink_res **new_nlm_list;
+  static volatile size_t buf_size = 4096;
+  char *buf;
   struct sockaddr_nl nladdr;
   struct nlmsghdr *nlmh;
-  int read_len;
+  ssize_t read_len;
   bool done = false;
+  bool use_malloc = false;
+
+  if (__netlink_sendreq (h, type) < 0)
+    return -1;
+
+  size_t this_buf_size = buf_size;
+  if (__libc_use_alloca (this_buf_size))
+    buf = alloca (this_buf_size);
+  else
+    {
+      buf = malloc (this_buf_size);
+      if (buf != NULL)
+       use_malloc = true;
+      else
+       goto out_fail;
+    }
+
+  struct iovec iov = { buf, this_buf_size };
+
+  if (h->nlm_list != NULL)
+    new_nlm_list = &h->end_ptr->next;
+  else
+    new_nlm_list = &h->nlm_list;
 
   while (! done)
     {
@@ -136,33 +162,66 @@ __netlink_receive (struct netlink_handle *h)
 
       read_len = TEMP_FAILURE_RETRY (__recvmsg (h->fd, &msg, 0));
       if (read_len < 0)
-       return -1;
+       goto out_fail;
 
-      if (msg.msg_flags & MSG_TRUNC)
-       return -1;
+      if (nladdr.nl_pid != 0)
+       continue;
 
-      nlm_next = (struct netlink_res *) malloc (sizeof (struct netlink_res)
-                                               + read_len);
-      if (nlm_next == NULL)
-       return -1;
-      nlm_next->next = NULL;
-      nlm_next->nlh = memcpy (nlm_next + 1, buf, read_len);
-      nlm_next->size = read_len;
-      nlm_next->seq = h->seq;
-      if (h->nlm_list == NULL)
-       h->nlm_list = nlm_next;
-      else
-       h->end_ptr->next = nlm_next;
-      h->end_ptr = nlm_next;
+      if (__builtin_expect (msg.msg_flags & MSG_TRUNC, 0))
+       {
+         if (this_buf_size >= SIZE_MAX / 2)
+           goto out_fail;
+
+         nlm_next = *new_nlm_list;
+         while (nlm_next != NULL)
+           {
+             struct netlink_res *tmpptr;
+
+             tmpptr = nlm_next->next;
+             free (nlm_next);
+             nlm_next = tmpptr;
+           }
+         *new_nlm_list = NULL;
+
+         if (__libc_use_alloca (2 * this_buf_size))
+           buf = extend_alloca (buf, this_buf_size, 2 * this_buf_size);
+         else
+           {
+             this_buf_size *= 2;
+
+             char *new_buf = realloc (use_malloc ? buf : NULL, this_buf_size);
+             if (new_buf == NULL)
+               goto out_fail;
+             new_buf = buf;
 
+             use_malloc = true;
+           }
+         buf_size = this_buf_size;
+
+         iov.iov_base = buf;
+         iov.iov_len = this_buf_size;
+
+         /* Increase sequence number, so that we can distinguish
+            between old and new request messages.  */
+         h->seq++;
+
+         if (__netlink_sendreq (h, type) < 0)
+           goto out_fail;
+
+         continue;
+       }
+
+      size_t count = 0;
+      size_t remaining_len = read_len;
       for (nlmh = (struct nlmsghdr *) buf;
-          NLMSG_OK (nlmh, (size_t) read_len);
-          nlmh = (struct nlmsghdr *) NLMSG_NEXT (nlmh, read_len))
+          NLMSG_OK (nlmh, remaining_len);
+          nlmh = (struct nlmsghdr *) NLMSG_NEXT (nlmh, remaining_len))
        {
-         if (nladdr.nl_pid != 0 || (pid_t) nlmh->nlmsg_pid != h->pid
+         if ((pid_t) nlmh->nlmsg_pid != h->pid
              || nlmh->nlmsg_seq != h->seq)
            continue;
 
+         ++count;
          if (nlmh->nlmsg_type == NLMSG_DONE)
            {
              /* We found the end, leave the loop.  */
@@ -176,11 +235,38 @@ __netlink_receive (struct netlink_handle *h)
                errno = EIO;
              else
                errno = -nlerr->error;
-             return -1;
+             goto out_fail;
            }
        }
+
+      /* If there was nothing with the expected nlmsg_pid and nlmsg_seq,
+        there is no point to record it.  */
+      if (count == 0)
+       continue;
+
+      nlm_next = (struct netlink_res *) malloc (sizeof (struct netlink_res)
+                                               + read_len);
+      if (nlm_next == NULL)
+       goto out_fail;
+      nlm_next->next = NULL;
+      nlm_next->nlh = memcpy (nlm_next + 1, buf, read_len);
+      nlm_next->size = read_len;
+      nlm_next->seq = h->seq;
+      if (h->nlm_list == NULL)
+       h->nlm_list = nlm_next;
+      else
+       h->end_ptr->next = nlm_next;
+      h->end_ptr = nlm_next;
     }
+
+  if (use_malloc)
+    free (buf);
   return 0;
+
+out_fail:
+  if (use_malloc)
+    free (buf);
+  return -1;
 }
 
 
@@ -268,7 +354,7 @@ getifaddrs (struct ifaddrs **ifap)
   unsigned int i, newlink, newaddr, newaddr_idx;
   int *map_newlink_data;
   size_t ifa_data_size = 0;  /* Size to allocate for all ifa_data.  */
-  char *ifa_data_ptr;        /* Pointer to the unused part of memory for
+  char *ifa_data_ptr;  /* Pointer to the unused part of memory for
                                ifa_data.  */
   int result = 0;
 
@@ -288,28 +374,20 @@ getifaddrs (struct ifaddrs **ifap)
 #endif
 
   /* Tell the kernel that we wish to get a list of all
-     active interfaces.  */
-  if (__netlink_sendreq (&nh, RTM_GETLINK) < 0)
-    {
-      result = -1;
-      goto exit_close;
-    }
-  /* Collect all data for every interface.  */
-  if (__netlink_receive (&nh) < 0)
+     active interfaces, collect all data for every interface.  */
+  if (__netlink_request (&nh, RTM_GETLINK) < 0)
     {
       result = -1;
       goto exit_free;
     }
 
-
   /* Now ask the kernel for all addresses which are assigned
-     to an interface.  Since we store the addresses after the
-     interfaces in the list, we will later always find the
-     interface before the corresponding addresses.  */
+     to an interface and collect all data for every interface.
+     Since we store the addresses after the interfaces in the
+     list, we will later always find the interface before the
+     corresponding addresses.  */
   ++nh.seq;
-  if (__netlink_sendreq (&nh, RTM_GETADDR) < 0
-      /* Collect all data for every interface.  */
-      || __netlink_receive (&nh) < 0)
+  if (__netlink_request (&nh, RTM_GETADDR) < 0)
     {
       result = -1;
       goto exit_free;
@@ -327,7 +405,7 @@ getifaddrs (struct ifaddrs **ifap)
        continue;
 
       /* Walk through all entries we got from the kernel and look, which
-         message type they contain.  */
+        message type they contain.  */
       for (nlh = nlp->nlh; NLMSG_OK (nlh, size); nlh = NLMSG_NEXT (nlh, size))
        {
          /* Check if the message is what we want.  */
@@ -423,7 +501,7 @@ getifaddrs (struct ifaddrs **ifap)
              /* Interfaces are stored in the first "newlink" entries
                 of our list, starting in the order as we got from the
                 kernel.  */
-              ifa_index = map_newlink (ifim->ifi_index - 1, ifas,
+             ifa_index = map_newlink (ifim->ifi_index - 1, ifas,
                                       map_newlink_data, newlink);
              ifas[ifa_index].ifa.ifa_flags = ifim->ifi_flags;
 
@@ -767,8 +845,6 @@ getifaddrs (struct ifaddrs **ifap)
 
  exit_free:
   __netlink_free_handle (&nh);
-
- exit_close:
   __netlink_close (&nh);
 
   return result;
index 2b6c887fd0d6476029520714259e82549784c943..7e7152935be1e14fbf1b5eab48a81bfbe6711759 100644 (file)
@@ -1,5 +1,5 @@
 /* Bit values & structures for resource limits.  Linux/MIPS version.
-   Copyright (C) 1994, 1996, 1997, 1998, 1999, 2000, 2004
+   Copyright (C) 1994, 1996, 1997, 1998, 1999, 2000, 2004, 2005
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -89,7 +89,18 @@ enum __rlimit_resource
   __RLIMIT_MSGQUEUE = 12,
 #define RLIMIT_MSGQUEUE __RLIMIT_MSGQUEUE
 
-  __RLIMIT_NLIMITS = 13,
+  /* Maximum nice priority allowed to raise to.
+     Nice levels 19 .. -20 correspond to 0 .. 39
+     values of this resource limit.  */
+  __RLIMIT_NICE = 13,
+#define RLIMIT_NICE __RLIMIT_NICE
+
+  /* Maximum realtime priority allowed for non-priviledged
+     processes.  */
+  __RLIMIT_RTPRIO = 14,
+#define RLIMIT_RTPRIO _RLIMIT_RTPRIO
+
+  __RLIMIT_NLIMITS = 15,
   __RLIM_NLIMITS = __RLIMIT_NLIMITS
 #define RLIMIT_NLIMITS __RLIMIT_NLIMITS
 #define RLIM_NLIMITS __RLIM_NLIMITS
index 8b8e0072f555a5f03902b5ae0060f359418ca2a9..f521df177148d8bec301ffd17a8e465c965099fa 100644 (file)
@@ -163,4 +163,4 @@ L(gotpid):
 
        END(__thread_start)
 
-weak_alias(__clone, clone)
+weak_alias (__clone, clone)
index 1383ddc6a71346f6529de40f8fbdf977646951ed..38b6195282985974043f8625f5620d0c8f0fbe9b 100644 (file)
@@ -95,4 +95,4 @@ L(error):
        END(__vfork)
 
 libc_hidden_def(__vfork)
-weak_alias(__vfork, vfork)
+weak_alias (__vfork, vfork)
index 1a7bc68c98df0ceb4db7e405dde6d0e38513ef10..45c39115f33af84048c06a4b8f11863c47d20e65 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 2005 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
 
 #include <sys/cdefs.h>
 #include <sys/types.h>
-#include <asm/types.h>
 
-#include <linux/if_tr.h>
+/* IEEE 802.5 Token-Ring magic constants.  The frame sizes omit the preamble
+   and FCS/CRC (frame check sequence). */
+#define TR_ALEN                6               /* Octets in one token-ring addr */
+#define TR_HLEN        (sizeof (struct trh_hdr) + sizeof (struct trllc))
+#define AC             0x10
+#define LLC_FRAME      0x40
+
+/* LLC and SNAP constants */
+#define EXTENDED_SAP   0xAA
+#define UI_CMD         0x03
+
+/* This is an Token-Ring frame header. */
+struct trh_hdr
+{
+  u_int8_t  ac;                        /* access control field */
+  u_int8_t  fc;                        /* frame control field */
+  u_int8_t  daddr[TR_ALEN];    /* destination address */
+  u_int8_t  saddr[TR_ALEN];    /* source address */
+  u_int16_t rcf;               /* route control field */
+  u_int16_t rseg[8];           /* routing registers */
+};
+
+/* This is an Token-Ring LLC structure */
+struct trllc
+{
+  u_int8_t  dsap;              /* destination SAP */
+  u_int8_t  ssap;              /* source SAP */
+  u_int8_t  llc;               /* LLC control field */
+  u_int8_t  protid[3];         /* protocol id */
+  u_int16_t ethertype;         /* ether type field */
+};
+
+/* Token-Ring statistics collection data. */
+struct tr_statistics
+{
+  unsigned long rx_packets;     /* total packets received      */
+  unsigned long tx_packets;    /* total packets transmitted    */
+  unsigned long rx_bytes;      /* total bytes received         */
+  unsigned long tx_bytes;      /* total bytes transmitted      */
+  unsigned long rx_errors;     /* bad packets received         */
+  unsigned long tx_errors;     /* packet transmit problems     */
+  unsigned long rx_dropped;    /* no space in linux buffers    */
+  unsigned long tx_dropped;    /* no space available in linux  */
+  unsigned long multicast;     /* multicast packets received   */
+  unsigned long transmit_collision;
+
+  /* detailed Token-Ring errors. See IBM Token-Ring Network
+     Architecture for more info */
+
+  unsigned long line_errors;
+  unsigned long internal_errors;
+  unsigned long burst_errors;
+  unsigned long A_C_errors;
+  unsigned long abort_delimiters;
+  unsigned long lost_frames;
+  unsigned long recv_congest_count;
+  unsigned long frame_copied_errors;
+  unsigned long frequency_errors;
+  unsigned long token_errors;
+  unsigned long dummy1;
+};
+
+/* source routing stuff */
+#define TR_RII                         0x80
+#define TR_RCF_DIR_BIT                 0x80
+#define TR_RCF_LEN_MASK        0x1f00
+#define TR_RCF_BROADCAST       0x8000  /* all-routes broadcast */
+#define TR_RCF_LIMITED_BROADCAST 0xC000        /* single-route broadcast */
+#define TR_RCF_FRAME2K                 0x20
+#define TR_RCF_BROADCAST_MASK  0xC000
+#define TR_MAXRIFLEN           18
 
 #ifdef __USE_BSD
 
-struct trn_hdr {
+struct trn_hdr
+{
   u_int8_t trn_ac;                /* access control field */
   u_int8_t trn_fc;                /* field control field */
   u_int8_t trn_dhost[TR_ALEN];    /* destination host */
index 6672e714ff4f4b3e9dcfe1cd096ffe7ac293e9cc..6b2d858c9d0ee452157ccb6dd79b94c46b6fada4 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2004, 2005 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
@@ -55,8 +55,7 @@ extern int __no_netlink_support attribute_hidden;
 extern int __netlink_open (struct netlink_handle *h);
 extern void __netlink_close (struct netlink_handle *h);
 extern void __netlink_free_handle (struct netlink_handle *h);
-extern int __netlink_sendreq (struct netlink_handle *h, int type);
-extern int __netlink_receive (struct netlink_handle *h);
+extern int __netlink_request (struct netlink_handle *h, int type);
 
 
 #endif /* netlinkaccess.h */
index a737322e2af58a1068f045c61fdf4ecb208a003c..21ad98e501c71ab59c19030d9fb8d7e6b17e12f9 100644 (file)
@@ -34,11 +34,19 @@ ENTRY (BP_SYM (__brk))
        lwz     r6,8(r1)
 #ifdef PIC
        mflr    r4
+# ifdef HAVE_ASM_PPC_REL16
+       bcl     20,31,1f
+1:     mflr    r5
+       addis   r5,r5,__curbrk-1b@ha
+       mtlr    r4
+       stw     r3,__curbrk-1b@l(r5)
+# else
        bl      _GLOBAL_OFFSET_TABLE_@local-4
        mflr    r5
        lwz     r5,__curbrk@got(r5)
        mtlr    r4
        stw     r3,0(r5)
+# endif
 #else
        lis     r4,__curbrk@ha
        stw     r3,__curbrk@l(r4)
index e79d74cb7574bafa9063634558f22d25beacb858..069f94bd9d1203ab68354448e9e7fc74f83aeefa 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997,1998,1999,2000,2001,2002 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2002, 2005 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
@@ -28,7 +28,7 @@
 #ifdef __NR_ftruncate64
 #ifndef __ASSUME_TRUNCATE64_SYSCALL
 /* The variable is shared between all wrappers around *truncate64 calls.  */
-extern int have_no_truncate64;
+extern int __have_no_truncate64;
 #endif
 
 
@@ -39,7 +39,7 @@ __ftruncate64 (fd, length)
      off64_t length;
 {
 #ifndef __ASSUME_TRUNCATE64_SYSCALL
-  if (! have_no_truncate64)
+  if (! __have_no_truncate64)
 #endif
     {
 #ifndef __ASSUME_TRUNCATE64_SYSCALL
@@ -57,7 +57,7 @@ __ftruncate64 (fd, length)
 
 #ifndef __ASSUME_TRUNCATE64_SYSCALL
       __set_errno (saved_errno);
-      have_no_truncate64 = 1;
+      __have_no_truncate64 = 1;
 #endif
     }
 
index 4e6cf4b3522bc7d091047dbda580846d4398f478..10211458d5e423ce176df6a6b1a602e6fe411b42 100644 (file)
@@ -129,8 +129,15 @@ ENTRY(__getcontext)
 
 #ifdef PIC
        mflr    r8
+# ifdef HAVE_ASM_PPC_REL16
+       bcl     20,31,1f
+1:     mflr    r7
+       addis   r7,r7,_GLOBAL_OFFSET_TABLE_-1b@ha
+       addi    r7,r7,_GLOBAL_OFFSET_TABLE_-1b@l
+# else
        bl      _GLOBAL_OFFSET_TABLE_@local-4
        mflr    r7
+# endif
 # ifdef SHARED
        lwz     r7,_rtld_global_ro@got(r7)
        mtlr    r8
index b7a82a0182976b2342617254f7a4fceb3c222056..eff60f9bbfdeaec101b533a2f65ac19c277dc7cb 100644 (file)
@@ -58,8 +58,15 @@ ENTRY(__setcontext)
 
 #ifdef PIC
        mflr    r8
+# ifdef HAVE_ASM_PPC_REL16
+       bcl     20,31,1f
+1:     mflr    r7
+       addis   r7,r7,_GLOBAL_OFFSET_TABLE_-1b@ha
+       addi    r7,r7,_GLOBAL_OFFSET_TABLE_-1b@l
+# else
        bl      _GLOBAL_OFFSET_TABLE_@local-4
        mflr    r7
+# endif
 # ifdef SHARED
        lwz     r7,_rtld_global_ro@got(r7)
        mtlr    r8
index c52ad9babff48cec7edbf6df29739a4725a442e9..72170c95c09299cfb07d0572597ba06ccad89ee5 100644 (file)
@@ -39,6 +39,8 @@
 #define NARGS 3
 #endif
 
+/* 0(r1) and 4(r1) are reserved by the ABI, 8(r1), 12(r1), 16(r1) are used
+   for temp saves.  44(r1) is used to save r30.  */
 #define stackblock 20
 
 #ifndef __socket
@@ -69,12 +71,6 @@ ENTRY(__socket)
        stw  r8,20+stackblock(r1)
 #endif
 #if NARGS >= 7
-       stw  r9,24+stackblock(r1)
-#endif
-#if NARGS >= 8
-       stw  r10,28+stackblock(r1)
-#endif
-#if NARGS >= 9
 #error too many arguments!
 #endif
 
@@ -94,6 +90,7 @@ ENTRY(__socket)
        mflr    r9
        stw     r9,52(r1)
        cfi_offset (lr, 4)
+       CGOTSETUP
        CENABLE
        stw     r3,16(r1)
        li      r3,P(SOCKOP_,socket)
@@ -107,6 +104,7 @@ ENTRY(__socket)
        lwz     r4,52(r1)
        lwz     r0,12(r1)
        lwz     r3,8(r1)
+       CGOTRESTORE
        mtlr    r4
        mtcr    r0
        addi    r1,r1,48
index 0c84d48d107561da332babc0fac552c133470d16..6e46abadb09cc135a684be4121eeb615793d9fd3 100644 (file)
@@ -130,8 +130,15 @@ ENTRY(__swapcontext)
        stfd    fp0,_UC_FREGS+(32*8)(r3)
 #ifdef PIC
        mflr    r8
+# ifdef HAVE_ASM_PPC_REL16
+       bcl     20,31,1f
+1:     mflr    r7
+       addis   r7,r7,_GLOBAL_OFFSET_TABLE_-1b@ha
+       addi    r7,r7,_GLOBAL_OFFSET_TABLE_-1b@l
+# else
        bl      _GLOBAL_OFFSET_TABLE_@local-4
        mflr    r7
+# endif
 # ifdef SHARED
        lwz     r7,_rtld_global_ro@got(r7)
        mtlr    r8
@@ -272,8 +279,15 @@ L(no_vec):
 
 #ifdef PIC
        mflr    r8
+# ifdef HAVE_ASM_PPC_REL16
+       bcl     20,31,1f
+1:     mflr    r7
+       addis   r7,r7,_GLOBAL_OFFSET_TABLE_-1b@ha
+       addi    r7,r7,_GLOBAL_OFFSET_TABLE_-1b@l
+# else
        bl      _GLOBAL_OFFSET_TABLE_@local-4
        mflr    r7
+# endif
 # ifdef SHARED
        lwz     r7,_rtld_global_ro@got(r7)
        mtlr    r8
index ce8ebc2a97d79c2cd9db0a5fb5c0075f71bdd987..ee1b50c04bfc337baec10df64ec073ae8cf590e4 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998, 1999, 2000, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1997,1998,1999,2000,2002,2005 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
@@ -29,7 +29,7 @@
 #ifdef __NR_truncate64
 #ifndef __ASSUME_TRUNCATE64_SYSCALL
 /* The variable is shared between all wrappers around *truncate64 calls.  */
-int have_no_truncate64;
+int __have_no_truncate64;
 #endif
 
 
@@ -40,7 +40,7 @@ truncate64 (path, length)
      off64_t length;
 {
 #ifndef __ASSUME_TRUNCATE64_SYSCALL
-  if (! have_no_truncate64)
+  if (! __have_no_truncate64)
 #endif
     {
 #ifndef __ASSUME_TRUNCATE64_SYSCALL
@@ -58,7 +58,7 @@ truncate64 (path, length)
 
 #ifndef __ASSUME_TRUNCATE64_SYSCALL
       __set_errno (saved_errno);
-      have_no_truncate64 = 1;
+      __have_no_truncate64 = 1;
 #endif
     }
 
@@ -68,7 +68,7 @@ truncate64 (path, length)
       __set_errno (EINVAL);
       return -1;
     }
-  return truncate (path, (off_t) length);
+  return __truncate (path, (off_t) length);
 #endif
 }
 
index 8034559200ccd657eedd4ca76c6a73cc0c2049e8..cf71a6df19a90de5a05c5a352f95e844e79a6a09 100644 (file)
@@ -180,4 +180,4 @@ L(gotexitcodeaddr):
 #endif
 END(__makecontext)
 
-weak_alias(__makecontext, makecontext)
+weak_alias (__makecontext, makecontext)
index fa815e95810657899858777c92b788b574d955a3..e2c5002390bf846fc957815220f9c88ec873fcde 100644 (file)
@@ -4,4 +4,4 @@
 
 #include <sysdeps/unix/readdir.c>
 
-weak_alias(__readdir64, readdir64)
+weak_alias (__readdir64, readdir64)
index d63680bf9ab484bcde4870ce9ee13e4e7837887b..bce56124ef790dd8c2b7bc40889241b14592602f 100644 (file)
@@ -4,4 +4,4 @@
 
 #include <sysdeps/unix/readdir_r.c>
 
-weak_alias(__readdir64_r, readdir64_r)
+weak_alias (__readdir64_r, readdir64_r)
index 2578b3ddc00c0e14a103ed97e8d830d7f7a640d4..3b38d194881671a8c449ed5641ff9fd72f79f8dd 100644 (file)
@@ -72,4 +72,4 @@ ENTRY(__getcontext)
        br      %r14
 END(__getcontext)
 
-weak_alias(__getcontext, getcontext)
+weak_alias (__getcontext, getcontext)
index 7ad360a3a089b7a8e7a23fff4b09e74ed5bc9414..cce8d297355e82fa6e45261b7245a4be8bbcc2b3 100644 (file)
@@ -69,4 +69,4 @@ ENTRY(__setcontext)
        br      %r14
 END(__setcontext)
 
-weak_alias(__setcontext, setcontext)
+weak_alias (__setcontext, setcontext)
index d9abb62c0b284d7c41c2c7e167919752ec10fe34..bf70f11cc7cca558eddeb134589ab355c63ab63e 100644 (file)
@@ -105,4 +105,4 @@ ENTRY(__swapcontext)
        /* Return.  */
        br      %r14
 END(__swapcontext)     
-weak_alias(__swapcontext, swapcontext)
+weak_alias (__swapcontext, swapcontext)
index 5a0d7eca5d565819a2b4aa1eb501595cc1ec2418..8889b5359e211198333330bd9546216668c97e0f 100644 (file)
@@ -72,4 +72,4 @@ ENTRY(__getcontext)
        br      %r14
 END(__getcontext)
 
-weak_alias(__getcontext, getcontext)
+weak_alias (__getcontext, getcontext)
index 268f36e713fc4db9eabb873e7098d922f6184be9..7beca847c23a271d60745d308da17109057e174a 100644 (file)
@@ -69,4 +69,4 @@ ENTRY(__setcontext)
        br      %r14
 END(__setcontext)
 
-weak_alias(__setcontext, setcontext)
+weak_alias (__setcontext, setcontext)
index ef2a862c553f61326db60fcd5ba8699db4d19f3f..cb96fd3b6a45b7cd6fb61b545285cfb90f419715 100644 (file)
@@ -105,4 +105,4 @@ ENTRY(__swapcontext)
        /* Return.  */
        br      %r14
 END(__swapcontext)     
-weak_alias(__swapcontext, swapcontext)
+weak_alias (__swapcontext, swapcontext)
index d94e4f62fd4d605d3a5f944716903c58060f3ef1..0e41a1133812db2ef79e56a53b7b19e8e1b50274 100644 (file)
@@ -1,5 +1,5 @@
 /* Implementation of the POSIX sleep function using nanosleep.
-   Copyright (C) 1996, 1997, 1998, 1999, 2003 Free Software Foundation, Inc.
+   Copyright (C) 1996,1997,1998,1999,2003,2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
 
@@ -21,6 +21,7 @@
 #include <errno.h>
 #include <time.h>
 #include <signal.h>
+#include <string.h>    /* For the real memset prototype.  */
 #include <unistd.h>
 #include <sys/param.h>
 
index ed31b0e89cf877197ed0f04da0ae8f7cae7f4fb2..8e7b64f996d6f8369dfb80885be5a2b2daeff727 100644 (file)
@@ -1,5 +1,5 @@
 /* Bit values & structures for resource limits.  Linux/SPARC version.
-   Copyright (C) 1994, 1996, 1997, 1998, 1999, 2000, 2004
+   Copyright (C) 1994, 1996, 1997, 1998, 1999, 2000, 2004, 2005
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -89,7 +89,18 @@ enum __rlimit_resource
   __RLIMIT_MSGQUEUE = 12,
 #define RLIMIT_MSGQUEUE __RLIMIT_MSGQUEUE
 
-  __RLIMIT_NLIMITS = 13,
+  /* Maximum nice priority allowed to raise to.
+     Nice levels 19 .. -20 correspond to 0 .. 39
+     values of this resource limit.  */
+  __RLIMIT_NICE = 13,
+#define RLIMIT_NICE __RLIMIT_NICE
+
+  /* Maximum realtime priority allowed for non-priviledged
+     processes.  */
+  __RLIMIT_RTPRIO = 14,
+#define RLIMIT_RTPRIO _RLIMIT_RTPRIO
+
+  __RLIMIT_NLIMITS = 15,
   __RLIM_NLIMITS = __RLIMIT_NLIMITS
 #define RLIMIT_NLIMITS __RLIMIT_NLIMITS
 #define RLIM_NLIMITS __RLIM_NLIMITS
index 4d8fdb82004711f4d42026f64562506fd0f26d67..95106d149fef6c7ce328e798ceca94306a3d1134 100644 (file)
@@ -104,4 +104,4 @@ __thread_start:
 
        .size   __thread_start, .-__thread_start
 
-weak_alias(__clone, clone)
+weak_alias (__clone, clone)
index f6134599e2d309ef49f425527eb05ad63132d580..0e1025ff6ace184aed9995af6d2bd26ef154cabb 100644 (file)
@@ -114,4 +114,4 @@ __thread_start:
         nop
        .size __thread_start, .-__thread_start
 
-weak_alias(__clone, clone)
+weak_alias (__clone, clone)
index ea18a9ae4e4531b111a6e660d525246735ec2a97..e6f5b55d6f0edbc84032a6f48dab4723bc05ac89 100644 (file)
@@ -62,4 +62,4 @@ ENTRY(__getcontext)
 
 END(__getcontext)
 
-weak_alias(__getcontext, getcontext)
+weak_alias (__getcontext, getcontext)
index 435bf99acba36cb4e76890498c93165bdb92d8ea..88dc54e852fb867e597a4587d5f54ba92351ad33 100644 (file)
@@ -47,6 +47,6 @@ END(__libc_siglongjmp)
 strong_alias(__libc_siglongjmp, __longjmp)
 strong_alias(__libc_siglongjmp, __libc_longjmp)
 libc_hidden_def (__libc_longjmp)
-weak_alias(__libc_siglongjmp, longjmp)
-weak_alias(__libc_siglongjmp, _longjmp)
-weak_alias(__libc_siglongjmp, siglongjmp)
+weak_alias (__libc_siglongjmp, longjmp)
+weak_alias (__libc_siglongjmp, _longjmp)
+weak_alias (__libc_siglongjmp, siglongjmp)
index a8baf40a9109b627344a07d0d51b9be109ba8e36..be2810e0c740d95c81444fc67da270fd9b535bf1 100644 (file)
 #include <features.h>
 #include <sys/types.h>
 
+/*
+ * Select between different incompatible quota versions.
+ * Default to the version used by Linux kernel version 2.4.22
+ * or later.  */
+#ifndef _LINUX_QUOTA_VERSION
+# define _LINUX_QUOTA_VERSION 2
+#endif
+
 /*
  * Convert diskblocks to blocks and the other way around.
  * currently only to fool the BSD source. :-)
 #define SUBCMDSHIFT 8
 #define QCMD(cmd, type)  (((cmd) << SUBCMDSHIFT) | ((type) & SUBCMDMASK))
 
-#define Q_QUOTAON  0x0100      /* enable quotas */
-#define Q_QUOTAOFF 0x0200      /* disable quotas */
-#define Q_GETQUOTA 0x0300      /* get limits and usage */
-#define Q_SETQUOTA 0x0400      /* set limits and usage */
-#define Q_SETUSE   0x0500      /* set usage */
-#define Q_SYNC     0x0600      /* sync disk copy of a filesystems quotas */
-#define Q_SETQLIM  0x0700      /* set limits */
-#define Q_GETSTATS 0x0800      /* get collected stats */
-#define Q_RSQUASH  0x1000      /* set root_squash option */
+#if _LINUX_QUOTA_VERSION < 2
+# define Q_QUOTAON  0x0100     /* enable quotas */
+# define Q_QUOTAOFF 0x0200     /* disable quotas */
+# define Q_GETQUOTA 0x0300     /* get limits and usage */
+# define Q_SETQUOTA 0x0400     /* set limits and usage */
+# define Q_SETUSE   0x0500     /* set usage */
+# define Q_SYNC     0x0600     /* sync disk copy of a filesystems quotas */
+# define Q_SETQLIM  0x0700     /* set limits */
+# define Q_GETSTATS 0x0800     /* get collected stats */
+# define Q_RSQUASH  0x1000     /* set root_squash option */
+#else
+# define Q_SYNC     0x800001   /* sync disk copy of a filesystems quotas */
+# define Q_QUOTAON  0x800002   /* turn quotas on */
+# define Q_QUOTAOFF 0x800003   /* turn quotas off */
+# define Q_GETFMT   0x800004   /* get quota format used on given filesystem */
+# define Q_GETINFO  0x800005   /* get information about quota files */
+# define Q_SETINFO  0x800006   /* set information about quota files */
+# define Q_GETQUOTA 0x800007   /* get user quota structure */
+# define Q_SETQUOTA 0x800008   /* set user quota structure */
+#endif
 
 /*
  * The following structure defines the format of the disk quota file
  * (as it appears on disk) - the file is an array of these structures
  * indexed by user or group number.
  */
+#if _LINUX_QUOTA_VERSION < 2
 struct dqblk
   {
     u_int32_t dqb_bhardlimit;  /* absolute limit on disk blks alloc */
@@ -120,13 +140,45 @@ struct dqblk
     time_t dqb_btime;          /* time limit for excessive disk use */
     time_t dqb_itime;          /* time limit for excessive files */
   };
+#else
+
+/* Flags that indicate which fields in dqblk structure are valid.  */
+#define QIF_BLIMITS    1
+#define QIF_SPACE      2
+#define QIF_ILIMITS    4
+#define QIF_INODES     8
+#define QIF_BTIME      16
+#define QIF_ITIME      32
+#define QIF_LIMITS     (QIF_BLIMITS | QIF_ILIMITS)
+#define QIF_USAGE      (QIF_SPACE | QIF_INODES)
+#define QIF_TIMES      (QIF_BTIME | QIF_ITIME)
+#define QIF_ALL                (QIF_LIMITS | QIF_USAGE | QIF_TIMES)
+
+struct dqblk
+  {
+    u_int64_t dqb_bhardlimit;  /* absolute limit on disk quota blocks alloc */
+    u_int64_t dqb_bsoftlimit;  /* preferred limit on disk quota blocks */
+    u_int64_t dqb_curspace;    /* current quota block count */
+    u_int64_t dqb_ihardlimit;  /* maximum # allocated inodes */
+    u_int64_t dqb_isoftlimit;  /* preferred inode limit */
+    u_int64_t dqb_curinodes;   /* current # allocated inodes */
+    u_int64_t dqb_btime;       /* time limit for excessive disk use */
+    u_int64_t dqb_itime;       /* time limit for excessive files */
+    u_int32_t dqb_valid;       /* bitmask of QIF_* constants */
+  };
+#endif
 
 /*
  * Shorthand notation.
  */
 #define        dq_bhardlimit   dq_dqb.dqb_bhardlimit
 #define        dq_bsoftlimit   dq_dqb.dqb_bsoftlimit
-#define        dq_curblocks    dq_dqb.dqb_curblocks
+#if _LINUX_QUOTA_VERSION < 2
+# define dq_curblocks  dq_dqb.dqb_curblocks
+#else
+# define dq_curspace   dq_dqb.dqb_curspace
+# define dq_valid      dq_dqb.dqb_valid
+#endif
 #define        dq_ihardlimit   dq_dqb.dqb_ihardlimit
 #define        dq_isoftlimit   dq_dqb.dqb_isoftlimit
 #define        dq_curinodes    dq_dqb.dqb_curinodes
@@ -135,6 +187,7 @@ struct dqblk
 
 #define dqoff(UID)      ((loff_t)((UID) * sizeof (struct dqblk)))
 
+#if _LINUX_QUOTA_VERSION < 2
 struct dqstats
   {
     u_int32_t lookups;
@@ -147,6 +200,22 @@ struct dqstats
     u_int32_t free_dquots;
     u_int32_t syncs;
   };
+#else
+
+/* Flags that indicate which fields in dqinfo structure are valid.  */
+# define IIF_BGRACE    1
+# define IIF_IGRACE    2
+# define IIF_FLAGS     4
+# define IIF_ALL       (IIF_BGRACE | IIF_IGRACE | IIF_FLAGS)
+
+struct dqinfo
+  {
+    u_int64_t dqi_bgrace;
+    u_int64_t dqi_igrace;
+    u_int32_t dqi_flags;
+    u_int32_t dqi_valid;
+  };
+#endif
 
 __BEGIN_DECLS
 
index 7e601acf2c113006529ecf95714658a9a119cb14..637fca59683b5882a1fec1011481ad1c73fc3a37 100644 (file)
@@ -1,5 +1,5 @@
 /* Read or write system information.  Linux version.
-   Copyright (C) 1996-1999, 2000, 2002, 2003 Free Software Foundation, Inc.
+   Copyright (C) 1996-2000,2002,2003,2005 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
@@ -18,6 +18,7 @@
    02111-1307 USA.  */
 
 #include <errno.h>
+#include <string.h>    /* For the real memset prototype.  */
 #include <sys/sysctl.h>
 
 #include <sysdep.h>
index 3fdff04c22d51bc66f81ce8f1d98a6203ba31e2f..c5b389ea291cf75375945b911fd591d72bf860f0 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2005 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
@@ -18,6 +18,7 @@
 
 #include <sched.h>
 #include <signal.h>
+#include <string.h>    /* For the real memset prototype.  */
 #include <sysdep.h>
 #include <unistd.h>
 #include <sys/wait.h>
index 491fa9dfb28e470c23ef3d4ee4ed3f7e9edcd032..5ea4c572a33792a59954261333544f872cbaedd2 100644 (file)
@@ -1,4 +1,4 @@
 #define __getdents64 __no___getdents64_decl
 #include <sysdeps/unix/sysv/linux/getdents.c>
 #undef __getdents64
-weak_alias(__getdents, __getdents64);
+weak_alias (__getdents, __getdents64);
index d19c9f0d094f5806c965ba771fa63de0c2567e6c..4bbc7a4d2e9f7497e754edd82e05061e212d908e 100644 (file)
@@ -85,4 +85,4 @@ L(pseudo_end):
        ret
 PSEUDO_END(__getcontext)
 
-weak_alias(__getcontext, getcontext)
+weak_alias (__getcontext, getcontext)
index 6597d8980b5326e11539942061f93712146bb493..5deea7d1b2ea2f2a9513d30d7c6ced294f173bc9 100644 (file)
@@ -110,4 +110,4 @@ __makecontext (ucontext_t *ucp, void (*func) (void), int argc, ...)
 }
 
 
-weak_alias(__makecontext, makecontext)
+weak_alias (__makecontext, makecontext)
index 51e4a50712977ec5ce31f19bea6ebe04af01a0ed..61fc07f44ff614af5ed9591247353e08289d52f8 100644 (file)
@@ -102,4 +102,4 @@ L(pseudo_end):
        ret
 PSEUDO_END(__setcontext)
 
-weak_alias(__setcontext, setcontext)
+weak_alias (__setcontext, setcontext)
index 8d48d3bd5ef693d814d96ccc7724efe836ebed73..fc7996ccdc6f7fea28aad9b24ee3e429e0e12c25 100644 (file)
@@ -120,4 +120,4 @@ L(pseudo_end):
        ret
 PSEUDO_END(__swapcontext)
 
-weak_alias(__swapcontext, swapcontext)
+weak_alias (__swapcontext, swapcontext)
index 1cc4e3065ba9af51669a6aed3c1594898ea7bac0..c005932c0c80af3c0fda23b9e6cd0c5470420064 100644 (file)
@@ -64,4 +64,4 @@ C_LABEL(_mcount)
        ASM_SIZE_DIRECTIVE(C_SYMBOL_NAME(_mcount))
 
 #undef mcount
-weak_alias(_mcount, mcount)
+weak_alias (_mcount, mcount)
index 79221b8a740a5697721be67af8915a75ba5125cd..258eec637baf99e2f919c039c50f6c9a07bb3363 100644 (file)
 
 #include <limits.h>
 
+#include <string.h>            /* For the real memcpy prototype.  */
+
 #if DEBUG
 # include <stdio.h>
 # include <stdlib.h>
-# include <string.h>
 /* Make it work even if the system's libc has its own mktime routine.  */
 # define mktime my_mktime
 #endif /* DEBUG */