diff options
author | Jeff Johnston <jjohnstn@redhat.com> | 2005-09-08 22:45:53 +0000 |
---|---|---|
committer | Jeff Johnston <jjohnstn@redhat.com> | 2005-09-08 22:45:53 +0000 |
commit | b10ab72581173784a6687739e44c02d940e009c9 (patch) | |
tree | 4fece41a6baba0e3b82da3793a0dfe1bf5d77ce1 /newlib/libc/sys/linux/dl/dl-reloc.c | |
parent | 7b786e4861b3ba6594d5518770ddc498ae9b8a87 (diff) | |
download | cygnal-b10ab72581173784a6687739e44c02d940e009c9.tar.gz cygnal-b10ab72581173784a6687739e44c02d940e009c9.tar.bz2 cygnal-b10ab72581173784a6687739e44c02d940e009c9.zip |
2005-09-08 Jeff Johnston <jjohnstn@redhat.com>
* Makefile.am: Add include files under bits sub-directory.
* Makefile.in: Regenerated.
* libc/sys/linux/argp/argp-fs-xinl.c: Set __OPTIMIZE__ to
actual value of 1 to be compatible with newer glibc headers.
* libc/sys/linux/sys/cdefs.h: Fix to be compatible with newer
glibc headers.
* libc/sys/linux/sys/dirent.h: Ditto.
* libc/sys/linux/argp/argp-xinl.c: Ditto.
* libc/sys/linux/dl/dl-runtime.c: Make sure fixup and
profile_fixup routines are marked used so they won't be
optimized away.
* libc/sys/linux/dl/dl-cache.c: Don't use weak_extern macro
to mark functions as weak.
* libc/sys/linux/dl/dl-open.c: Ditto.
* libc/sys/linux/iconv/gconv_open.c: Fix to obey new gcc4
rules about lvalues.
* libc/sys/linux/iconv/gconv_simple.c: Ditto.
* libc/sys/linux/linuxthreads/bits/libc-lock.h: Don't use
weak_extern macro to mark functions as weak. Instead always
use #pragma weak.
* iconvdata/jis0208.h: Fix to work with gcc4.
* libc/sys/linux/dl/dl-load.c: Ditto.
* libc/sys/linux/dl/dl-reloc.c: Ditto.
* libc/sys/linux/dl/do-rel.h: Ditto.
* libc/sys/linux/dl/dynamic-link.h: Ditto.
* libc/sys/linux/include/ltdl.h: Ditto.
* libc/sys/linux/machine/i386/dl-machine.h: Ditto.
* libc/sys/linux/machine/i386/weakalias.h: Ditto.
* libc/sys/linux/net/ns_ntoa.c: Ditto.
* libc/sys/linux/bits/initspin.h: New file.
* libc/sys/linux/bits/libc-lock.h: Ditto.
* libc/sys/linux/bits/pthreadtypes.h: Ditto.
* libc/sys/linux/bits/typesizes.h: Ditto.
Diffstat (limited to 'newlib/libc/sys/linux/dl/dl-reloc.c')
-rw-r--r-- | newlib/libc/sys/linux/dl/dl-reloc.c | 52 |
1 files changed, 25 insertions, 27 deletions
diff --git a/newlib/libc/sys/linux/dl/dl-reloc.c b/newlib/libc/sys/linux/dl/dl-reloc.c index 94163143e..0bffa4e76 100644 --- a/newlib/libc/sys/linux/dl/dl-reloc.c +++ b/newlib/libc/sys/linux/dl/dl-reloc.c @@ -105,50 +105,47 @@ _dl_relocate_object (struct link_map *l, struct r_scope_elem *scope[], { /* Do the actual relocation of the object's GOT and other data. */ - /* String table object symbols. */ - const char *strtab = (const void *) D_PTR (l, l_info[DT_STRTAB]); - /* This macro is used as a callback from the ELF_DYNAMIC_RELOCATE code. */ -#define RESOLVE_MAP(ref, version, r_type) \ +#define RESOLVE_MAP(ref, version, r_type, scope) \ (ELFW(ST_BIND) ((*ref)->st_info) != STB_LOCAL \ - ? ((__builtin_expect ((*ref) == l->l_lookup_cache.sym, 0) \ - && elf_machine_type_class (r_type) == l->l_lookup_cache.type_class) \ + ? ((__builtin_expect ((*ref) == map->l_lookup_cache.sym, 0) \ + && elf_machine_type_class (r_type) == map->l_lookup_cache.type_class)\ ? (++_dl_num_cache_relocations, \ - (*ref) = l->l_lookup_cache.ret, \ - l->l_lookup_cache.value) \ + (*ref) = map->l_lookup_cache.ret, \ + map->l_lookup_cache.value) \ : ({ lookup_t _lr; \ int _tc = elf_machine_type_class (r_type); \ - l->l_lookup_cache.type_class = _tc; \ - l->l_lookup_cache.sym = (*ref); \ + map->l_lookup_cache.type_class = _tc; \ + map->l_lookup_cache.sym = (*ref); \ _lr = ((version) != NULL && (version)->hash != 0 \ ? _dl_lookup_versioned_symbol (strtab + (*ref)->st_name, \ - l, (ref), scope, \ + map, (ref), scope, \ (version), _tc, 0) \ - : _dl_lookup_symbol (strtab + (*ref)->st_name, l, (ref), \ + : _dl_lookup_symbol (strtab + (*ref)->st_name, map, (ref),\ scope, _tc, 0)); \ - l->l_lookup_cache.ret = (*ref); \ - l->l_lookup_cache.value = _lr; })) \ - : l) -#define RESOLVE(ref, version, r_type) \ + map->l_lookup_cache.ret = (*ref); \ + map->l_lookup_cache.value = _lr; })) \ + : map) +#define RESOLVE(ref, version, r_type, scope) \ (ELFW(ST_BIND) ((*ref)->st_info) != STB_LOCAL \ - ? ((__builtin_expect ((*ref) == l->l_lookup_cache.sym, 0) \ - && elf_machine_type_class (r_type) == l->l_lookup_cache.type_class) \ + ? ((__builtin_expect ((*ref) == map->l_lookup_cache.sym, 0) \ + && elf_machine_type_class (r_type) == map->l_lookup_cache.type_class)\ ? (++_dl_num_cache_relocations, \ - (*ref) = l->l_lookup_cache.ret, \ - l->l_lookup_cache.value) \ + (*ref) = map->l_lookup_cache.ret, \ + map->l_lookup_cache.value) \ : ({ lookup_t _lr; \ int _tc = elf_machine_type_class (r_type); \ - l->l_lookup_cache.type_class = _tc; \ - l->l_lookup_cache.sym = (*ref); \ + map->l_lookup_cache.type_class = _tc; \ + map->l_lookup_cache.sym = (*ref); \ _lr = ((version) != NULL && (version)->hash != 0 \ ? _dl_lookup_versioned_symbol (strtab + (*ref)->st_name, \ - l, (ref), scope, \ + map, (ref), scope, \ (version), _tc, 0) \ - : _dl_lookup_symbol (strtab + (*ref)->st_name, l, (ref), \ + : _dl_lookup_symbol (strtab + (*ref)->st_name, map, (ref),\ scope, _tc, 0)); \ - l->l_lookup_cache.ret = (*ref); \ - l->l_lookup_cache.value = _lr; })) \ - : l->l_addr) + map->l_lookup_cache.ret = (*ref); \ + map->l_lookup_cache.value = _lr; })) \ + : map->l_addr) #include "dynamic-link.h" @@ -197,6 +194,7 @@ _dl_relocate_object (struct link_map *l, struct r_scope_elem *scope[], } } +#include <machine/dl-machine.h> void internal_function |