diff options
| author | Joakim Tjernlund <joakim.tjernlund@transmode.se> | 2010-04-16 15:37:40 +0300 | 
|---|---|---|
| committer | Austin Foxley <austinf@cetoncorp.com> | 2010-04-16 10:11:57 -0700 | 
| commit | ba38f0cec27b91cc7c605417ad047c4dc77d732f (patch) | |
| tree | 049d4d33eed3c72f40f0b905d5ae8feda4489295 | |
| parent | e80e2f61261741516902b44b13202d3f7673977e (diff) | |
ldso/i386: support protected symbols
Make sure protected symbols are not overridden by other modules.
Signed-off-by: Joakim Tjernlund <joakim.tjernlund@transmode.se>
Signed-off-by: Timo Teräs <timo.teras@iki.fi>
Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
| -rw-r--r-- | ldso/ldso/i386/elfinterp.c | 10 | 
1 files changed, 8 insertions, 2 deletions
| diff --git a/ldso/ldso/i386/elfinterp.c b/ldso/ldso/i386/elfinterp.c index a01c1d020..1e3a2b248 100644 --- a/ldso/ldso/i386/elfinterp.c +++ b/ldso/ldso/i386/elfinterp.c @@ -175,7 +175,9 @@ _dl_do_reloc(struct elf_resolve *tpnt, struct dyn_elf *scope,  	symbol_addr = 0;  	symname = strtab + symtab[symtab_index].st_name; -	if (symtab_index) { +	if (symtab_index && +	    (ELF32_ST_VISIBILITY(symtab[symtab_index].st_other) +	     != STV_PROTECTED)) {  		symbol_addr = (unsigned long)_dl_find_hash(symname, scope, tpnt,  							   elf_machine_type_class(reloc_type), &tls_tpnt); @@ -188,7 +190,11 @@ _dl_do_reloc(struct elf_resolve *tpnt, struct dyn_elf *scope,  					&& ELF32_ST_BIND(symtab[symtab_index].st_info) != STB_WEAK))  			return 1;  	} else { -		symbol_addr = symtab[symtab_index].st_value; +		if (symtab_index) +			symbol_addr = DL_FIND_HASH_VALUE(tpnt, elf_machine_type_class(reloc_type), +							 &symtab[symtab_index]); +		else +			symbol_addr = symtab[symtab_index].st_value;  		tls_tpnt = tpnt;  	} | 
