From b0982c4ad36a973322650068ba29fa30c104975d Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Thu, 8 Jun 2000 04:48:56 +0000 Subject: [PATCH] Update. * include/elf.h: Include also . * elf/dl-deps.c: Likewise. * elf/dl-lookup.c: Likewise. * elf/dl-runtime.c: Likewise. * elf/dl-version.c: Likewise. * elf/do-rel.h: Likewise. * elf/dynamic-link.h: Likewise. * elf/link.h: Likewise. * elf/rtld.c: Likewise. * sysdeps/generic/dl-dtprocnum.h: New file. * sysdeps/ia64/dl-dtprocnum.h: New file. * sysdeps/mips/dl-dtprocnum.h: New file. * sysdeps/sparc/dl-dtprocnum.h: New file. --- ChangeLog | 14 ++++++++++++++ elf/dl-deps.c | 4 ++-- elf/dl-lookup.c | 2 +- elf/dl-runtime.c | 2 +- elf/dl-version.c | 2 +- elf/do-rel.h | 2 +- elf/dynamic-link.h | 6 +++--- elf/link.h | 11 ++++++----- elf/rtld.c | 4 ++-- include/elf.h | 7 ++++++- sysdeps/generic/dl-dtprocnum.h | 22 ++++++++++++++++++++++ sysdeps/ia64/dl-dtprocnum.h | 22 ++++++++++++++++++++++ sysdeps/mips/dl-dtprocnum.h | 22 ++++++++++++++++++++++ sysdeps/sparc/dl-dtprocnum.h | 22 ++++++++++++++++++++++ 14 files changed, 125 insertions(+), 17 deletions(-) create mode 100644 sysdeps/generic/dl-dtprocnum.h create mode 100644 sysdeps/ia64/dl-dtprocnum.h create mode 100644 sysdeps/mips/dl-dtprocnum.h create mode 100644 sysdeps/sparc/dl-dtprocnum.h diff --git a/ChangeLog b/ChangeLog index cf9dfad2c0..8466f26f32 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,19 @@ 2000-06-07 Ulrich Drepper + * include/elf.h: Include also . + * elf/dl-deps.c: Likewise. + * elf/dl-lookup.c: Likewise. + * elf/dl-runtime.c: Likewise. + * elf/dl-version.c: Likewise. + * elf/do-rel.h: Likewise. + * elf/dynamic-link.h: Likewise. + * elf/link.h: Likewise. + * elf/rtld.c: Likewise. + * sysdeps/generic/dl-dtprocnum.h: New file. + * sysdeps/ia64/dl-dtprocnum.h: New file. + * sysdeps/mips/dl-dtprocnum.h: New file. + * sysdeps/sparc/dl-dtprocnum.h: New file. + * sysdeps/i386/dl-machine.h: Add more __builtin_expect. * elf/do-lookup.h: Add some __builtin_expect. diff --git a/elf/dl-deps.c b/elf/dl-deps.c index fca210f72a..670b9df8d4 100644 --- a/elf/dl-deps.c +++ b/elf/dl-deps.c @@ -30,11 +30,11 @@ /* Whether an shared object references one or more auxiliary objects is signaled by the AUXTAG entry in l_info. */ -#define AUXTAG (DT_NUM + DT_PROCNUM + DT_VERSIONTAGNUM \ +#define AUXTAG (DT_NUM + DT_THISPROCNUM + DT_VERSIONTAGNUM \ + DT_EXTRATAGIDX (DT_AUXILIARY)) /* Whether an shared object references one or more auxiliary objects is signaled by the AUXTAG entry in l_info. */ -#define FILTERTAG (DT_NUM + DT_PROCNUM + DT_VERSIONTAGNUM \ +#define FILTERTAG (DT_NUM + DT_THISPROCNUM + DT_VERSIONTAGNUM \ + DT_EXTRATAGIDX (DT_FILTER)) /* This is zero at program start to signal that the global scope map is diff --git a/elf/dl-lookup.c b/elf/dl-lookup.c index 09f34f9f4a..d01fdaa648 100644 --- a/elf/dl-lookup.c +++ b/elf/dl-lookup.c @@ -28,7 +28,7 @@ #include -#define VERSTAG(tag) (DT_NUM + DT_PROCNUM + DT_VERSIONTAGIDX (tag)) +#define VERSTAG(tag) (DT_NUM + DT_THISPROCNUM + DT_VERSIONTAGIDX (tag)) /* We need this string more than once. */ static const char undefined_msg[] = "undefined symbol: "; diff --git a/elf/dl-runtime.c b/elf/dl-runtime.c index f0635eae3a..cb38dfe9d0 100644 --- a/elf/dl-runtime.c +++ b/elf/dl-runtime.c @@ -30,7 +30,7 @@ #endif #ifndef VERSYMIDX -# define VERSYMIDX(sym) (DT_NUM + DT_PROCNUM + DT_VERSIONTAGIDX (sym)) +# define VERSYMIDX(sym) (DT_NUM + DT_THISPROCNUM + DT_VERSIONTAGIDX (sym)) #endif diff --git a/elf/dl-version.c b/elf/dl-version.c index 0718b8a5a8..67104916d6 100644 --- a/elf/dl-version.c +++ b/elf/dl-version.c @@ -29,7 +29,7 @@ #ifndef VERSYMIDX -# define VERSYMIDX(tag) (DT_NUM + DT_PROCNUM + DT_VERSIONTAGIDX (tag)) +# define VERSYMIDX(tag) (DT_NUM + DT_THISPROCNUM + DT_VERSIONTAGIDX (tag)) #endif diff --git a/elf/do-rel.h b/elf/do-rel.h index 721390d4e6..cf39d1df08 100644 --- a/elf/do-rel.h +++ b/elf/do-rel.h @@ -27,7 +27,7 @@ #endif #ifndef VERSYMIDX -# define VERSYMIDX(sym) (DT_NUM + DT_PROCNUM + DT_VERSIONTAGIDX (sym)) +# define VERSYMIDX(sym) (DT_NUM + DT_THISPROCNUM + DT_VERSIONTAGIDX (sym)) #endif /* Perform the relocations in MAP on the running program image as specified diff --git a/elf/dynamic-link.h b/elf/dynamic-link.h index 5987707e9c..79e17ed51c 100644 --- a/elf/dynamic-link.h +++ b/elf/dynamic-link.h @@ -22,7 +22,7 @@ #include #ifndef VERSYMIDX -# define VERSYMIDX(sym) (DT_NUM + DT_PROCNUM + DT_VERSIONTAGIDX (sym)) +# define VERSYMIDX(sym) (DT_NUM + DT_THISPROCNUM + DT_VERSIONTAGIDX (sym)) #endif @@ -51,12 +51,12 @@ elf_get_dynamic_info (struct link_map *l) if (dyn->d_tag < DT_NUM) info[dyn->d_tag] = dyn; else if (dyn->d_tag >= DT_LOPROC && - dyn->d_tag < DT_LOPROC + DT_PROCNUM) + dyn->d_tag < DT_LOPROC + DT_THISPROCNUM) info[dyn->d_tag - DT_LOPROC + DT_NUM] = dyn; else if ((Elf32_Word) DT_VERSIONTAGIDX (dyn->d_tag) < DT_VERSIONTAGNUM) info[VERSYMIDX (dyn->d_tag)] = dyn; else if ((Elf32_Word) DT_EXTRATAGIDX (dyn->d_tag) < DT_EXTRANUM) - info[DT_EXTRATAGIDX (dyn->d_tag) + DT_NUM + DT_PROCNUM + info[DT_EXTRATAGIDX (dyn->d_tag) + DT_NUM + DT_THISPROCNUM + DT_VERSIONTAGNUM] = dyn; else assert (! "bad dynamic tag"); diff --git a/elf/link.h b/elf/link.h index 0588b523e3..38652ca46a 100644 --- a/elf/link.h +++ b/elf/link.h @@ -126,14 +126,15 @@ struct link_map struct libname_list *l_libname; /* Indexed pointers to dynamic section. [0,DT_NUM) are indexed by the processor-independent tags. - [DT_NUM,DT_NUM+DT_PROCNUM) are indexed by the tag minus DT_LOPROC. - [DT_NUM+DT_PROCNUM,DT_NUM+DT_PROCNUM+DT_EXTRANUM) are indexed + [DT_NUM,DT_NUM+DT_THISPROCNUM) are indexed by the tag minus DT_LOPROC. + [DT_NUM+DT_THISPROCNUM,DT_NUM+DT_THISPROCNUM+DT_EXTRANUM) are indexed by DT_EXTRATAGIDX(tagvalue) and - [DT_NUM+DT_PROCNUM+DT_VERSIONTAGNUM, - DT_NUM+DT_PROCNUM+DT_VERSIONTAGNUM+DT_EXTRANUM) + [DT_NUM+DT_THISPROCNUM+DT_VERSIONTAGNUM, + DT_NUM+DT_THISPROCNUM+DT_VERSIONTAGNUM+DT_EXTRANUM) are indexed by DT_EXTRATAGIDX(tagvalue) (see ). */ - ElfW(Dyn) *l_info[DT_NUM + DT_PROCNUM + DT_VERSIONTAGNUM + DT_EXTRANUM]; + ElfW(Dyn) *l_info[DT_NUM + DT_THISPROCNUM + DT_VERSIONTAGNUM + + DT_EXTRANUM]; const ElfW(Phdr) *l_phdr; /* Pointer to program header table in core. */ ElfW(Addr) l_entry; /* Entry point location. */ ElfW(Half) l_phnum; /* Number of program header entries. */ diff --git a/elf/rtld.c b/elf/rtld.c index 6bf1dba089..b83eaa61b1 100644 --- a/elf/rtld.c +++ b/elf/rtld.c @@ -348,7 +348,7 @@ match_version (const char *string, struct link_map *map) const char *strtab = (const void *) D_PTR (map, l_info[DT_STRTAB]); ElfW(Verdef) *def; -#define VERDEFTAG (DT_NUM + DT_PROCNUM + DT_VERSIONTAGIDX (DT_VERDEF)) +#define VERDEFTAG (DT_NUM + DT_THISPROCNUM + DT_VERSIONTAGIDX (DT_VERDEF)) if (map->l_info[VERDEFTAG] == NULL) /* The file has no symbol versioning. */ return 0; @@ -953,7 +953,7 @@ of this helper program; chances are you did not intend to run this program.\n\ } while (l); } -#define VERNEEDTAG (DT_NUM + DT_PROCNUM + DT_VERSIONTAGIDX (DT_VERNEED)) +#define VERNEEDTAG (DT_NUM + DT_THISPROCNUM + DT_VERSIONTAGIDX (DT_VERNEED)) if (version_info) { /* Print more information. This means here, print information diff --git a/include/elf.h b/include/elf.h index 8a1764f956..cdedd8598e 100644 --- a/include/elf.h +++ b/include/elf.h @@ -1 +1,6 @@ -#include +#ifndef _ELF_H +# include +/* Some information which is not meant for the public and therefore not + in . */ +# include +#endif diff --git a/sysdeps/generic/dl-dtprocnum.h b/sysdeps/generic/dl-dtprocnum.h new file mode 100644 index 0000000000..e734f660e7 --- /dev/null +++ b/sysdeps/generic/dl-dtprocnum.h @@ -0,0 +1,22 @@ +/* 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 Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* Number of extra dynamic section entries for this architecture. By + default there are none. */ +#define DT_THISPROCNUM 0 diff --git a/sysdeps/ia64/dl-dtprocnum.h b/sysdeps/ia64/dl-dtprocnum.h new file mode 100644 index 0000000000..bf5e9e4c5e --- /dev/null +++ b/sysdeps/ia64/dl-dtprocnum.h @@ -0,0 +1,22 @@ +/* Configuration of lookup functions. IA-64 version. + 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 Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* Number of extra dynamic section entries for this architecture. By + default there are none. */ +#define DT_THISPROCNUM DT_IA_64_NUM diff --git a/sysdeps/mips/dl-dtprocnum.h b/sysdeps/mips/dl-dtprocnum.h new file mode 100644 index 0000000000..bff02c8412 --- /dev/null +++ b/sysdeps/mips/dl-dtprocnum.h @@ -0,0 +1,22 @@ +/* Configuration of lookup functions. MIPS version. + 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 Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* Number of extra dynamic section entries for this architecture. By + default there are none. */ +#define DT_THISPROCNUM DT_MIPS_NUM diff --git a/sysdeps/sparc/dl-dtprocnum.h b/sysdeps/sparc/dl-dtprocnum.h new file mode 100644 index 0000000000..6eedc0e718 --- /dev/null +++ b/sysdeps/sparc/dl-dtprocnum.h @@ -0,0 +1,22 @@ +/* Configuration of lookup functions. SPARC version. + 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 Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* Number of extra dynamic section entries for this architecture. By + default there are none. */ +#define DT_THISPROCNUM DT_SPARC_NUM -- 2.11.4.GIT