1995-05-02 06:35:55 +00:00
|
|
|
/* Machine-dependent ELF dynamic relocation inline functions. i386 version.
|
2001-02-28 06:36:10 +00:00
|
|
|
Copyright (C) 1995,96,97,98,99,2000,2001 Free Software Foundation, Inc.
|
1996-12-04 01:41:39 +00:00
|
|
|
This file is part of the GNU C Library.
|
1995-05-02 06:35:55 +00:00
|
|
|
|
1996-12-04 01:41:39 +00:00
|
|
|
The GNU C Library is free software; you can redistribute it and/or
|
2001-07-06 04:58:11 +00:00
|
|
|
modify it under the terms of the GNU Lesser General Public
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
version 2.1 of the License, or (at your option) any later version.
|
1995-05-02 06:35:55 +00:00
|
|
|
|
1996-12-04 01:41:39 +00:00
|
|
|
The GNU C Library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
2001-07-06 04:58:11 +00:00
|
|
|
Lesser General Public License for more details.
|
1995-05-02 06:35:55 +00:00
|
|
|
|
2001-07-06 04:58:11 +00:00
|
|
|
You should have received a copy of the GNU Lesser General Public
|
|
|
|
License along with the GNU C Library; if not, write to the Free
|
|
|
|
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
|
|
|
02111-1307 USA. */
|
1995-05-02 06:35:55 +00:00
|
|
|
|
1996-07-14 11:39:25 +00:00
|
|
|
#ifndef dl_machine_h
|
|
|
|
#define dl_machine_h
|
|
|
|
|
1995-05-02 06:35:55 +00:00
|
|
|
#define ELF_MACHINE_NAME "i386"
|
|
|
|
|
1997-05-07 14:34:37 +00:00
|
|
|
#include <sys/param.h>
|
|
|
|
|
2000-10-21 00:02:39 +00:00
|
|
|
/* Return nonzero iff ELF header is compatible with the running host. */
|
1996-08-02 05:27:50 +00:00
|
|
|
static inline int __attribute__ ((unused))
|
2000-10-21 00:02:39 +00:00
|
|
|
elf_machine_matches_host (const Elf32_Ehdr *ehdr)
|
1995-05-02 06:35:55 +00:00
|
|
|
{
|
2000-10-21 00:02:39 +00:00
|
|
|
return ehdr->e_machine == EM_386;
|
1995-05-02 06:35:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
1996-12-04 01:41:39 +00:00
|
|
|
/* Return the link-time address of _DYNAMIC. Conveniently, this is the
|
|
|
|
first element of the GOT. This must be inlined in a function which
|
|
|
|
uses global data. */
|
1997-07-26 02:33:30 +00:00
|
|
|
static inline Elf32_Addr __attribute__ ((unused))
|
1996-12-04 01:41:39 +00:00
|
|
|
elf_machine_dynamic (void)
|
1995-05-02 06:35:55 +00:00
|
|
|
{
|
|
|
|
register Elf32_Addr *got asm ("%ebx");
|
1996-12-04 01:41:39 +00:00
|
|
|
return *got;
|
1995-05-02 06:35:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Return the run-time load address of the shared object. */
|
1996-08-02 05:27:50 +00:00
|
|
|
static inline Elf32_Addr __attribute__ ((unused))
|
1995-05-02 06:35:55 +00:00
|
|
|
elf_machine_load_address (void)
|
|
|
|
{
|
|
|
|
Elf32_Addr addr;
|
1997-08-27 20:26:10 +00:00
|
|
|
asm ("leal _dl_start@GOTOFF(%%ebx), %0\n"
|
|
|
|
"subl _dl_start@GOT(%%ebx), %0"
|
|
|
|
: "=r" (addr) : : "cc");
|
1995-05-02 06:35:55 +00:00
|
|
|
return addr;
|
|
|
|
}
|
|
|
|
|
2000-07-18 00:13:34 +00:00
|
|
|
#if !defined PROF && !__BOUNDED_POINTERS__
|
1997-01-28 03:59:29 +00:00
|
|
|
/* We add a declaration of this function here so that in dl-runtime.c
|
|
|
|
the ELF_MACHINE_RUNTIME_TRAMPOLINE macro really can pass the parameters
|
1997-03-21 20:00:48 +00:00
|
|
|
in registers.
|
|
|
|
|
|
|
|
We cannot use this scheme for profiling because the _mcount call
|
|
|
|
destroys the passed register information. */
|
2000-07-18 00:13:34 +00:00
|
|
|
/* GKM FIXME: Fix trampoline to pass bounds so we can do
|
|
|
|
without the `__unbounded' qualifier. */
|
|
|
|
static ElfW(Addr) fixup (struct link_map *__unbounded l, ElfW(Word) reloc_offset)
|
1997-01-28 03:59:29 +00:00
|
|
|
__attribute__ ((regparm (2), unused));
|
1997-07-28 22:35:20 +00:00
|
|
|
static ElfW(Addr) profile_fixup (struct link_map *l, ElfW(Word) reloc_offset,
|
|
|
|
ElfW(Addr) retaddr)
|
|
|
|
__attribute__ ((regparm (3), unused));
|
1997-03-21 20:00:48 +00:00
|
|
|
#endif
|
1997-01-28 03:59:29 +00:00
|
|
|
|
1995-05-02 06:35:55 +00:00
|
|
|
/* 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. */
|
|
|
|
|
1997-07-26 02:33:30 +00:00
|
|
|
static inline int __attribute__ ((unused))
|
1997-07-28 22:35:20 +00:00
|
|
|
elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
|
1995-05-02 06:35:55 +00:00
|
|
|
{
|
1995-05-31 13:23:14 +00:00
|
|
|
Elf32_Addr *got;
|
1995-05-02 06:35:55 +00:00
|
|
|
extern void _dl_runtime_resolve (Elf32_Word);
|
1997-07-28 22:35:20 +00:00
|
|
|
extern void _dl_runtime_profile (Elf32_Word);
|
1995-05-31 13:23:14 +00:00
|
|
|
|
1996-01-07 10:00:21 +00:00
|
|
|
if (l->l_info[DT_JMPREL] && lazy)
|
|
|
|
{
|
|
|
|
/* The GOT entries for functions in the PLT have not yet been filled
|
|
|
|
in. Their initial contents will arrange when called to push an
|
|
|
|
offset into the .rel.plt section, push _GLOBAL_OFFSET_TABLE_[1],
|
|
|
|
and then jump to _GLOBAL_OFFSET_TABLE[2]. */
|
2000-03-23 20:31:46 +00:00
|
|
|
got = (Elf32_Addr *) D_PTR (l, l_info[DT_PLTGOT]);
|
1996-01-07 10:00:21 +00:00
|
|
|
got[1] = (Elf32_Addr) l; /* Identify this shared object. */
|
1997-07-28 22:35:20 +00:00
|
|
|
|
|
|
|
/* The got[2] entry contains the address of a function which gets
|
|
|
|
called to get the address of a so far unresolved function and
|
|
|
|
jump to it. The profiling extension of the dynamic linker allows
|
|
|
|
to intercept the calls to collect information. In this case we
|
|
|
|
don't store the address in the GOT so that all future calls also
|
|
|
|
end in this function. */
|
2000-06-08 04:19:30 +00:00
|
|
|
if (__builtin_expect (profile, 0))
|
1997-07-28 22:35:20 +00:00
|
|
|
{
|
|
|
|
got[2] = (Elf32_Addr) &_dl_runtime_profile;
|
1998-06-07 14:06:56 +00:00
|
|
|
|
|
|
|
if (_dl_name_match_p (_dl_profile, l))
|
|
|
|
/* This is the object we are looking for. Say that we really
|
|
|
|
want profiling and the timers are started. */
|
|
|
|
_dl_profile_map = l;
|
1997-07-28 22:35:20 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
/* This function will get called to fix up the GOT entry indicated by
|
|
|
|
the offset on the stack, and then jump to the resolved address. */
|
|
|
|
got[2] = (Elf32_Addr) &_dl_runtime_resolve;
|
1996-01-07 10:00:21 +00:00
|
|
|
}
|
1995-05-02 06:35:55 +00:00
|
|
|
|
Update.
1997-05-24 03:51 Ulrich Drepper <drepper@cygnus.com>
* stdlib/Makefile (routines): Add strtol_l, strtoul_l, strtoll_l,
strtoull_l, strtof_l, strtod_l, and strtold_l.
* stdlib/stdlib.h: Add prototypes for new functions.
* stdlib/strtod.c: Change for compiling as strtoX_l.
* stdlib/strtol.c: Likewise.
* stdlib/strtof.c: Likewise.
* stdlib/strtold.c: Likewise.
* stdlib/strtod_l.c: New file.
* stdlib/strtof_l.c: New file.
* stdlib/strtold_l.c: New file.
* stdlib/strtol_l.c: New file.
* stdlib/strtoul_l.c: New file.
* stdlib/strtoll_l.c: New file.
* stdlib/strtoull_l.c: New file.
* string/Makefile (routines): Add strcasecmp_l and strncase_l.
* string/string.h: Add prototypes for new functions.
* sysdeps/generic/strcasecmp.c: Change for compiling as strcasecmp_l.
* sysdeps/generic/strncase.c: Change for compiling as strncasecmp_l.
* sysdeps/generic/strcasecmp_l.c: New file.
* sysdeps/generic/strncase_l.c: New file.
* wcsmbs/Makefile (routines): Add wcstol_l, wcstoul_l, wcstoll_l,
wcstoull_l, wcstod_l, wcstold_l, wcstof_l, wcscasecmp_l, and
wcsncase_l.
* wcsmbs/wchar.h: Add prototypes for new functions.
* wcsmbs/wcscasecmp.c: Change for compiling as wcscasecmp_l.
* wcsmbs/wcsncase.c: Change for compiling as wcsncasecmp_l.
* wcsmbs/wcscasecmp_l.c: New file.
* wcsmbs/wcsncase_l.c: New file.
* wcsmbs/wcstof.c: Change for compiling as wcstof_l.c
* wcsmbs/wcstold.c: Change for compiling as wcstold_l.c
* wcsmcs/wcstod_l.c: New file.
* wcsmcs/wcstof_l.c: New file.
* wcsmcs/wcstold_l.c: New file.
* wcsmcs/wcstol_l.c: New file.
* wcsmcs/wcstoul_l.c: New file.
* wcsmcs/wcstoll_l.c: New file.
* wcsmcs/wcstoull_l.c: New file.
* Makeconfig (binfmt-subdir): New variable. Set to `elf' if
$(elf) is defined. More to come later when other binary formats
are supported.
* Makefile (subdirs): Remove elf. Add $(binfmt-subdir).
Suggested by Philip Blundell.
* stdlib/Makefile (headers): Add fmtmsg.h.
(routines): Add fmtmsg.
* stdlib/fmtmsg.c: New file.
* stdlib/fmtmsg.h: New file.
* manual/stdio.texi: Add description of fmtmsg and addseverity.
* manual/examples/fmtmsgexpl.c: Example program for fmtmsg
documentation.
1997-05-23 15:26 Philip Blundell <pjb27@cam.ac.uk>
* resolv/res_query.c (res_querydomain): Avoid potential buffer
overrun. Reported by Dan A. Dickey <ddickey@transition.com>.
1997-05-22 18:36 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu>
* elf/dl-support.c (_dl_sysdep_open_zero_fill,
_dl_sysdep_read_whole_file): Moved functions to ...
* elf/dl-misc.c: This new file.
* sysdeps/generic/dl-sysdepio.c: Delete file and move functions...
* elf/dl-misc.c: ... here.
* sysdeps/generic/dl-sysdep.c (_dl_sysdep_open_zero_fill,
_dl_sysdep_read_whole_file): Delete functions; they now come from
elf/dl-misc.c (dl-support.c had contained identical versions).
* sysdeps/mach/hurd/dl-sysdepio.c: Delete file; move functions...
* sysdeps/mach/hurd/dl-sysdep.c: ... here, but mark them weak so
that the regular ones in dl-misc work once we've initialized.
* elf/Makefile (dl-routines): Remove dl-sysdepio.c. Add dl-misc.c.
1997-05-22 21:55 Philip Blundell <pjb27@cam.ac.uk>
* inet/Makefile (headers): Add netinet/inbits.h.
* inet/netinet/in.h: New file.
* sysdeps/generic/netinet/inbits.h: Likewise.
* sysdeps/unix/sysv/linux/netinet/inbits.h: Likewise.
* sysdeps/generic/netinet/ip6.h: Move to...
* inet/netinet/ip6.h: ... here.
* sysdeps/generic/netinet/icmp6.h: Move to...
* inet/netinet/icmp6.h: ... here.
* sysdeps/unix/sysv/linux/netinet/in.h: Remove.
* sysdeps/generic/netinet/in.h: Remove.
1997-05-22 05:40 Richard Henderson <rth@tamu.edu>
* sysdeps/alpha/dl-machine.h (elf_machine_runtime_setup): If we are
not looking at the new thread-safe .plt, don't be lazy about relocs.
(_dl_runtime_resolve): Fix up arithmetic for new .plt layout.
(elf_alpha_fix_plt): Insert wmb as appropriate to ensure safety.
* elf/dynamic-link.h (ELF_DYNAMIC_RELOCATE): Let
elf_machine_runtime_setup() decide if we can actually be lazy.
* elf/rtld.c (_dl_start): So don't call it.
* elf/dl-reloc.c (_dl_relocate_object): Likewise.
* sysdeps/i386/dl-machine.h (elf_machine_runtime_setup): Return lazy.
* sysdeps/m68k/dl-machine.h (elf_machine_runtime_setup): Likewise.
* sysdeps/mips/dl-machine.h (elf_machine_runtime_setup): Likewise.
* sysdeps/powerpc/dl-machine.h (elf_machine_runtime_setup): Likewise.
* sysdeps/sparc/dl-machine.h (elf_machine_runtime_setup): Likewise.
* sysdeps/stub/dl-machine.h (elf_machine_runtime_setup): Update
skeleton definition.
1997-05-22 18:45 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/i386/fpu/__math.h (logb): Remove second value placed on
stack by fxtract.
1997-05-22 13:07 Andreas Jaeger <aj@arthur.rhein-neckar.de>
* sunrpc/rpcsvc/rusers.x: Provide and correct prototypes,
add cast to (xdrproc_t) where necessary to prevent warnings.
1997-05-22 12:18 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c: Remove I/O functions.
* sunrpc/rpcinfo.c (get_inet_address): Use INADDR_NONE and INADDR_ANY
* sysdeps/libm-ieee754/s_cexp.c: Fix typo: string_alias ->
* nss/XXX-lookup.c: Add missing explanation.
1997-05-24 02:30:09 +00:00
|
|
|
return lazy;
|
|
|
|
}
|
1997-01-28 03:59:29 +00:00
|
|
|
|
Update.
1997-05-24 03:51 Ulrich Drepper <drepper@cygnus.com>
* stdlib/Makefile (routines): Add strtol_l, strtoul_l, strtoll_l,
strtoull_l, strtof_l, strtod_l, and strtold_l.
* stdlib/stdlib.h: Add prototypes for new functions.
* stdlib/strtod.c: Change for compiling as strtoX_l.
* stdlib/strtol.c: Likewise.
* stdlib/strtof.c: Likewise.
* stdlib/strtold.c: Likewise.
* stdlib/strtod_l.c: New file.
* stdlib/strtof_l.c: New file.
* stdlib/strtold_l.c: New file.
* stdlib/strtol_l.c: New file.
* stdlib/strtoul_l.c: New file.
* stdlib/strtoll_l.c: New file.
* stdlib/strtoull_l.c: New file.
* string/Makefile (routines): Add strcasecmp_l and strncase_l.
* string/string.h: Add prototypes for new functions.
* sysdeps/generic/strcasecmp.c: Change for compiling as strcasecmp_l.
* sysdeps/generic/strncase.c: Change for compiling as strncasecmp_l.
* sysdeps/generic/strcasecmp_l.c: New file.
* sysdeps/generic/strncase_l.c: New file.
* wcsmbs/Makefile (routines): Add wcstol_l, wcstoul_l, wcstoll_l,
wcstoull_l, wcstod_l, wcstold_l, wcstof_l, wcscasecmp_l, and
wcsncase_l.
* wcsmbs/wchar.h: Add prototypes for new functions.
* wcsmbs/wcscasecmp.c: Change for compiling as wcscasecmp_l.
* wcsmbs/wcsncase.c: Change for compiling as wcsncasecmp_l.
* wcsmbs/wcscasecmp_l.c: New file.
* wcsmbs/wcsncase_l.c: New file.
* wcsmbs/wcstof.c: Change for compiling as wcstof_l.c
* wcsmbs/wcstold.c: Change for compiling as wcstold_l.c
* wcsmcs/wcstod_l.c: New file.
* wcsmcs/wcstof_l.c: New file.
* wcsmcs/wcstold_l.c: New file.
* wcsmcs/wcstol_l.c: New file.
* wcsmcs/wcstoul_l.c: New file.
* wcsmcs/wcstoll_l.c: New file.
* wcsmcs/wcstoull_l.c: New file.
* Makeconfig (binfmt-subdir): New variable. Set to `elf' if
$(elf) is defined. More to come later when other binary formats
are supported.
* Makefile (subdirs): Remove elf. Add $(binfmt-subdir).
Suggested by Philip Blundell.
* stdlib/Makefile (headers): Add fmtmsg.h.
(routines): Add fmtmsg.
* stdlib/fmtmsg.c: New file.
* stdlib/fmtmsg.h: New file.
* manual/stdio.texi: Add description of fmtmsg and addseverity.
* manual/examples/fmtmsgexpl.c: Example program for fmtmsg
documentation.
1997-05-23 15:26 Philip Blundell <pjb27@cam.ac.uk>
* resolv/res_query.c (res_querydomain): Avoid potential buffer
overrun. Reported by Dan A. Dickey <ddickey@transition.com>.
1997-05-22 18:36 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu>
* elf/dl-support.c (_dl_sysdep_open_zero_fill,
_dl_sysdep_read_whole_file): Moved functions to ...
* elf/dl-misc.c: This new file.
* sysdeps/generic/dl-sysdepio.c: Delete file and move functions...
* elf/dl-misc.c: ... here.
* sysdeps/generic/dl-sysdep.c (_dl_sysdep_open_zero_fill,
_dl_sysdep_read_whole_file): Delete functions; they now come from
elf/dl-misc.c (dl-support.c had contained identical versions).
* sysdeps/mach/hurd/dl-sysdepio.c: Delete file; move functions...
* sysdeps/mach/hurd/dl-sysdep.c: ... here, but mark them weak so
that the regular ones in dl-misc work once we've initialized.
* elf/Makefile (dl-routines): Remove dl-sysdepio.c. Add dl-misc.c.
1997-05-22 21:55 Philip Blundell <pjb27@cam.ac.uk>
* inet/Makefile (headers): Add netinet/inbits.h.
* inet/netinet/in.h: New file.
* sysdeps/generic/netinet/inbits.h: Likewise.
* sysdeps/unix/sysv/linux/netinet/inbits.h: Likewise.
* sysdeps/generic/netinet/ip6.h: Move to...
* inet/netinet/ip6.h: ... here.
* sysdeps/generic/netinet/icmp6.h: Move to...
* inet/netinet/icmp6.h: ... here.
* sysdeps/unix/sysv/linux/netinet/in.h: Remove.
* sysdeps/generic/netinet/in.h: Remove.
1997-05-22 05:40 Richard Henderson <rth@tamu.edu>
* sysdeps/alpha/dl-machine.h (elf_machine_runtime_setup): If we are
not looking at the new thread-safe .plt, don't be lazy about relocs.
(_dl_runtime_resolve): Fix up arithmetic for new .plt layout.
(elf_alpha_fix_plt): Insert wmb as appropriate to ensure safety.
* elf/dynamic-link.h (ELF_DYNAMIC_RELOCATE): Let
elf_machine_runtime_setup() decide if we can actually be lazy.
* elf/rtld.c (_dl_start): So don't call it.
* elf/dl-reloc.c (_dl_relocate_object): Likewise.
* sysdeps/i386/dl-machine.h (elf_machine_runtime_setup): Return lazy.
* sysdeps/m68k/dl-machine.h (elf_machine_runtime_setup): Likewise.
* sysdeps/mips/dl-machine.h (elf_machine_runtime_setup): Likewise.
* sysdeps/powerpc/dl-machine.h (elf_machine_runtime_setup): Likewise.
* sysdeps/sparc/dl-machine.h (elf_machine_runtime_setup): Likewise.
* sysdeps/stub/dl-machine.h (elf_machine_runtime_setup): Update
skeleton definition.
1997-05-22 18:45 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/i386/fpu/__math.h (logb): Remove second value placed on
stack by fxtract.
1997-05-22 13:07 Andreas Jaeger <aj@arthur.rhein-neckar.de>
* sunrpc/rpcsvc/rusers.x: Provide and correct prototypes,
add cast to (xdrproc_t) where necessary to prevent warnings.
1997-05-22 12:18 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c: Remove I/O functions.
* sunrpc/rpcinfo.c (get_inet_address): Use INADDR_NONE and INADDR_ANY
* sysdeps/libm-ieee754/s_cexp.c: Fix typo: string_alias ->
* nss/XXX-lookup.c: Add missing explanation.
1997-05-24 02:30:09 +00:00
|
|
|
/* This code is used in dl-runtime.c to call the `fixup' function
|
|
|
|
and then redirect to the address it returns. */
|
2000-07-18 00:13:34 +00:00
|
|
|
#if !defined PROF && !__BOUNDED_POINTERS__
|
1997-03-21 20:00:48 +00:00
|
|
|
# define ELF_MACHINE_RUNTIME_TRAMPOLINE asm ("\
|
2001-04-02 11:39:54 +00:00
|
|
|
.text\n\
|
|
|
|
.globl _dl_runtime_resolve\n\
|
|
|
|
.type _dl_runtime_resolve, @function\n\
|
|
|
|
.align 16\n\
|
|
|
|
_dl_runtime_resolve:\n\
|
|
|
|
pushl %eax # Preserve registers otherwise clobbered.\n\
|
|
|
|
pushl %ecx\n\
|
|
|
|
pushl %edx\n\
|
|
|
|
movl 16(%esp), %edx # Copy args pushed by PLT in register. Note\n\
|
|
|
|
movl 12(%esp), %eax # that `fixup' takes its parameters in regs.\n\
|
|
|
|
call fixup # Call resolver.\n\
|
|
|
|
popl %edx # Get register content back.\n\
|
|
|
|
popl %ecx\n\
|
|
|
|
xchgl %eax, (%esp) # Get %eax contents end store function address.\n\
|
|
|
|
ret $8 # Jump to function address.\n\
|
|
|
|
.size _dl_runtime_resolve, .-_dl_runtime_resolve\n\
|
|
|
|
\n\
|
|
|
|
.globl _dl_runtime_profile\n\
|
|
|
|
.type _dl_runtime_profile, @function\n\
|
|
|
|
.align 16\n\
|
|
|
|
_dl_runtime_profile:\n\
|
|
|
|
pushl %eax # Preserve registers otherwise clobbered.\n\
|
|
|
|
pushl %ecx\n\
|
|
|
|
pushl %edx\n\
|
|
|
|
movl 20(%esp), %ecx # Load return address\n\
|
|
|
|
movl 16(%esp), %edx # Copy args pushed by PLT in register. Note\n\
|
|
|
|
movl 12(%esp), %eax # that `fixup' takes its parameters in regs.\n\
|
|
|
|
call profile_fixup # Call resolver.\n\
|
|
|
|
popl %edx # Get register content back.\n\
|
|
|
|
popl %ecx\n\
|
|
|
|
xchgl %eax, (%esp) # Get %eax contents end store function address.\n\
|
|
|
|
ret $8 # Jump to function address.\n\
|
|
|
|
.size _dl_runtime_profile, .-_dl_runtime_profile\n\
|
|
|
|
.previous\n\
|
1996-02-13 07:05:16 +00:00
|
|
|
");
|
1997-03-21 20:00:48 +00:00
|
|
|
#else
|
2001-04-02 11:39:54 +00:00
|
|
|
# define ELF_MACHINE_RUNTIME_TRAMPOLINE asm ("\n\
|
|
|
|
.text\n\
|
|
|
|
.globl _dl_runtime_resolve\n\
|
|
|
|
.globl _dl_runtime_profile\n\
|
|
|
|
.type _dl_runtime_resolve, @function\n\
|
|
|
|
.type _dl_runtime_profile, @function\n\
|
|
|
|
.align 16\n\
|
|
|
|
_dl_runtime_resolve:\n\
|
|
|
|
_dl_runtime_profile:\n\
|
|
|
|
pushl %eax # Preserve registers otherwise clobbered.\n\
|
|
|
|
pushl %ecx\n\
|
|
|
|
pushl %edx\n\
|
|
|
|
movl 16(%esp), %edx # Push the arguments for `fixup'\n\
|
|
|
|
movl 12(%esp), %eax\n\
|
|
|
|
pushl %edx\n\
|
|
|
|
pushl %eax\n\
|
|
|
|
call fixup # Call resolver.\n\
|
|
|
|
popl %edx # Pop the parameters\n\
|
|
|
|
popl %ecx\n\
|
|
|
|
popl %edx # Get register content back.\n\
|
|
|
|
popl %ecx\n\
|
|
|
|
xchgl %eax, (%esp) # Get %eax contents end store function address.\n\
|
|
|
|
ret $8 # Jump to function address.\n\
|
|
|
|
.size _dl_runtime_resolve, .-_dl_runtime_resolve\n\
|
|
|
|
.size _dl_runtime_profile, .-_dl_runtime_profile\n\
|
|
|
|
.previous\n\
|
1997-03-21 20:00:48 +00:00
|
|
|
");
|
|
|
|
#endif
|
1995-05-02 06:35:55 +00:00
|
|
|
|
1995-06-08 09:00:23 +00:00
|
|
|
/* Mask identifying addresses reserved for the user program,
|
|
|
|
where the dynamic linker should not map anything. */
|
|
|
|
#define ELF_MACHINE_USER_ADDRESS_MASK 0xf8000000UL
|
|
|
|
|
1995-05-02 06:35:55 +00:00
|
|
|
/* Initial entry point code for the dynamic linker.
|
|
|
|
The C function `_dl_start' is the real entry point;
|
|
|
|
its return value is the user program's entry point. */
|
|
|
|
|
2001-04-02 11:39:54 +00:00
|
|
|
#define RTLD_START asm ("\n\
|
|
|
|
.text\n\
|
2000-03-31 08:21:01 +00:00
|
|
|
.align 16\n\
|
|
|
|
0: movl (%esp), %ebx\n\
|
|
|
|
ret\n\
|
|
|
|
.align 16\n\
|
1995-05-02 06:35:55 +00:00
|
|
|
.globl _start\n\
|
1995-05-08 09:11:25 +00:00
|
|
|
.globl _dl_start_user\n\
|
|
|
|
_start:\n\
|
1996-06-12 01:54:21 +00:00
|
|
|
pushl %esp\n\
|
1995-05-08 09:11:25 +00:00
|
|
|
call _dl_start\n\
|
1996-06-12 01:54:21 +00:00
|
|
|
popl %ebx\n\
|
1995-05-08 09:11:25 +00:00
|
|
|
_dl_start_user:\n\
|
|
|
|
# Save the user entry point address in %edi.\n\
|
|
|
|
movl %eax, %edi\n\
|
2001-04-02 11:39:54 +00:00
|
|
|
# Point %ebx at the GOT.\n\
|
2000-03-31 08:21:01 +00:00
|
|
|
call 0b\n\
|
|
|
|
addl $_GLOBAL_OFFSET_TABLE_, %ebx\n\
|
1998-06-07 14:06:56 +00:00
|
|
|
# Store the highest stack address\n\
|
1998-06-10 08:10:00 +00:00
|
|
|
movl __libc_stack_end@GOT(%ebx), %eax\n\
|
|
|
|
movl %esp, (%eax)\n\
|
1995-05-31 13:23:14 +00:00
|
|
|
# See if we were run as a command with the executable file\n\
|
|
|
|
# name as an extra leading argument.\n\
|
1995-09-28 18:42:29 +00:00
|
|
|
movl _dl_skip_args@GOT(%ebx), %eax\n\
|
update from main archive 960906
Sat Sep 7 05:15:45 1996 Ulrich Drepper <drepper@cygnus.com>
* libio/iofdopen: Initialize _lock field only if _IO_MTSAFE_IO.
* libio/iofopen: Likewise.
* libio/iofopncook.c: Likewise.
* libio/iopopen.c: Likewise.
* libio/iovsprintf.c: Likewise.
* libio/iovsscanf.c: Likewise.
* libio/memstream.c: Likewise.
* libio/vasprintf.c: Likewise.
* libio/vdprintf.c: Likewise.
* libio/vsnprintf.c: Likewise.
Sat Sep 7 03:55:47 1996 Ulrich Drepper <drepper@cygnus.com>
* Makeconfig (soversions.mk): Also use shlib-versions files
in add-on directories.
* config.make.in (config-defines): Remove. Not used anymore.
(defines): New variable. Initiliazed by @DEFINES@.
* configure.in: Add AC_SUBST(DEFINES).
* libio/Makefile (routines): When compiling reentrant libc add
clearerr_u, feof_u, ferror_u, fputc_u, getc_u, getchar_u,
iofflush_u, putc_u, putchar_u, ioflockfile.
(CPPFLAGS): Add -D_IO_MTSAFE_IO for reentrant libc.
* sysdeps/stub/libc-lock.h: Add stubs for __libc_cleanup_region_start
and __libc_cleanup_region_end.
* sysdeps/unix/i386/sysdep.S [_LIBC_REENTRANT]: Set errno
using __errno_location function.
* sysdeps/unix/sysv/linux/i386/sysdep.S [_LIBC_REENTRANT]: Set errno
using __errno_location function.
(__errno_location): New function.
* sysdeps/unix/sysv/linux/i386/sysdep.h [PIC]: Add second
syscall_error handler for reentrant libc.
* sysdeps/unix/opendir.c: Remove unneeded `;'.
* libio.h [_IO_MTSAFE_IO]: Include <pthread.h>.
[!_IO_MTSAFE_IO]: Define _IO_flockfile and _IO_funlockfile
as empty macros.
* libioP.h: Include <libc-lock.h>.
* libio/stdio.h: Add prototypes for *_locked and *_unlocked
functions.
* libio/clearerr.c: Use _IO_ protected versions of flockfile
and funlockfile to be namespace clean.
* libio/genops.c: Use __libc_lock_* macros for handling lock.
* libio/iofdopen: Add initialization of _lock in _IO_FILE.
* libio/iofopen: Likewise.
* libio/iofopncook.c: Likewise.
* libio/iopopen.c: Likewise.
* libio/iovsprintf.c: Likewise.
* libio/iovsscanf.c: Likewise.
* libio/memstream.c: Likewise.
* libio/vasprintf.c: Likewise.
* libio/vdprintf.c: Likewise.
* libio/vsnprintf.c: Likewise.
* libio/fgetc.c: Use __libc_cleanup_region_* macros instead
of flockfile etc.
* libio/fputc.c: Likewise.
* libio/freopen.c: Likewise.
* libio/fseek.c: Likewise.
* libio/getc.c: Likewise.
* libio/getchar.c: Likewise.
* libio/iofclose.c: Likewise.
* libio/iofflush.c: Likewise.
* libio/iofgetpos.c: Likewise.
* libio/iofgets.c: Likewise.
* libio/iofputs.c: Likewise.
* libio/iofread.c: Likewise.
* libio/iofsetpos.c: Likewise.
* libio/ioftell.c: Likewise.
* libio/iofwrite.c: Likewise.
* libio/iogetdelim.c: Likewise.
* libio/iogets.c: Likewise.
* libio/ioputs.c: Likewise.
* libio/iosetbuffer.c: Likewise.
* libio/iosetvbuf.c: Likewise.
* libio/ioungetc.c: Likewise.
* libio/putc.c: Likewise.
* libio/putchar.c: Likewise.
* libio/rewind.c: Likewise.
* stdio-common/vfprintf.c: Likewise.
* stdio-common/vfscanf.c: Likewise.
* libio/clearerr_u.c: Correct alias name.
* libio/ferror_u.c: Likewise.
* libio/fileno.c: Likewise.
* libio/fputc_u.c: Likewise.
* libio/getc.c: Likewise.
* libio/getc_u.c: Likewise.
* libio/getchar.c: Likewise.
* libio/getchar_u.c: Likewise.
* libio/putc.c: Likewise.
* libio/putchar.c: Likewise.
* libio/feof_u.c: Undefine macro with name of function before
definition of function itself.
* libio/ioflockfile.c: New file. Implementation of flockfile and
funlockfile.
* libio/putchar_u.c: Fix typo. Use stdout instead of fp.
* malloc/malloc.h: Don't include <libc-lock.h> and don't declare
_malloc_loc.
* malloc/free.c: Include <libc-lock.h>.
* malloc/realloc.c: Likewise.
* malloc/malloc-find.c: Likewise.
* malloc/malloc-size.c: Likewise.
* malloc/malloc-walk.c: Likewise.
* malloc/memalign.c: Likewise.
* malloc/malloc.c: Likewise.
* sysdeps/i386/dl-machine.h: Correct clearing of _dl_starting_up.
Fri Sep 6 19:38:49 1996 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/stub/libc-lock.h: Define __libc_lock_critical_start
and __libc_lock_critical_end as empty macros.
* malloc/malloc.h: Don't include <libc-lock.h> and don't declare
__libc_malloc_lock.
* malloc/free.c: Include <libc-lock.h>.
* malloc/malloc-find.c: Likewise.
* malloc/malloc-size.c: Likewise.
* malloc/malloc-walk.c: Likewise.
* malloc/malloc.c: Likewise.
* malloc/memalign.c: Likewise.
* malloc/realloc.c: Likewise.
* Makefile: Undo change from Mon Sep 2 22:15:14 1996. No more
extra_solibs pass.
* Rules: Likewise.
* extra-lib.mk: Likewise.
* manual/Makefile: Likewise.
* db/Makefile (makedb): Choose dependecies based on build-shared.
Patch by Andres Schwab.
* sysdeps/posix/sysconf.c: Don't use PTHREAD_DESTRUCTOR_ITERATIONS
but _POSIX_THREAD_DESTRUCTOR_ITERATIONS.
* sysdeps/unix/sysv/linux/errnos.h: New file.
* sysdeps/unix/sysv/linux/schedbits.h: New file.
* sysdeps/unix/sysv/linux/waitflags.h: New file.
* sysdeps/unix/sysv/linux/gnu/types.h: Add definition of `key_t'.
Fri Sep 6 08:26:31 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* rpm/template: Fix typo in %build section.
Fri Sep 6 03:31:07 1996 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/unix/sysv/linux/errnos.h: Don't define errno macro when
building libc without thread support.
* resolv/netdb.h: Likewise for h_errno macro.
Thu Sep 5 23:01:48 1996 Ulrich Drepper <drepper@cygnus.com>
* libc-symbols.h: Add new macro weak_const_function. It's like
weak_function, but the function is additionally marked as const.
* features.h: Only include <sys/cdefs.h> if !__ASSEMBLER__.
Thu Sep 5 22:55:49 1996 Richard Henderson <rth@tamu.edu>
* inet/herrno.c (__h_errno_location): New function.
(h_errno): Make strong_alias __h_errno so that we can access
the variable even if `h_errno' is a macro.
* resolv/netdb.h: Define macro h_errno to access thread specific
version of h_errno variable. Declare alias __h_errno for h_errno.
* resolv/res_query (h_errno): Remove definition.
* sysdeps/unix/sysv/linux/errnos.h [!__ASSEMBLER__ && __USE_REENTRANT]:
Add macro `errno' to get thread specific variable.
* sysdeps/unix/alpha/sysdep.S [_LIBC_REENTRANT]: Set errno using
__errno_location function.
(__errno_location): New function.
Thu Sep 5 21:08:44 1996 Ulrich Drepper <drepper@cygnus.com>
* posix/gnu/types.h: Remove definition of key_t.
* sysdeps/generic/gnu/types.h: Move it to here.
* sysdeps/unix/sysv/linux/gnu/types.h: Add Linux specific
definition of key_t.
* sysdeps/unix/sysv/linux/waitflags.h: New file. Linux specific
definitions.
* sysdeps/unix/sysv/linux/schedbits.h: New file. Include
clone prototypes and associated flags.
Thu Sep 5 08:58:47 1996 Richard Henderson <rth@tamu.edu>
* sysdeps/alpha/elf/start.S: Make _start global again.
hertz.
here.
Wed Sep 4 16:16:13 1996 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/mach/hurd/send.c (__send): De-ANSI-fy.
* sysdeps/mach/hurd/sendto.c (sendto): Likewise.
1996-09-07 04:10:57 +00:00
|
|
|
movl (%eax), %eax\n\
|
1995-09-28 18:42:29 +00:00
|
|
|
# Pop the original argument count.\n\
|
2000-04-03 07:05:57 +00:00
|
|
|
popl %edx\n\
|
1995-09-28 18:42:29 +00:00
|
|
|
# Adjust the stack pointer to skip _dl_skip_args words.\n\
|
|
|
|
leal (%esp,%eax,4), %esp\n\
|
2000-04-02 22:01:23 +00:00
|
|
|
# Subtract _dl_skip_args from argc.\n\
|
2000-04-03 07:05:57 +00:00
|
|
|
subl %eax, %edx\n\
|
2000-04-02 22:01:23 +00:00
|
|
|
# Push argc back on the stack.\n\
|
2000-04-03 07:05:57 +00:00
|
|
|
push %edx\n\
|
2000-04-02 22:01:23 +00:00
|
|
|
# The special initializer gets called with the stack just\n\
|
|
|
|
# as the application's entry point will see it; it can\n\
|
|
|
|
# switch stacks if it moves these contents over.\n\
|
|
|
|
" RTLD_START_SPECIAL_INIT "\n\
|
2000-03-30 16:30:49 +00:00
|
|
|
# Load the parameters again.\n\
|
2000-04-02 22:01:23 +00:00
|
|
|
# (eax, edx, ecx, *--esp) = (_dl_loaded, argc, argv, envp)\n\
|
2000-04-03 07:05:57 +00:00
|
|
|
movl _dl_loaded@GOT(%ebx), %esi\n\
|
|
|
|
leal 8(%esp,%edx,4), %eax\n\
|
2000-04-02 22:01:23 +00:00
|
|
|
leal 4(%esp), %ecx\n\
|
2000-04-03 07:05:57 +00:00
|
|
|
pushl %eax\n\
|
|
|
|
movl (%esi), %eax\n\
|
2000-03-30 16:30:49 +00:00
|
|
|
# Call the function to run the initializers.\n\
|
|
|
|
call _dl_init@PLT\n\
|
1996-08-19 01:07:44 +00:00
|
|
|
# Pass our finalizer function to the user in %edx, as per ELF ABI.\n\
|
1995-05-31 13:23:14 +00:00
|
|
|
movl _dl_fini@GOT(%ebx), %edx\n\
|
1995-05-08 09:11:25 +00:00
|
|
|
# Jump to the user's entry point.\n\
|
|
|
|
jmp *%edi\n\
|
2001-04-02 11:39:54 +00:00
|
|
|
.previous\n\
|
1995-05-02 06:35:55 +00:00
|
|
|
");
|
1996-07-14 11:39:25 +00:00
|
|
|
|
2000-04-02 22:01:23 +00:00
|
|
|
#ifndef RTLD_START_SPECIAL_INIT
|
|
|
|
#define RTLD_START_SPECIAL_INIT /* nothing */
|
|
|
|
#endif
|
|
|
|
|
2001-08-26 22:28:16 +00:00
|
|
|
/* ELF_RTYPE_CLASS_PLT iff TYPE describes relocation of a PLT entry, so
|
|
|
|
PLT entries should not be allowed to define the value.
|
|
|
|
ELF_RTYPE_CLASS_NOCOPY iff TYPE should not be allowed to resolve to one
|
|
|
|
of the main executable's symbols, as for a COPY reloc. */
|
|
|
|
#define elf_machine_type_class(type) \
|
|
|
|
((((type) == R_386_JMP_SLOT) * ELF_RTYPE_CLASS_PLT) \
|
|
|
|
| (((type) == R_386_COPY) * ELF_RTYPE_CLASS_COPY))
|
1997-03-23 01:54:07 +00:00
|
|
|
|
|
|
|
/* A reloc type used for ld.so cmdline arg lookups to reject PLT entries. */
|
1997-09-27 00:21:42 +00:00
|
|
|
#define ELF_MACHINE_JMP_SLOT R_386_JMP_SLOT
|
1996-07-14 11:39:25 +00:00
|
|
|
|
|
|
|
/* The i386 never uses Elf32_Rela relocations. */
|
|
|
|
#define ELF_MACHINE_NO_RELA 1
|
|
|
|
|
1997-07-26 02:33:30 +00:00
|
|
|
/* We define an initialization functions. This is called very early in
|
|
|
|
_dl_sysdep_start. */
|
|
|
|
#define DL_PLATFORM_INIT dl_platform_init ()
|
|
|
|
|
|
|
|
extern const char *_dl_platform;
|
|
|
|
|
|
|
|
static inline void __attribute__ ((unused))
|
|
|
|
dl_platform_init (void)
|
|
|
|
{
|
1998-04-07 16:28:09 +00:00
|
|
|
if (_dl_platform != NULL && *_dl_platform == '\0')
|
|
|
|
/* Avoid an empty string which would disturb us. */
|
1997-07-26 02:33:30 +00:00
|
|
|
_dl_platform = NULL;
|
|
|
|
}
|
|
|
|
|
2000-05-05 07:15:29 +00:00
|
|
|
static inline Elf32_Addr
|
|
|
|
elf_machine_fixup_plt (struct link_map *map, lookup_t t,
|
|
|
|
const Elf32_Rel *reloc,
|
1997-09-27 00:21:42 +00:00
|
|
|
Elf32_Addr *reloc_addr, Elf32_Addr value)
|
|
|
|
{
|
2000-05-05 07:15:29 +00:00
|
|
|
return *reloc_addr = value;
|
1997-09-27 00:21:42 +00:00
|
|
|
}
|
|
|
|
|
Update.
1997-10-12 05:09 Ulrich Drepper <drepper@cygnus.com>
* libio/Makefile (routines): Remove iofprintf.
* stdio-common/fprintf.c [USE_IN_LIBIO]: Define _IO_fprintf.
* libio/filedoalloc.c: Use _G_stat64 instead of stat.
* libio/fileops.c (_IO_file_open): Change to take extra argument
indicating whether 32 or 64 bit mode is wanted.
* libio/iofopen.c: Call _IO_file_open with extra argument set to 0.
* libio/iofopen64.c: Call _IO_file_open with extra argument set to 0.
* libio/iolibio.h (_IO_freopen, _IO_freopen64): Likewise.
* libio/iofgetpos.c: Pretty print.
* libio/iofgetpos64.c: Use _IO_fpos64_t for local variable `pos'.
* manual/conf.texi: Document all the _SC_ and _CS_ constants.
* manual/creature.texi: Document _LARGEFILE_SOURCE, _LARGEFILE64_SOURCE
and _FILE_OFFSET_BITS.
* manual/llio.texi: Document truncate and ftruncate.
* manual/stdio.texi: Document positional parameters for printf.
* math/Makefile (headers): Add tgmath.h.
(libm-support): Remove s_lrint, s_llrint, s_lround, and s_llround and
move to ...
(libm-calls): ... here. Add scalbln, s_nextafterx and s_fma.
* math/libm-test.c (lround_test, llround_test): Test for all FP formats
by using FUNC().
* math/libm.map: Add fma, fmaf, fmal, nextafterx, nextafterxf,
nextafterxl, scalbln, scalblnf, scalblnl, lrintf, lrintl, llrintf,
llrintl, lroundf, lroundl, llroundf, and llroundl.
* math/math.h: Document new platform specific macros from mathdef.h.
Remove declaration of lrint, llrint, lround, and llround.
* math/test-double.c: Define TEST_DOUBLE.
* math/test-idouble.c: Likewise.
* math/test-float.c: Define TEST_FLOAT.
* math/test-ifloat.c: Likewise.
* math/tgmath.h: New file.
* math/bits/mathcalls.h: Add nextafterx, scalbln, fma, lrint, llrint,
lround, and llround.
Change second argument of scalbn to `int'.
* sysdeps/libm-ieee754/s_fma.S: New file.
* sysdeps/libm-ieee754/s_fmaf.S: New file.
* sysdeps/libm-ieee754/s_fmal.S: New file.
* sysdeps/libm-i387/s_fma.S: New file.
* sysdeps/libm-i387/s_fmaf.S: New file.
* sysdeps/libm-i387/s_fmal.S: New file.
* sysdeps/libm-i387/s_llrint.S: Change to take double argument.
* sysdeps/libm-i387/s_lrint.S: Likewise.
* sysdeps/libm-i387/s_llrintf.S: New file.
* sysdeps/libm-i387/s_llrintl.S: New file.
* sysdeps/libm-i387/s_lrintf.S: New file.
* sysdeps/libm-i387/s_lrintl.S: New file.
* sysdeps/libm-ieee754/s_llrint.c: Remove version which works on
80bit double.
* sysdeps/libm-ieee754/s_lrint.c: Likewise.
* sysdeps/libm-ieee754/s_llrintf.S: New file.
* sysdeps/libm-ieee754/s_llrintl.S: New file.
* sysdeps/libm-ieee754/s_lrintf.S: New file.
* sysdeps/libm-ieee754/s_lrintl.S: New file.
* sysdeps/libm-i387/s_scalbln.c: New file. Empty file.
* sysdeps/libm-i387/s_scalblnf.c: New file. Empty file.
* sysdeps/libm-i387/s_scalblnl.c: New file. Empty file.
* sysdeps/libm-i387/s_scalbn.c: Add scalbln as alias.
* sysdeps/libm-i387/s_scalbnf.c: Add scalblnf as alias.
* sysdeps/libm-i387/s_scalbnl.c: Add scalblnl as alias.
* sysdeps/libm-ieee754/s_llround.c: Remove version which works on
80bit double.
* sysdeps/libm-ieee754/s_lround.c: Likewise.
* sysdeps/libm-ieee754/s_llroundf.c: Likewise.
* sysdeps/libm-ieee754/s_llroundl.c: Likewise.
* sysdeps/libm-ieee754/s_lroundf.c: Likewise.
* sysdeps/libm-ieee754/s_lroundl.c: Likewise.
* sysdeps/libm-ieee754/s_nextafterl.c: Add alias fo nextafterxl.
* sysdeps/libm-ieee754/s_nextafterx.c: New file.
* sysdeps/libm-ieee754/s_nextafterxf.c: New file.
* sysdeps/libm-ieee754/s_nextafterxl.c: New file.
* sysdeps/libm-ieee754/s_scalbln.c: New file.
* sysdeps/libm-ieee754/s_scalblnf.c: New file.
* sysdeps/libm-ieee754/s_scalblnl.c: New file.
* sysdeps/libm-ieee754/s_scalbn.c: Change to take `int' as second arg.
* sysdeps/libm-ieee754/s_scalbnf.c: Likewise.
* sysdeps/libm-ieee754/s_scalbnl.c: Likewise.
* stdlib/stdlib.h: Protect declarations of __strto*l_internal functions
by #ifdefs since they are duplicated in inttypes.h.
* sysdeps/wordsize-32/inttypes.h: Add definition of strtoimax and
strtoumax plus needed declarations.
* sysdeps/generic/confname.h (_SC_AIO_LISTIO_MAX): Fix typo.
1997-10-09 Andreas Jaeger <aj@arthur.rhein-neckar.de>
* locale/programs/locfile.c (locfile_read): Correct while loop.
* db2/makedb.c (main): Add missing parameter for error output.
(process_input): Likewise.
* resolv/gethnamaddr.c (getanswer): Rewrite a bit to avoid warning.
1997-10-12 05:05 Ulrich Drepper <drepper@cygnus.com>
* libc-map: Add __bzero, __mempcpy.
1997-10-10 18:51 David S. Miller <davem@tanya.rutgers.edu>
* sysdeps/unix/sysv/linux/sparc/bits/ioctls.h: Remove dependencies
on kernel_termios.h
1997-10-09 10:24 Thorsten Kukuk <kukuk@vt.uni-paderborn.de>
Add the changes from the Solaris 2.6 header files, use the new public
defines/functions.
* nis/nis_addmember.c: Updated.
* nis/nis_checkpoint.c: Updated.
* nis/nis_creategroup.c: updated.
* nis/nis_destroygroup.c: Updated.
* nis/nis_getservlist.c: Updated.
* nis/nis_ismember.c: Updated.
* nis/nis_lookup.c: Updated.
* nis/nis_modify.c: Updated.
* nis/nis_ping.c: Updated.
* nis/nis_print.c: Updated.
* nis/nis_print_group_entry.c: Updated.
* nis/nis_remove.c: Updated.
* nis/nis_removemember.c: Updated.
* nis/nis_xdr.c: Updated.
* nis/nss_nisplus/nisplus-alias.c: Updated.
* nis/nss_nisplus/nisplus-ethers.c: Updated.
* nis/nss_nisplus/nisplus-hosts.c: Updated.
* nis/nss_nisplus/nisplus-network.c: Updated.
* nis/nss_nisplus/nisplus-parser.c: Updated.
* nis/nss_nisplus/nisplus-proto.c: Updated.
* nis/nss_nisplus/nisplus-rpc.c: Updated.
* nis/nss_nisplus/nisplus-service.c: Updated.
* nis/rpcsvc/nis.h: Updated.
* nis/rpcsvc/nis.x: Updated.
* nis/rpcsvc/nis_object.x: Updated.
* nis/rpcsvc/nis_tags.h: Updated.
* nis/rpcsvc/nislib.h: Updated.
* nis/lckcache.c: Removed, since Sun has dropped the directory
signatures. The old cache version is now a security risk and not
longer supported by Sun.
* nis/nis_cache.c: Likewise.
* nis/rpcsvc/nis_cache.h: Likewise.
* nis/rpcsvc/nis_cache.x: Likewise.
* nis/nis_call.c: Remove calls to the cache functions.
* nis/libnsl.map: Remove cache and depending functions.
* nis/nis_intern.h: Likewise.
* nis/nis_add.c: Remove #include <rpcsvc/nislib.h>.
* nis/nis_domain_of.c: Likewise.
* nis/nis_domain_of_r.c: Likewise.
* nis/nis_error.c: Likewise.
* nis/nis_file.c: Likewise.
* nis/nis_local_names.c: Likewise.
* nis/nis_mkdir.c: Likewise.
* nis/nis_rmdir.c: Likewise.
* nis/nis_subr.c: Likewise.
* nis/nis_verifygroup.c: Likewise.
* nis/nis_clone.c: Removed, replaced by ...
* nis/nis_clone_dir.c: New.
* nis/nis_clone_obj.c: New.
* nis/nis_clone_res.c: New.
* nis/nis_table.c: Fixed bugs shown through the new clone functions.
* nis/nis_defaults.c: Fixed a lot of race conditions.
* nis/nis_free.c: Rewritten.
* sunrpc/auth_des.c: Fix use of free'ed pointer.
* nis/Makefile (libnsl-routines): Remove nis_clone, nis_cache and
lckcache. Add nis_clone_dir, nis_clone_obj, and nis_clone_res.
1997-10-09 Andreas Jaeger <aj@arthur.rhein-neckar.de>
* wctype/test_wctype.c (TEST): Add parens to avoid ambiguity.
1997-10-08 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* include/features.h: Don't crash if _XOPEN_SOURCE is defined to
be empty.
1997-10-09 05:54 Ulrich Drepper <drepper@cygnus.com>
* nss/digits_dots.c: Place `result' in resbuf and not in `buffer'.
* nss/getXXbyYY_r.c: Make sure digits_dots.c sees `resbuf' as
struct and not a pointer. Little optimizations.
1997-10-09 05:00 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/stub/getenv.c: Remove unused file.
* sysdeps/stub/lxstat.c: Likewise.
* sysdeps/stub/morecore.c: Likewise.
* sysdeps/stub/putenv.c: Likewise.
* sysdeps/stub/sbrk.c: Likewise.
* sysdeps/stub/setenv.c: Likewise.
* sysdeps/stub/sysd-stdio.c: Likewise.
* sysdeps/stub/sysdep.h: Likewise.
Reported by Zack Weinberg <zack@rabi.phys.columbia.edu>.
1997-10-09 04:58 Ulrich Drepper <drepper@cygnus.com>
* configure.in: Add __bzero definition to DWARF2 unwind test.
Reported by David S. Miller <davem@caip.rutgers.edu>.
1997-10-07 Paul Eggert <eggert@twinsun.com>
* intl/loadmsgcat.c (_nl_load_domain):
Fix &&/|| typo when checking file size.
Check for overflow when stuffing off_t into size_t.
1997-10-07 18:11 Ulrich Drepper <drepper@cygnus.com>
* time/africa: Update from tzdata1997i.
1997-10-07 Andreas Jaeger <aj@arthur.rhein-neckar.de>
* posix/globtest.sh: Add arguments for name of dynamic linker and
call dynamic linker to execute globtest.
* posix/Makefile (tests): Supply arguments to globtest.sh.
1997-10-07 Andreas Jaeger <aj@arthur.rhein-neckar.de>
* nis/rpcsvc/ypupd.h: Add missing __END_DECLS.
1997-10-03 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* libc.map: Add mempcpy, prctl.
1997-09-30 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/generic/memcmp.c: Avoid warnings.
* sysdeps/generic/memset.c: Likewise.
* sysdeps/generic/strchr.c: Likewise.
* sysdeps/generic/strlen.c: Likewise.
1997-09-29 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* malloc/Makefile ($(objpfx)mtrace): Fix typo.
1997-09-29 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/m68k/dl-machine.h (elf_machine_rela): Fix last change.
The R_68K_GLOB_DAT and R_68K_JMP_SLOT relocations really ignore
the addend, Richard.
(elf_machine_fixup_plt): Don't add the addend.
(elf_machine_plt_value): New function.
* sysdeps/alpha/dl-machine.h (elf_machine_plt_value): New
function.
* sysdeps/sparc/sparc32/dl-machine.h (elf_machine_plt_value): New
function.
* sysdeps/sparc/sparc64/dl-machine.h (elf_machine_plt_value): New
function.
* sysdeps/powerpc/dl-machine.h (elf_machine_plt_value): New
function.
* sysdeps/i386/dl-machine.h (elf_machine_plt_value): New
function.
* elf/dl-runtime.c (fixup, profile_fixup): Don't add in the
addend, instead let the machine dependent setup decide.
1997-09-20 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/m68k/m68020/bits/string.h: New file.
1997-10-07 04:27 Richard Henderson <rth@cygnus.com>
* Makeconfig (+includes): Add -I$(objpfx).
* stdlib/longlong.h [__sparc__]: Prototype __udiv_qrnnd.
* sysdeps/alpha/setjmp.S: __setjmp is the same as _setjmp. Make
the former a strong symbol and the later a weak alias.
* sysdeps/sparc/sparc32/setjmp.S: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc64/setjmp.S: Likewise.
1997-10-06 21:01 David S. Miller <davem@tanya.rutgers.edu>
* sysdeps/unix/sysv/linux/sparc/sparc64/bits/types.h: Make ino_t
64-bits.
* sysdeps/unix/sysv/linux/sparc/sparc64/kernel_stat.h: Make st_ino
member 64-bits as well, to match the kernel.
1997-10-06 19:35 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/sparc/sparc64/sub_n.S: Fix typo.
Patch by Jakub Jelinek <jj@sunsite.ms.mff.cuni.cz>.
1997-10-06 01:09 Zack Weinberg <zack@rabi.phys.columbia.edu>
* time/README: Correct list of files from tzcode package. Add
contact information for tzcode/tzdata maintainers. Correct
spelling of author's name. Compact lists.
1997-10-06 01:48 Ulrich Drepper <drepper@cygnus.com>
* malloc/malloc.h: Remove hook definition without caller argument.
* malloc/malloc.c: Likewise.
* string/tester.c: Correct strsep test.
* string/bits/string2.h: Define __string2_1bptr_p and use it.
Patch by David S. Miller <davem@tanya.rutgers.edu>.
* math/Makefile (routines): Add s_clog10.
* math/libm-test.c: Add test for clog10.
* math/libm.map: Add clog10{,f,l}.
* math/bits/cmathcalls.h [__USE_GNU]: Add clog10.
* sysdeps/libm-ieee754/s_clog10.c: New file.
* sysdeps/libm-ieee754/s_clog10f.c: New file.
* sysdeps/libm-ieee754/s_clog10l.c: New file.
* manual/math.texi: Describe clog10.
* config.h.in: Add USE_REGPARMS and define internal_function based on
this.
* configure.in: Define USE_REGPARMS for ix86 machines.
* gmon/gmon.c: Mark write_hist, write_call_graph and write_bb_counts
as internal functions.
* inet/getnameinfo.c: Likewise for nrl_domainname.
* inet/getnetgrent_r.c: Likewise for __internal_setnetgrent_reuse.
* inet/rcmd.c: Likewise for __icheckhost.
* intl/dcgettext.c: Likewise for category_to_name and
guess_category_value.
* intl/localealias.c: Likewise for read_alias_file.
* io/fts.c: Likewise for fts_alloc, fts_build, fts_lfree,
fts_maxarglen, fts_padjust, fts_palloc, fts_sort, and fts_stat.
* libio/genops.c: Likewise for save_for_backup.
* malloc/malloc.c (chunk_free, chunk_alloc, chunk_realloc, chunk_align,
main_trim, heap_trim): Likewise.
* malloc/mtrace.c (tr_where): Likewise.
* misc/fstab.c (mnt2fs): Likewise.
* misc/getttyent.c (skip, value): Likewise.
* misc/syslog.c (openlog_internal): Likewise.
* misc/tsearch.c (trecurse, tdestroy_internal): Likewise.
* nss/nsswitch.c (nss_lookup_function, nss_parse_file, nss_getline,
nss_parse_service_list, nss_new_service): Likewise.
* posix/wordexp.c (parse_dollars, parse_backtick, eval_expr): Likewise.
* resolv/inet_ntop.c (inet_ntop4, inet_ntop6): Likewise.
* resolv/inet_pton.c (inet_pton4, inet_pton6): Likewise.
* resolv/res_init.c (res_setoptions): Likewise.
* stdio-common/printf_fp.c (group_number): Likewise.
* stdio-common/vfprintf.c (buffered_vfprintf, group_number): Likewise.
* stdlib/fmtmsg.c (internal_addseverity): Likewise.
* sunrpc/auth_des.c (synchronize): Likewise.
* sunrpc/auth_unix.c (marshal_new_auth): Likewise.
* sunrpc/clnt_perr.c (auth_errmsg): Likewise.
* sunrpc/key_call.c (key_call): Likewise.
* sunprc/pmap_rmt.c (getbroadcastnets): Likewise.
* sunrpc/svc_tcp.c (makefd_xprt): Likewise.
* sunrpc/svcauth_des.c (cache_init, cache_spot, cache_ref, invalidate):
Likewise.
* sunrpc/xdr_rec.c (fix_buf_size, skip_input_bytes, flush_out,
set_input_fragment, get_input_bytes): Likewise.
* sysdeps/unix/sysv/linux/getsysstats.c (get_proc_path,
phys_pages_info): Likewise.
* sysdeps/unix/sysv/linux/if_index.c (opensock): Likewise.
* sysdeps/unix/sysv/linux/poll.c (__emulate_poll): Likewise.
* sysdeps/unix/sysv/linux/readv.c (__atomic_readv_replacement):
Likewise.
* sysdeps/unix/sysv/linux/readv.c (__atomic_writev_replacement):
Likewise.
* time/strptime.c (strptime_internal): Likewise.
* time/tzfile.c (find_transition, compute_tzname_max): Likewise.
* time/tzset.c (compute_change, tz_compute, tzset_internal): Likewise.
* libc.map: Remove _libio_using_thunks, add _fp_hw and _dl_addr.
* ctype/ctype.h: Pretty print.
* grp/grp.h: Likewise.
* include/libc-symbols.h: Likewise.
* include/limits.h: Likewise.
* include/values.h: Likewise.
* io/fcntl.h: Likewise.
* io/sys/stat.h: Likewise.
* libio/stdio.h: Likewise.
* malloc/malloc.h: Likewise.
* misc/err.h: Likewise.
* misc/regexp.h: Likewise.
* misc/sys/cdefs.h: Likewise.
* misc/sys/file.h: Likewise.
* posix/sys/utsname.h: Likewise.
* posix/sys/wait.h: Likewise.
* pwd/pwd.h: Likewise.
* resolv/netdb.h: Likewise.
* signal/signal.h: Likewise.
* stdlib/stdlib.h: Likewise.
* string/endian.h: Likewise.
* string/memory.h: Likewise.
* sysdeps/mach/hurd/bits/fcntl.h: Likewise.
* sysdeps/mach/hurd/sys/param.h: Likewise.
* sysdeps/unix/sysv/linux/sys/param.h: Likewise.
* termios/termios.h: Likewise.
* wcsmbs/wchar.h: Likewise.
* wctype/wctype.h: Likewise.
* sysdeps/unix/bsd/bsd4.4/wait3.c: Use __WAIT_STATUS in definition.
Implement Large File Support API.
* include/features.h: Add suuport for _LARGEFILE_SOURCE,
_LARGEFILE64_SOURCE, and _FILE_OFFSET_BITS.
* libc.map: Add new functions for LFS.
* dirent/Makefile (routines): Add readdir64 and readdir64_r.
* dirent/dirent.h: Update readdir prototype for LFS and add new
prototypes for above functions.
* io/Makefile (routines): Add xstat64, fxstat64, lxstat64,
statfs64, fstatfs64, lstat64, open64, lseek64, creat64, and ftw64.
* io/creat64.c: New file.
* io/fstat64.c: New file.
* io/lstat64.c: New file.
* io/stat64.c: New file.
* io/ftw64.c: New file.
* io/ftw.c: Rewrite to allow easy definition of ftw64.
* io/ftw.h: Add LFS interface.
* io/fcntl.h: Likewise.
* io/sys/stat.h: Likewise.
* io/sys/statfs.h: Likewise.
* libio/Makefile (routines): Add iofgetpos64, iofopen64, iofsetpos64,
freopen64, fseeko64, and ftello64.
* libcio/fseeko64.c: New file.
* libio/ftello64.c: New file.
* libio/iofgetpos64.c: New file.
* libio/iofopen64.c: New file.
* libio/iofsetpos64.c: New file.
* libio/fileops.c (_IO_file_fopen): Change to use _IO_off64_t.
(_IO_file_attach): Likewise.
(_IO_do_write): Likewise.
(_IO_file_sync): Likewise.
(_IO_file_seek): Likewise.
(_IO_file_seekoff): Likewise. Use _G_stat64.
(_IO_file_fopen64): New function.
(_IO_file_jumps): Initialize showmanyc and imbue.
* libio/genops.c (_IO_default_seekpos): Change to use _IO_fpos64_t.
(_IO_default_seekoff): Likewise.
(_IO_default_seek): Likewise.
(_IO_default_showmanyc, _IO_default_imbue): New functions.
* libio/iofopncook.c (_IO_cookie_seek): Change to use _IO_off64_t.
* libio/iolibio.h: Add prototypes for LFS functions.
* libio/ioseekoff.c: Change to use _IO_fpos64_t.
* libio/ioseekpos.c: Likewise.
* libio/libio.h: Define _IO_fpos64_t and _IO_off64_t.
(_IO_FILE): Move _offset field to end and change type to _IO_off64_t.
(_IO_seekoff, _IO_seekpos): Change prototype.
* libio/libioP.h (_IO_seekoff_t, _IO_seekpos_t, _IO_seek_t): Change
to use _IO_off64_t.
Change prototypes for function from the *ops.c files.
* libio/stdio.h: Add LFS interface definition.
* libio/strops.c (_IO_str_seekoff): Change to use _IO_fpos64_t.
* posix/Makefile (routines): Add pread64 and pwrite64.
* posix/confstr.c: Handle _CS_LFS* requests.
* posix/getconf.c: Handle LFS* requests.
* sysdeps/generic/confname.h: Add _CS_LFS* constants.
* posix/unistd.h: Document _LFS64_LARGEFILE and _LFS64_STDIO.
Define off_t and off64_t appropriately. Change prototypes of
LFS functions.
* posix/sys/types.h: Add LFS types.
* resources/Makefile (routines): Add getrlimit64 and setlimit64.
* resource/sys/resource.h: Change prototypes of LFS functions.
* stdio-common/Makefile (routines): Add tmpfile64.
* stdio-common/tmpfile64.c: New file.
* sysdeps/generic/_G_config.h: Define _G_fpos64_t and _G_off64_t.
Define _G_OPEN64, _G_LSEEK64, _G_FSTAT64.
* sysdeps/unix/sysv/linux/_G_config.h: Likewise.
* sysdeps/generic/bits/resource.h: Add LFS definitions.
* sysdeps/unix/bsd/sun/sunos4/bits/resource.h: Likewise.
* sysdeps/unix/sysv/linux/bits/resource.h: Likewise.
* sysdeps/generic/statfs.h: Use __fsblkcnt_t for some of the fields.
* sysdeps/unix/sysv/linux/bits/statfs.h: Likewise.
* sysdeps/unix/sysv/linux/mips/bits/statfs.h: Likewise.
* sysdeps/generic/types.h: Define LFS types.
* sysdeps/unix/sysv/linux/alpha/bits/types.h: Likewise.
* sysdeps/unix/sysv/linux/bits/types.h: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc64/bits/types.h: Likewise.
* sysdeps/generic/sys/mman.h: Add LFS definitions.
* sysdeps/unix/sysv/linux/sys/mman.h: Likewise.
* sysdeps/generic/mach/hurd/bits/fcntl.h: Add flock LFS extensions.
* sysdeps/unix/bsd/bits/fcntl.h: Likewise.
* sysdeps/unix/sysv/linux/alpha/bits/fcntl.h: Likewise.
* sysdeps/unix/sysv/linux/bits/fcntl.h: Likewise.
* sysdeps/unix/sysv/linux/mips/bits/fcntl.h: Likewise.
* sysdeps/generic/mach/hurd/bits/stat.h: Add stat LFS extensions.
* sysdeps/unix/bsd/bits/stat.h: Likewise.
* sysdeps/unix/bsd/osf/alpha/bits/stat.h: Likewise.
* sysdeps/unix/sysv/linux/alpha/bits/stat.h: Likewise.
* sysdeps/unix/sysv/linux/bits/stat.h: Likewise.
* sysdeps/unix/sysv/linux/mips/bits/stat.h: Likewise.
* sysdeps/unix/sysv/linux/sparc/bits/stat.h: Likewise.
* sysdeps/unix/sysv/sysv4/i386/bits/stat.h: Likewise.
* sysdeps/unix/sysv/sysv4/solaris2/bits/stat.h: Likewise.
* sysdeps/posix/open64.c: New file.
* sysdeps/stub/fstatfs64.c: New file.
* sysdeps/stub/fxstat64.c: New file.
* sysdeps/stub/getrlimit64.c: New file.
* sysdeps/stub/lseek64.c: New file.
* sysdeps/stub/lxstat64.c: New file.
* sysdeps/stub/open64.c: New file.
* sysdeps/stub/pread64.c: New file.
* sysdeps/stub/pwrite64.c: New file.
* sysdeps/stub/readdir64.c: New file.
* sysdeps/stub/readdir64_r.c: New file.
* sysdeps/stub/setrlimit64.c: New file.
* sysdeps/stub/statfs64.c: New file.
* sysdeps/stub/xstat64.c: New file.
* sysdeps/unix/sysv/linux/llseek.c: Define as __llseek and make
llseek and lseek64 weak aliases.
* sysdeps/unix/sysv/linux/lseek64.c: New file. Empty.
* sysdeps/unix/sysv/linux/alpha/bits/dirent.h: New file.
* sysdeps/unix/sysv/linux/bits/dirent.h: Add LFS definitions.
* sysdeps/posix/tempname.c: Add extra argument to trigger use of
open64.
* sysdeps/stub/tempname.c: Likewise.
* stdio-common/tempnam.c: Call __stdio_gen_tempname with extra
argument.
* stdio-common/tmpfile.c: Likewise.
* stdio-common/tmpnam.c: Likewise.
* stdio-common/tmpnam_r.c: Likewise.
* libio/libioP.h: Add definition ofr showmanyc and imbue callbacks.
* libio/fileops.c (_IO_file_jumps): Initialize showmanyc and imbue.
* libio/iofopncook.c (_IO_cookie_jumps): Likewise.
* libio/iopopen.c (_IO_proc_jumps): Likewise.
* libio/memstream.c (_IO_mem_jumps): Likewise.
* libio/obprintf.c (_IO_obstack_jumps): Likewise.
* libio/vsnprintf.c (_IO_strn_jumps): Likewise.
* libio/strops.c (_IO_str_jumps): Likewise.
* manual/arith.texi: Add a few words why cabs should be used.
* manual/llio.texi: Describe sync, fsync, fdatasync.
Tell about cleanup handlers & fcntl,lseek,write,read,close,open.
* manual/process.texi: Tell about cleanup handlers & system,waitpid,
wait.
* manual/signal.texi: Likewise for pause.
* manual/terminal.texi: Likewise for tcdrain.
* manual/time.texi: Document nanosleep.
* posix/exevp.c: Don't use nested function.
* stdlib/ucontext.h: New file.
* sysdeps/i386/sys/ucontext.h: New file. SysV/i386 API definitions.
* sunrpc/xcrypt.c (hexval): Make a macro for efficiency.
* sysdeps/i386/setjmp.h: Make `here` label local.
* sysdeps/i386/elf/start.S: Define _fp_hw "variable".
* sysdeps/stub/fstatfs.c: Correct warning.
* sysdeps/stub/fxstat.c: Likewise.
* sysdeps/stub/lxstat.c: Likewise.
* sysdeps/unix/sysv/i386/i686/time.S: New file.
1997-10-03 20:56 Jason Merrill <jason@yorick.cygnus.com>
* malloc/obstack.h (obstack_empty_p): New macro.
1997-10-04 17:41 Philip Blundell <Philip.Blundell@pobox.com>
* inet/getnameinfo.c (getnameinfo): Remove spurious `#if INET6'.
1997-09-30 Zack Weinberg <zack@rabi.phys.columbia.edu>
* maint.texi: Add copyright terms for libdb (Sleepycat, Harvard).
Document new --with-binutils switch; delete reference to
--with-gnu-as, --with-gnu-ld, --with-gnu-binutils.
Add to description of --without-fp: a kernel FPU emulator
is adequate (from FAQ)
* INSTALL: Regenerated.
1997-09-30 17:29 Richard Henderson <rth@cygnus.com>
* sysdeps/sparc/sparc32/dl-machine.h (elf_machine_rela): Move
_dl_hwcap declaration to ...
(elf_machine_fixup_plt): ... here.
1997-10-12 04:05:44 +00:00
|
|
|
/* Return the final value of a plt relocation. */
|
|
|
|
static inline Elf32_Addr
|
|
|
|
elf_machine_plt_value (struct link_map *map, const Elf32_Rel *reloc,
|
|
|
|
Elf32_Addr value)
|
|
|
|
{
|
|
|
|
return value;
|
|
|
|
}
|
|
|
|
|
1996-07-14 11:39:25 +00:00
|
|
|
#endif /* !dl_machine_h */
|
|
|
|
|
|
|
|
#ifdef RESOLVE
|
|
|
|
|
|
|
|
/* Perform the relocation specified by RELOC and SYM (which is fully resolved).
|
|
|
|
MAP is the object containing the reloc. */
|
|
|
|
|
|
|
|
static inline void
|
1997-02-15 04:31:36 +00:00
|
|
|
elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc,
|
1997-07-28 22:35:20 +00:00
|
|
|
const Elf32_Sym *sym, const struct r_found_version *version,
|
|
|
|
Elf32_Addr *const reloc_addr)
|
1996-07-14 11:39:25 +00:00
|
|
|
{
|
2001-08-24 08:53:35 +00:00
|
|
|
const unsigned int r_type = ELF32_R_TYPE (reloc->r_info);
|
|
|
|
|
2001-08-26 09:17:23 +00:00
|
|
|
#if !defined RTLD_BOOTSTRAP || !defined HAVE_Z_COMBRELOC
|
2001-08-24 08:53:35 +00:00
|
|
|
if (__builtin_expect (r_type == R_386_RELATIVE, 0))
|
1996-07-14 11:39:25 +00:00
|
|
|
{
|
2001-08-30 23:09:38 +00:00
|
|
|
# if !defined RTLD_BOOTSTRAP && !defined HAVE_Z_COMBRELOC
|
2000-08-31 08:28:44 +00:00
|
|
|
/* This is defined in rtld.c, but nowhere in the static libc.a;
|
|
|
|
make the reference weak so static programs can still link.
|
|
|
|
This declaration cannot be done when compiling rtld.c
|
|
|
|
(i.e. #ifdef RTLD_BOOTSTRAP) because rtld.c contains the
|
|
|
|
common defn for _dl_rtld_map, which is incompatible with a
|
|
|
|
weak decl in the same file. */
|
|
|
|
weak_extern (_dl_rtld_map);
|
1996-07-14 11:39:25 +00:00
|
|
|
if (map != &_dl_rtld_map) /* Already done in rtld itself. */
|
2001-08-26 09:17:23 +00:00
|
|
|
# endif
|
1996-07-14 11:39:25 +00:00
|
|
|
*reloc_addr += map->l_addr;
|
|
|
|
}
|
2001-08-26 09:17:23 +00:00
|
|
|
# ifndef RTLD_BOOTSTRAP
|
2001-08-24 15:12:38 +00:00
|
|
|
else if (__builtin_expect (r_type == R_386_NONE, 0))
|
2001-08-24 08:53:35 +00:00
|
|
|
return;
|
2001-08-26 09:17:23 +00:00
|
|
|
# endif
|
2001-08-24 08:53:35 +00:00
|
|
|
else
|
2001-08-26 09:17:23 +00:00
|
|
|
#endif
|
1997-03-23 01:54:07 +00:00
|
|
|
{
|
2001-02-09 17:13:50 +00:00
|
|
|
#ifndef RTLD_BOOTSTRAP
|
1997-03-23 01:54:07 +00:00
|
|
|
const Elf32_Sym *const refsym = sym;
|
2001-02-09 17:13:50 +00:00
|
|
|
#endif
|
2001-08-24 08:53:35 +00:00
|
|
|
Elf32_Addr value = RESOLVE (&sym, version, r_type);
|
1997-03-23 01:54:07 +00:00
|
|
|
if (sym)
|
|
|
|
value += sym->st_value;
|
|
|
|
|
2001-08-26 10:50:26 +00:00
|
|
|
#ifdef RTLD_BOOTSTRAP
|
|
|
|
assert (r_type == R_386_GLOB_DAT || r_type == R_386_JMP_SLOT);
|
|
|
|
*reloc_addr = value;
|
|
|
|
#else
|
2001-08-24 08:53:35 +00:00
|
|
|
switch (r_type)
|
1997-03-23 01:54:07 +00:00
|
|
|
{
|
2000-08-31 08:28:44 +00:00
|
|
|
case R_386_GLOB_DAT:
|
|
|
|
case R_386_JMP_SLOT:
|
|
|
|
*reloc_addr = value;
|
|
|
|
break;
|
|
|
|
case R_386_32:
|
|
|
|
*reloc_addr += value;
|
|
|
|
break;
|
|
|
|
case R_386_PC32:
|
|
|
|
*reloc_addr += (value - (Elf32_Addr) reloc_addr);
|
|
|
|
break;
|
1997-03-23 01:54:07 +00:00
|
|
|
case R_386_COPY:
|
1997-06-21 02:59:26 +00:00
|
|
|
if (sym == NULL)
|
|
|
|
/* This can happen in trace mode if an object could not be
|
|
|
|
found. */
|
|
|
|
break;
|
2000-04-24 15:49:01 +00:00
|
|
|
if (__builtin_expect (sym->st_size > refsym->st_size, 0)
|
|
|
|
|| (__builtin_expect (sym->st_size < refsym->st_size, 0)
|
2001-08-26 09:17:23 +00:00
|
|
|
&& _dl_verbose))
|
1997-05-07 14:34:37 +00:00
|
|
|
{
|
|
|
|
const char *strtab;
|
|
|
|
|
2000-03-23 20:31:46 +00:00
|
|
|
strtab = (const char *) D_PTR (map, l_info[DT_STRTAB]);
|
2001-02-28 06:36:10 +00:00
|
|
|
_dl_error_printf ("\
|
|
|
|
%s: Symbol `%s' has different size in shared object, consider re-linking\n",
|
|
|
|
_dl_argv[0] ?: "<program name unknown>",
|
|
|
|
strtab + refsym->st_name);
|
1997-05-07 14:34:37 +00:00
|
|
|
}
|
|
|
|
memcpy (reloc_addr, (void *) value, MIN (sym->st_size,
|
|
|
|
refsym->st_size));
|
1997-03-23 01:54:07 +00:00
|
|
|
break;
|
|
|
|
default:
|
2001-08-24 08:53:35 +00:00
|
|
|
_dl_reloc_bad_type (map, r_type, 0);
|
1997-03-23 01:54:07 +00:00
|
|
|
break;
|
|
|
|
}
|
2001-08-26 10:50:26 +00:00
|
|
|
#endif
|
1997-03-23 01:54:07 +00:00
|
|
|
}
|
1996-07-14 11:39:25 +00:00
|
|
|
}
|
|
|
|
|
2001-08-24 08:53:35 +00:00
|
|
|
static inline void
|
|
|
|
elf_machine_rel_relative (Elf32_Addr l_addr, const Elf32_Rel *reloc,
|
|
|
|
Elf32_Addr *const reloc_addr)
|
|
|
|
{
|
2001-08-26 09:17:23 +00:00
|
|
|
assert (ELF32_R_TYPE (reloc->r_info) == R_386_RELATIVE);
|
2001-08-24 08:53:35 +00:00
|
|
|
*reloc_addr += l_addr;
|
|
|
|
}
|
|
|
|
|
1996-07-14 11:39:25 +00:00
|
|
|
static inline void
|
1999-07-21 16:58:06 +00:00
|
|
|
elf_machine_lazy_rel (struct link_map *map,
|
|
|
|
Elf32_Addr l_addr, const Elf32_Rel *reloc)
|
1996-07-14 11:39:25 +00:00
|
|
|
{
|
1998-08-28 22:54:57 +00:00
|
|
|
Elf32_Addr *const reloc_addr = (void *) (l_addr + reloc->r_offset);
|
2001-08-24 08:53:35 +00:00
|
|
|
const unsigned int r_type = ELF32_R_TYPE (reloc->r_info);
|
1998-08-28 22:54:57 +00:00
|
|
|
/* Check for unexpected PLT reloc type. */
|
2001-08-24 08:53:35 +00:00
|
|
|
if (__builtin_expect (r_type == R_386_JMP_SLOT, 1))
|
1999-07-21 16:58:06 +00:00
|
|
|
*reloc_addr += l_addr;
|
|
|
|
else
|
2001-08-24 08:53:35 +00:00
|
|
|
_dl_reloc_bad_type (map, r_type, 1);
|
1996-07-14 11:39:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* RESOLVE */
|