OSDN Git Service

Add protected symbols support for all architectures
authorSalvatore Cro <salvatore.cro@st.com>
Wed, 12 Jan 2011 09:27:16 +0000 (10:27 +0100)
committerCarmelo Amoroso <carmelo.amoroso@st.com>
Thu, 20 Jan 2011 13:51:42 +0000 (14:51 +0100)
commitaaf4cbd98fda76af93ebea5241f65291ff6bcaac
treee74a6dfb7639f30be2a8c723fc44e92b63b84538
parentc70ac1d9b290e70cbc789b0abb47337f8aa9faef
Add protected symbols support for all architectures

Protected symbols are global symbols for which interposition is not allowed.
We manage them in generic _dl_lookup_hash function. To handle protected symbols
we need to get a reference to the module that defines the symbol itself.
So we pass a new parameter 'struct symbol_ref' to the __dl_lookup_hash
that is defined as below:

struct symbol_ref {
  const ElfW(Sym) *sym;
  struct elf_resolve *tpnt;
};

The tpnt field is used as an ouput parameter and refers to the module which defines
the protected symbol.
Further it can be used as output parameter for TLS relocations and FDPIC case.
The sym field is instead used as an input parameter to detect the visibility of the
symbol we are looking-up.
In this way we get rid of different signatures for _dl_lookup_hash, allowing to remove
the _dl_find_hash wrapper.
This new structure is also suitable for prelink integration.

Signed-off-by: Salvatore Cro <salvatore.cro@st.com>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
16 files changed:
ldso/include/dl-hash.h
ldso/ldso/arm/elfinterp.c
ldso/ldso/avr32/elfinterp.c
ldso/ldso/bfin/elfinterp.c
ldso/ldso/cris/elfinterp.c
ldso/ldso/dl-hash.c
ldso/ldso/i386/elfinterp.c
ldso/ldso/m68k/elfinterp.c
ldso/ldso/mips/elfinterp.c
ldso/ldso/powerpc/elfinterp.c
ldso/ldso/sh/elfinterp.c
ldso/ldso/sh64/elfinterp.c
ldso/ldso/sparc/elfinterp.c
ldso/ldso/x86_64/elfinterp.c
ldso/ldso/xtensa/elfinterp.c
ldso/libdl/libdl.c