mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-24 10:22:41 +08:00
370f00c3a7
2001-06-07 David Mosberger <davidm@hpl.hp.com> * sysdeps/ia64/dl-symaddr.c (_dl_symbol_address): Update call to __ia64_make_fptr() for new interface. (_dl_function_address): Remove. * sysdeps/ia64/dl-machine.h (IA64_BOOT_FPTR_TABLE_LEN): Rename from IA64_BOOT_FPTR_SIZE and reduce its value from 256 to 200. (struct ia64_fdesc): Rename from struct ia64_fptr and drop "next" pointer. Rename member "func" to "ip". (struct ia64_fdesc_table): New type. (__ia64_make_fptr): Change prototype. (__ia64_init_bootstrap_fdesc_table): New function. (ELF_MACHINE_BEFORE_RTLD_RELOC): New macro. (__boot_ldso_fptr): Removed. (__fptr_next): Removed. (__fptr_root): Removed. (__fptr_count): Removed. (TRAMPOLINE_TEMPLATE): Fix typo in comment. Don't use multi-line strings to avoid warning from gcc3. (RTLD_START): Don't use multi-line strings. (ELF_MACHINE_START_ADDRESS): Use DL_STATIC_FUNCTION_ADDRESS. (elf_machine_fixup_plt): Update the code entry point in the function descriptor through a "volatile" pointer to ensure proper write ordering. (elf_machine_rela): Simplify handling of FPTR relocs: always call __ia64_make_fptr(). * sysdeps/ia64/dl-lookupcfg.h (DL_AUTO_FUNCTION_ADDRESS): New macro. (DL_STATIC_FUNCTION_ADDRESS): Likewise. (DL_DT_INIT_ADDRESS): Use DL_AUTO_FUNCTION_ADDRESS. (DL_DT_FINI_ADDRESS): Likewise. * sysdeps/ia64/dl-fptr.c: Rewrite for better scalability and to avoid deadlocks. * include/link.h: Add member machine specific "l_mach" member to link_map. * sysdeps/generic/bits/link.h: New file. * sysdeps/ia64/bits/link.h: Likewise. * elf/rtld.c (_dl_start): Fix typo in comment. (_dl_start_final): Copy new "l_mach" member from temporary to final bootstrap map.
57 lines
1.9 KiB
C
57 lines
1.9 KiB
C
/* Configuration of lookup functions.
|
|
Copyright (C) 2000 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
|
|
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.
|
|
|
|
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
|
|
Lesser General Public License for more details.
|
|
|
|
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. */
|
|
|
|
/* The ia64 need more information from the symbol lookup function
|
|
than just the address. */
|
|
#define DL_LOOKUP_RETURNS_MAP
|
|
#define ELF_FUNCTION_PTR_IS_SPECIAL
|
|
#define DL_UNMAP_IS_SPECIAL
|
|
|
|
extern void *_dl_symbol_address (const struct link_map *map,
|
|
const Elf64_Sym *ref);
|
|
|
|
#define DL_SYMBOL_ADDRESS(map, ref) _dl_symbol_address(map, ref)
|
|
|
|
extern Elf64_Addr _dl_lookup_address (const void *address);
|
|
|
|
#define DL_LOOKUP_ADDRESS(addr) _dl_lookup_address (addr)
|
|
|
|
extern void _dl_unmap (struct link_map *map);
|
|
|
|
#define DL_UNMAP(map) _dl_unmap (map)
|
|
|
|
#define DL_AUTO_FUNCTION_ADDRESS(map, addr) \
|
|
({ \
|
|
unsigned long fptr[2]; \
|
|
fptr[0] = (addr); \
|
|
fptr[1] = (map)->l_info[DT_PLTGOT]->d_un.d_ptr; \
|
|
(Elf64_Addr) fptr; \
|
|
})
|
|
|
|
#define DL_STATIC_FUNCTION_ADDRESS(map, addr) \
|
|
({ \
|
|
static unsigned long fptr[2]; \
|
|
fptr[0] = (addr); \
|
|
fptr[1] = (map)->l_info[DT_PLTGOT]->d_un.d_ptr; \
|
|
(Elf64_Addr) fptr; \
|
|
})
|
|
|
|
#define DL_DT_INIT_ADDRESS(map, addr) DL_AUTO_FUNCTION_ADDRESS (map, addr)
|
|
#define DL_DT_FINI_ADDRESS(map, addr) DL_AUTO_FUNCTION_ADDRESS (map, addr)
|