[PATCH] ldso/x86_64: support protected symbols

Roman I Khimov khimov at altell.ru
Tue Apr 27 11:43:14 UTC 2010


Fixes dltest with NPTL.

Signed-off-by: Roman I Khimov <khimov at altell.ru>
---
 ldso/ldso/x86_64/elfinterp.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/ldso/ldso/x86_64/elfinterp.c b/ldso/ldso/x86_64/elfinterp.c
index 54528d3..ec53c48 100644
--- a/ldso/ldso/x86_64/elfinterp.c
+++ b/ldso/ldso/x86_64/elfinterp.c
@@ -172,7 +172,9 @@ _dl_do_reloc(struct elf_resolve *tpnt, struct dyn_elf *scope,
 	symbol_addr = 0;
 	symname = strtab + sym->st_name;
 
-	if (symtab_index) {
+	if (symtab_index &&
+		(ELF64_ST_VISIBILITY(symtab[symtab_index].st_other)
+		 != STV_PROTECTED)) {
 		symbol_addr = (ElfW(Addr))_dl_find_hash(symname, scope, tpnt,
 				elf_machine_type_class(reloc_type), &tls_tpnt);
 		/*
@@ -189,7 +191,11 @@ _dl_do_reloc(struct elf_resolve *tpnt, struct dyn_elf *scope,
 		/* Relocs against STN_UNDEF are usually treated as using a
 		 * symbol value of zero, and using the module containing the
 		 * reloc itself. */
-		symbol_addr = sym->st_value;
+		if (symtab_index)
+			symbol_addr = DL_FIND_HASH_VALUE(tpnt, elf_machine_type_class(reloc_type),
+							 sym);
+		else
+			symbol_addr = sym->st_value;
 		tls_tpnt = tpnt;
 	}
 
-- 
1.5.6.5



More information about the uClibc mailing list