summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2010-07-21 23:51:40 -0700
committerKhem Raj <raj.khem@gmail.com>2010-07-21 23:51:40 -0700
commit48fb264beaac8114e5ac3e80e70dda473fbce96d (patch)
tree0adedcb393beca5b32c2d5e34484c3654eed96fc
parentfb6ca14d4d53657a4cde0d3f881f02c0d54fe17b (diff)
ldso/arm: Correct protected symbol resolution
* Protected symbols should not be overridden with symbols from other modules. Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r--ldso/ldso/arm/elfinterp.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/ldso/ldso/arm/elfinterp.c b/ldso/ldso/arm/elfinterp.c
index 9bbf92c8c..adc282a57 100644
--- a/ldso/ldso/arm/elfinterp.c
+++ b/ldso/ldso/arm/elfinterp.c
@@ -198,7 +198,9 @@ _dl_do_reloc (struct elf_resolve *tpnt,struct dyn_elf *scope,
symtab_index = ELF32_R_SYM(rpnt->r_info);
symbol_addr = 0;
- if (symtab_index) {
+ if (symtab_index &&
+ (ELF32_ST_VISIBILITY(symtab[symtab_index].st_other)
+ != STV_PROTECTED)) {
symbol_addr = _dl_find_hash(strtab + symtab[symtab_index].st_name,
scope, tpnt, elf_machine_type_class(reloc_type), &def_mod);
@@ -219,7 +221,12 @@ _dl_do_reloc (struct elf_resolve *tpnt,struct dyn_elf *scope,
* symbol value of zero, and using the module containing the
* reloc itself.
*/
- 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;
+
def_mod = tpnt;
}