+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:
/* 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 */
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@
# 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.
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 ;;
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
#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
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
# 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)
if (nbytes > buflen)
__chk_fail ();
- return __pread64 (fd, buf, nbytes, offset);
+ return __libc_pread64 (fd, buf, nbytes, offset);
}
#endif
#include <dlfcn.h>
#include <libintl.h>
+#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
{
int errcode;
int returned;
+ bool malloced;
const char *objname;
const char *errstring;
};
{
/* 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;
{
/* 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
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))
/* 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. */
}
else
{
- int err;
-
/* Say that we are about to load an auxiliary library. */
if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_LIBS,
0))
? 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
#include <libintl.h>
#include <setjmp.h>
+#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
{
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. */
};
/* 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
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);
}
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;
*catchp = old;
*objname = NULL;
*errstring = NULL;
+ *mallocedp = false;
return 0;
}
*catchp = old;
*objname = c.objname;
*errstring = c.errstring;
+ *mallocedp = c.malloced;
return errcode == -1 ? 0 : errcode;
}
/* 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.
{
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;
_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()"));
_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;
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. */
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);
#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 */
#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
/* 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 };
const char *objname;
const char *err_str = NULL;
struct map_args args;
+ bool malloced;
args.str = fname;
args.loader = main_map;
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 ("\
{
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;
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. */
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
{
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;
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)
}
}
+ /* 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 ();
}
- {
- 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;
#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"
__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" \
: "=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" \
: "=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" \
: : \
: __TLS_CALL_CLOBBERS); \
__result; })
+# endif
#elif defined __powerpc__ && defined __powerpc64__
# 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
__moncontrol(1);
}
-weak_alias(__monstartup, monstartup)
+weak_alias (__monstartup, monstartup)
static void
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'.
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)
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);
}
*/
static int
parse_config_file(struct hesiod_p *ctx, const char *filename) {
- char *key, *data, *cp, **cpp;
char buf[MAXDNAME+7];
FILE *fp;
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...
return (-1);
while (fgets(buf, sizeof(buf), fp) != NULL) {
+ char *key, *data, *cp, **cpp;
+
cp = buf;
if (*cp == '#' || *cp == '\n' || *cp == '\r')
continue;
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);
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
#ifndef _DLFCN_H
#include <dlfcn/dlfcn.h>
#include <link.h> /* For ElfW. */
+#include <stdbool.h>
/* Internally used flag. */
#define __RTLD_DLOPEN 0x80000000
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;
#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
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)
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)
/* 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
/* Alias for function name in GNU C Library. */
INTDEF(__dcgettext)
weak_alias (__dcgettext, dcgettext);
+libc_hidden_def (__dcgettext)
#endif
+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
END(__vfork)
libc_hidden_def(__vfork)
-weak_alias(__vfork, vfork)
+weak_alias (__vfork, vfork)
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). */ \
lwz 4,52(1); \
lwz 0,12(1); /* restore CR/R3. */ \
lwz 3,8(1); \
+ CGOTRESTORE; \
mtlr 4; \
mtcr 0; \
addi 1,1,48;
# 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
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; \
lwz 10,__local_multiple_threads@got(10); \
lwz 10,0(10); \
cmpwi 10,0
+# endif
# endif
# endif
# endif
#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
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) \
+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>.
%
% 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
+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
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). */ \
lwz 4,52(1); \
lwz 0,12(1); /* restore CR/R3. */ \
lwz 3,8(1); \
+ CGOTRESTORE; \
mtlr 4; \
mtcr 0; \
addi 1,1,48; \
# 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
# define IPC_ADDVAL 0
#endif
+#define WRITE_BUFFER_SIZE 4096
+
/* Cleanup handling test. */
static int cl_called;
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));
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);
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;
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)
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>
#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"
/* 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);
/* 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 =
.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. */
error (EXIT_FAILURE, errno, _("Failed to start AVC"));
else
dbg_log (_("Access Vector Cache (AVC) started"));
+#ifdef HAVE_LIBAUDIT
+ audit_init ();
+#endif
}
nscd_avc_destroy (void)
{
avc_destroy ();
+#ifdef HAVE_LIBAUDIT
+ audit_close (audit_fd);
+#endif
}
#endif /* HAVE_SELINUX */
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");
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)
{
#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
.text
.align 4
.globl __divl
- .type __divl, @function
+ .type __divl, @funcnoplt
.usepv __divl, no
cfi_startproc
.text
.align 4
.globl __divq
- .type __divq, @function
+ .type __divq, @funcnoplt
.usepv __divq, no
cfi_startproc
.text
.align 4
.globl __divqu
- .type __divqu, @function
+ .type __divqu, @funcnoplt
.usepv __divqu, no
cfi_startproc
--- /dev/null
+/* Number of extra dynamic section entries for this architecture. By
+ default there are none. */
+#define DT_THISPROCNUM DT_ALPHA_NUM
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)
}
/* 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 = ˙
+ 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;
}
/* 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)
{
/* 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. */
.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. */
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)
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)
ret
cfi_endproc
- .size _dl_runtime_profile, .-_dl_runtime_profile
+ .size _dl_runtime_profile_old, .-_dl_runtime_profile_old
.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
END(htonl)
-weak_alias(htonl, ntohl)
+weak_alias (htonl, ntohl)
END(htons)
-weak_alias(htons, ntohs)
+weak_alias (htons, ntohs)
.text
.align 4
.globl __reml
- .type __reml, @function
+ .type __reml, @funcnoplt
.usepv __reml, no
cfi_startproc
.text
.align 4
.globl __remq
- .type __remq, @function
+ .type __remq, @funcnoplt
.usepv __remq, no
cfi_startproc
.text
.align 4
.globl __remqu
- .type __remqu, @function
+ .type __remqu, @funcnoplt
.usepv __remqu, no
cfi_startproc
/* 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.
return cnt;
}
weak_alias (__backtrace, backtrace)
+libc_hidden_def (__backtrace)
/* 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.
}
}
weak_alias (__backtrace_symbols_fd, backtrace_symbols_fd)
+libc_hidden_def (__backtrace_symbols_fd)
/* 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.
}
}
weak_alias (__backtrace_symbols_fd, backtrace_symbols_fd)
+libc_hidden_def (__backtrace_symbols_fd)
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);
# 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)
/* 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),
return char_ptr - str;
}
weak_alias (__strnlen, strnlen)
+libc_hidden_def (strnlen)
/* 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.
return arg.cnt != -1 ? arg.cnt : 0;
}
weak_alias (__backtrace, backtrace)
+libc_hidden_def (__backtrace)
ASM_SIZE_DIRECTIVE(C_SYMBOL_NAME(_mcount))
#undef mcount
-weak_alias(_mcount, mcount)
+weak_alias (_mcount, mcount)
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. */
/* 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.
return arg.cnt != -1 ? arg.cnt : 0;
}
weak_alias (__backtrace, backtrace)
+libc_hidden_def (__backtrace)
{
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
{
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
{
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
#endif
return __libm_lgamma(x, &signgam, sizeof(signgam));
}
-weak_alias(__ieee754_lgamma, lgamma)
+weak_alias (__ieee754_lgamma, lgamma)
double __ieee754_gamma(double x)
{
#endif
return __libm_lgamma(x, &signgam, sizeof(signgam));
}
-weak_alias(__ieee754_gamma, gamma)
+weak_alias (__ieee754_gamma, gamma)
#endif
return __libm_lgammaf(x, &signgam, sizeof(signgam));
}
-weak_alias(__ieee754_lgammaf, lgammaf)
+weak_alias (__ieee754_lgammaf, lgammaf)
float __ieee754_gammaf(float x)
{
#endif
return __libm_lgammaf(x, &signgam, sizeof(signgam));
}
-weak_alias(__ieee754_gammaf, gammaf)
+weak_alias (__ieee754_gammaf, gammaf)
#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)
{
#endif
return __libm_lgammal(x, &signgam, sizeof(signgam));
}
-weak_alias(__ieee754_gammal, gammal)
+weak_alias (__ieee754_gammal, gammal)
br.cond.sptk .back
END(strchr)
-weak_alias(strchr, index)
+weak_alias (strchr, index)
libc_hidden_builtin_def (strchr)
return dp ? 0 : err ? errno : 0;
}
-weak_alias(__readdir64_r, readdir64_r)
+weak_alias (__readdir64_r, readdir64_r)
return 0;
}
-weak_alias(__sigaltstack, sigaltstack)
+weak_alias (__sigaltstack, sigaltstack)
-/* 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
pushl %ecx /* Push back return address. */
.byte 0x9a, 0, 0, 0, 0, 7, 0 /* lcall $7, $0 -- gas bug */
ret
+END (syscall)
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;
continue;
}
- if (__pwrite64 (fd, "", 1, offset) != 1)
+ if (__libc_pwrite64 (fd, "", 1, offset) != 1)
return errno;
}
/* 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.
#define __need_NULL
#include <stddef.h>
#include <signal.h>
+#include <string.h> /* For the real memset prototype. */
+
int
sigignore (sig)
/* 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
#include <errno.h>
#include <signal.h>
+#include <string.h> /* For the real memset prototype. */
sigset_t _sigintr attribute_hidden; /* Set by siginterrupt. */
-/* 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
#define __need_NULL
#include <stddef.h>
#include <signal.h>
+#include <string.h> /* For the real memset prototype. */
/* Set the disposition for SIG. */
-/* 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
#include <errno.h>
#include <signal.h>
+#include <string.h> /* For the real memset prototype. */
+
/* Tolerate non-threads versions of Posix */
#ifndef SA_ONESHOT
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
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
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
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
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":
Function: Real part of "cpow":
double: 2
-float: 4
+float: 5
idouble: 2
-ifloat: 4
+ifloat: 5
Function: Imaginary part of "cpow":
double: 2
Function: "j0":
double: 2
-float: 1
+float: 2
idouble: 2
-ifloat: 1
+ifloat: 2
Function: "j1":
double: 1
Function: "jn":
double: 3
-float: 3
+float: 4
idouble: 3
-ifloat: 3
+ifloat: 4
Function: "lgamma":
double: 1
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
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
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
/* 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
return count;
}
weak_alias (__backtrace, backtrace)
+libc_hidden_def (__backtrace)
--- /dev/null
+# 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
--- /dev/null
+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
--- /dev/null
+/* Number of extra dynamic section entries for this architecture. By
+ default there are none. */
+#define DT_THISPROCNUM DT_PPC_NUM
#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)
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:
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 */
/* 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,
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. */
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,
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. */
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
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)
#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
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)
#include <sysdep.h>
.section .rodata.cst4,"aM",@progbits,4
- .align 2
+ .align 2
.LC0: /* 2**23 */
.long 0x4b000000
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)
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
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)
#include <sysdep.h>
.section .rodata.cst4,"aM",@progbits,4
- .align 2
+ .align 2
.LC0: /* 2**23 */
.long 0x4b000000
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)
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
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)
#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)
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
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
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)
#include <sysdep.h>
.section .rodata.cst4,"aM",@progbits,4
- .align 2
+ .align 2
.LC0: /* 2**23 */
.long 0x4b000000
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)
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
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
/* 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
*/
/* 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 */
/* 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
return count;
}
weak_alias (__backtrace, backtrace)
+libc_hidden_def (__backtrace)
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
/* 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
}
weak_alias (__backtrace, backtrace)
+libc_hidden_def (__backtrace)
ASM_SIZE_DIRECTIVE(C_SYMBOL_NAME(_mcount))
#undef mcount
-weak_alias(_mcount, mcount)
+weak_alias (_mcount, mcount)
/* 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
}
weak_alias (__backtrace, backtrace)
+libc_hidden_def (__backtrace)
ASM_SIZE_DIRECTIVE(C_SYMBOL_NAME(_mcount))
#undef mcount
-weak_alias(_mcount, mcount)
+weak_alias (_mcount, mcount)
END(memset)
libc_hidden_builtin_def (memset)
-weak_alias(__bzero, bzero)
+weak_alias (__bzero, bzero)
nop
END(__stpcpy)
-weak_alias(__stpcpy, stpcpy)
+weak_alias (__stpcpy, stpcpy)
libc_hidden_def (__stpcpy)
libc_hidden_builtin_def (stpcpy)
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)
END(memcmp)
#undef bcmp
-weak_alias(memcmp, bcmp)
+weak_alias (memcmp, bcmp)
libc_hidden_builtin_def (memcmp)
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)
mov %o5, %o0
END(__bzero)
-weak_alias(__bzero, bzero)
+weak_alias (__bzero, bzero)
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)
clock_gettime (clockid_t clock_id, struct timespec *tp)
{
int retval = -1;
+ struct timeval tv;
switch (clock_id)
{
#ifndef HANDLED_REALTIME
case CLOCK_REALTIME:
- HANDLE_REALTIME;
+ retval = gettimeofday (&tv, NULL);
+ if (retval == 0)
+ TIMEVAL_TO_TIMESPEC (&tv, tp);
break;
#endif
/* 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
#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
/* 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.
__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
.end thread_start
-weak_alias(__clone, clone)
+weak_alias (__clone, clone)
ret
END(__getcontext)
-weak_alias(__getcontext, getcontext)
+weak_alias (__getcontext, getcontext)
/* An internal routine used by getcontext and setcontext.
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
PSEUDO(__setcontext, sigreturn, 1)
ret
PSEUDO_END(__setcontext)
-weak_alias(__setcontext, setcontext)
+weak_alias (__setcontext, setcontext)
ret
PSEUDO_END(__sigsuspend)
libc_hidden_def (__sigsuspend)
-weak_alias(__sigsuspend, sigsuspend)
+weak_alias (__sigsuspend, sigsuspend)
strong_alias (__sigsuspend, __libc_sigsuspend)
#endif
END(__swapcontext)
-weak_alias(__swapcontext, swapcontext)
+weak_alias (__swapcontext, swapcontext)
END(__syscall)
-weak_alias(__syscall, syscall)
+weak_alias (__syscall, syscall)
/* 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.
__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
PSEUDO_END(__clone)
-weak_alias(__clone, clone)
+weak_alias (__clone, clone)
ret
PSEUDO_END(__getcontext)
-weak_alias(__getcontext, getcontext)
+weak_alias (__getcontext, getcontext)
cfi_startproc
END(__makecontext)
-weak_alias(__makecontext, makecontext)
+weak_alias (__makecontext, makecontext)
ret
PSEUDO_END(__setcontext)
-weak_alias(__setcontext, setcontext)
+weak_alias (__setcontext, setcontext)
ret
PSEUDO_END(__swapcontext)
-weak_alias(__swapcontext, swapcontext)
+weak_alias (__swapcontext, swapcontext)
# 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); \
ret
END(__getcontext)
-weak_alias(__getcontext, getcontext)
+weak_alias (__getcontext, getcontext)
ret
END(__setcontext)
-weak_alias(__setcontext, setcontext)
+weak_alias (__setcontext, setcontext)
-/* 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
/* 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. */
exit_free:
__netlink_free_handle (&nh);
- exit_close:
__netlink_close (&nh);
return idx;
/* 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
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>
#include <netinet/in.h>
#include <netpacket/packet.h>
#include <stdbool.h>
+#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
}
-int
+static int
__netlink_sendreq (struct netlink_handle *h, int type)
{
struct
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)
{
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. */
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;
}
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;
#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;
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. */
/* 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;
exit_free:
__netlink_free_handle (&nh);
-
- exit_close:
__netlink_close (&nh);
return result;
/* 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.
__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
END(__thread_start)
-weak_alias(__clone, clone)
+weak_alias (__clone, clone)
END(__vfork)
libc_hidden_def(__vfork)
-weak_alias(__vfork, vfork)
+weak_alias (__vfork, vfork)
-/* 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 */
-/* 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
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 */
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)
-/* 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
#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
off64_t length;
{
#ifndef __ASSUME_TRUNCATE64_SYSCALL
- if (! have_no_truncate64)
+ if (! __have_no_truncate64)
#endif
{
#ifndef __ASSUME_TRUNCATE64_SYSCALL
#ifndef __ASSUME_TRUNCATE64_SYSCALL
__set_errno (saved_errno);
- have_no_truncate64 = 1;
+ __have_no_truncate64 = 1;
#endif
}
#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
#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
#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
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
mflr r9
stw r9,52(r1)
cfi_offset (lr, 4)
+ CGOTSETUP
CENABLE
stw r3,16(r1)
li r3,P(SOCKOP_,socket)
lwz r4,52(r1)
lwz r0,12(r1)
lwz r3,8(r1)
+ CGOTRESTORE
mtlr r4
mtcr r0
addi r1,r1,48
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
#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
-/* 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
#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
off64_t length;
{
#ifndef __ASSUME_TRUNCATE64_SYSCALL
- if (! have_no_truncate64)
+ if (! __have_no_truncate64)
#endif
{
#ifndef __ASSUME_TRUNCATE64_SYSCALL
#ifndef __ASSUME_TRUNCATE64_SYSCALL
__set_errno (saved_errno);
- have_no_truncate64 = 1;
+ __have_no_truncate64 = 1;
#endif
}
__set_errno (EINVAL);
return -1;
}
- return truncate (path, (off_t) length);
+ return __truncate (path, (off_t) length);
#endif
}
#endif
END(__makecontext)
-weak_alias(__makecontext, makecontext)
+weak_alias (__makecontext, makecontext)
#include <sysdeps/unix/readdir.c>
-weak_alias(__readdir64, readdir64)
+weak_alias (__readdir64, readdir64)
#include <sysdeps/unix/readdir_r.c>
-weak_alias(__readdir64_r, readdir64_r)
+weak_alias (__readdir64_r, readdir64_r)
br %r14
END(__getcontext)
-weak_alias(__getcontext, getcontext)
+weak_alias (__getcontext, getcontext)
br %r14
END(__setcontext)
-weak_alias(__setcontext, setcontext)
+weak_alias (__setcontext, setcontext)
/* Return. */
br %r14
END(__swapcontext)
-weak_alias(__swapcontext, swapcontext)
+weak_alias (__swapcontext, swapcontext)
br %r14
END(__getcontext)
-weak_alias(__getcontext, getcontext)
+weak_alias (__getcontext, getcontext)
br %r14
END(__setcontext)
-weak_alias(__setcontext, setcontext)
+weak_alias (__setcontext, setcontext)
/* Return. */
br %r14
END(__swapcontext)
-weak_alias(__swapcontext, swapcontext)
+weak_alias (__swapcontext, swapcontext)
/* 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.
#include <errno.h>
#include <time.h>
#include <signal.h>
+#include <string.h> /* For the real memset prototype. */
#include <unistd.h>
#include <sys/param.h>
/* 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.
__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
.size __thread_start, .-__thread_start
-weak_alias(__clone, clone)
+weak_alias (__clone, clone)
nop
.size __thread_start, .-__thread_start
-weak_alias(__clone, clone)
+weak_alias (__clone, clone)
END(__getcontext)
-weak_alias(__getcontext, getcontext)
+weak_alias (__getcontext, getcontext)
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)
#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 */
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
#define dqoff(UID) ((loff_t)((UID) * sizeof (struct dqblk)))
+#if _LINUX_QUOTA_VERSION < 2
struct dqstats
{
u_int32_t lookups;
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
/* 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
02111-1307 USA. */
#include <errno.h>
+#include <string.h> /* For the real memset prototype. */
#include <sys/sysctl.h>
#include <sysdep.h>
-/* 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
#include <sched.h>
#include <signal.h>
+#include <string.h> /* For the real memset prototype. */
#include <sysdep.h>
#include <unistd.h>
#include <sys/wait.h>
#define __getdents64 __no___getdents64_decl
#include <sysdeps/unix/sysv/linux/getdents.c>
#undef __getdents64
-weak_alias(__getdents, __getdents64);
+weak_alias (__getdents, __getdents64);
ret
PSEUDO_END(__getcontext)
-weak_alias(__getcontext, getcontext)
+weak_alias (__getcontext, getcontext)
}
-weak_alias(__makecontext, makecontext)
+weak_alias (__makecontext, makecontext)
ret
PSEUDO_END(__setcontext)
-weak_alias(__setcontext, setcontext)
+weak_alias (__setcontext, setcontext)
ret
PSEUDO_END(__swapcontext)
-weak_alias(__swapcontext, swapcontext)
+weak_alias (__swapcontext, swapcontext)
ASM_SIZE_DIRECTIVE(C_SYMBOL_NAME(_mcount))
#undef mcount
-weak_alias(_mcount, mcount)
+weak_alias (_mcount, mcount)
#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 */