diff options
author | Ulrich Drepper <drepper@redhat.com> | 2003-05-02 02:41:09 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2003-05-02 02:41:09 +0000 |
commit | a92026c98e4195d683f23c5a368eb6223454b3d5 (patch) | |
tree | e23c3824daea2b7b5e725afdbb9dc992a5ae3bdc /sysdeps/ia64 | |
parent | 0a7fb8268560916f7a0b9e4b29924e5a15365792 (diff) | |
download | glibc-a92026c98e4195d683f23c5a368eb6223454b3d5.zip glibc-a92026c98e4195d683f23c5a368eb6223454b3d5.tar.gz glibc-a92026c98e4195d683f23c5a368eb6223454b3d5.tar.bz2 |
Update.
2003-04-07 H.J. Lu <hjl@gnu.org>
* sysdeps/generic/dl-fptr.c: Modify to remove the lock.
2003-04-03 H.J. Lu <hjl@gnu.org>
* sysdeps/ia64/dl-fptr.c: Moved to ...
* sysdeps/generic/dl-fptr.c: Here.
* sysdeps/generic/dl-fptr.h: New.
* sysdeps/ia64/dl-fptr.h: New.
* sysdeps/ia64/dl-symaddr.c: Moved to ...
* sysdeps/generic/dl-symaddr.c: here.
* sysdeps/ia64/dl-machine.h: Include <dl-fptr.h>.
(IA64_BOOT_FPTR_TABLE_LEN): Removed.
(ia64_fdesc): Likewise.
(ia64_fdesc_table): Likewise.
(__ia64_make_fptr): Likewise.
(__ia64_init_bootstrap_fdesc_table): Replace __ia64_boot_fptr_table
with _dl_boot_fptr_table.
(elf_machine_runtime_setup): Replace `struct ia64_fdesc' with
`struct fdesc'.
(elf_machine_rela): Replace __ia64_make_fptr with _dl_make_fptr.
Diffstat (limited to 'sysdeps/ia64')
-rw-r--r-- | sysdeps/ia64/dl-fptr.h (renamed from sysdeps/ia64/dl-symaddr.c) | 31 | ||||
-rw-r--r-- | sysdeps/ia64/dl-machine.h | 34 |
2 files changed, 23 insertions, 42 deletions
diff --git a/sysdeps/ia64/dl-symaddr.c b/sysdeps/ia64/dl-fptr.h index c1d6f72..de67713 100644 --- a/sysdeps/ia64/dl-symaddr.c +++ b/sysdeps/ia64/dl-fptr.h @@ -1,5 +1,5 @@ -/* Get the symbol address. IA-64 version. - Copyright (C) 1999, 2000, 2001, 2003 Free Software Foundation, Inc. +/* Function descriptors. IA64 version. + Copyright (C) 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -17,17 +17,20 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -#include <ldsodefs.h> -#include <dl-machine.h> +#ifndef dl_ia64_fptr_h +#define dl_ia64_fptr_h 1 -void * -_dl_symbol_address (struct link_map *map, const Elf64_Sym *ref) -{ - Elf64_Addr value = (map ? map->l_addr : 0) + ref->st_value; +#include <ia64intrin.h> +#include <sysdeps/generic/dl-fptr.h> - /* On ia64, we have to return the pointer to function descriptor. */ - if (ELFW(ST_TYPE) (ref->st_info) == STT_FUNC) - return (void *) __ia64_make_fptr (map, ref, value); - else - return (void *) value; -} +#define COMPARE_AND_SWAP(ptr,old,new) \ + __sync_bool_compare_and_swap ((ptr), (old), (new)) + +/* There are currently 123 dynamic symbols in ld.so. + ELF_MACHINE_BOOT_FPTR_TABLE_LEN needs to be at least that big. */ +#define ELF_MACHINE_BOOT_FPTR_TABLE_LEN 200 + +#define ELF_MACHINE_LOAD_ADDRESS(var,symbol) \ + asm ("addl %0 = @gprel (" #symbol "), gp" : "=r" (var)); + +#endif /* !dl_ia64_fptr_h */ diff --git a/sysdeps/ia64/dl-machine.h b/sysdeps/ia64/dl-machine.h index d3cc0ca..7aaf084 100644 --- a/sysdeps/ia64/dl-machine.h +++ b/sysdeps/ia64/dl-machine.h @@ -26,44 +26,22 @@ #include <string.h> #include <link.h> #include <errno.h> +#include <dl-fptr.h> #include <tls.h> /* Translate a processor specific dynamic tag to the index in l_info array. */ #define DT_IA_64(x) (DT_IA_64_##x - DT_LOPROC + DT_NUM) -/* There are currently 123 dynamic symbols in ld.so. - IA64_BOOT_FPTR_TABLE_LEN needs to be at least that big. */ -#define IA64_BOOT_FPTR_TABLE_LEN 200 - -/* An FDESC is a function descriptor. */ - -struct ia64_fdesc - { - Elf64_Addr ip; /* code entry point */ - Elf64_Addr gp; /* global pointer */ - }; - -struct ia64_fdesc_table - { - struct ia64_fdesc_table *next; - unsigned int len; /* # of entries in fdesc table */ - volatile unsigned int first_unused; /* index of first available entry */ - struct ia64_fdesc fdesc[0]; - }; - -extern Elf64_Addr __ia64_make_fptr (struct link_map *, const Elf64_Sym *, - Elf64_Addr); - static inline void __ia64_init_bootstrap_fdesc_table (struct link_map *map) { Elf64_Addr *boot_table; /* careful: this will be called before got has been relocated... */ - asm (";; addl %0 = @gprel (__ia64_boot_fptr_table), gp" : "=r"(boot_table)); + asm (";; addl %0 = @gprel (_dl_boot_fptr_table), gp" : "=r"(boot_table)); - map->l_mach.fptr_table_len = IA64_BOOT_FPTR_TABLE_LEN; + map->l_mach.fptr_table_len = ELF_MACHINE_BOOT_FPTR_TABLE_LEN; map->l_mach.fptr_table = boot_table; } @@ -142,7 +120,7 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile) /* This function will be called to perform the relocation. */ if (!profile) - doit = (Elf64_Addr) ((struct ia64_fdesc *) &_dl_runtime_resolve)->ip; + doit = (Elf64_Addr) ((struct fdesc *) &_dl_runtime_resolve)->ip; else { if (_dl_name_match_p (GL(dl_profile), l)) @@ -151,7 +129,7 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile) want profiling and the timers are started. */ GL(dl_profile_map) = l; } - doit = (Elf64_Addr) ((struct ia64_fdesc *) &_dl_runtime_profile)->ip; + doit = (Elf64_Addr) ((struct fdesc *) &_dl_runtime_profile)->ip; } reserve[1] = doit; @@ -579,7 +557,7 @@ elf_machine_rela (struct link_map *map, return; } else if (R_IA64_TYPE (r_type) == R_IA64_TYPE (R_IA64_FPTR64LSB)) - value = __ia64_make_fptr (sym_map, sym, value); + value = _dl_make_fptr (sym_map, sym, value); else if (R_IA64_TYPE (r_type) == R_IA64_TYPE (R_IA64_PCREL64LSB)) value -= (Elf64_Addr) reloc_addr & -16; #if defined USE_TLS && (!defined RTLD_BOOTSTRAP || defined USE___THREAD) |