summaryrefslogtreecommitdiff
path: root/ldso
diff options
context:
space:
mode:
authorCarmelo Amoroso <carmelo.amoroso@st.com>2010-09-24 09:02:41 +0200
committerCarmelo Amoroso <carmelo.amoroso@st.com>2010-09-24 09:02:41 +0200
commit8d29ef117dba66ab67419a69d272779d50f147f0 (patch)
treea8df75081898112b27252393792156124c89a84c /ldso
parentb9766aa08c90b6718d5497d6a6cf9e6f737e5141 (diff)
parent74407db52d3953c7f3c6b8a53661cfc96cb07e22 (diff)
Merge commit 'origin/master' into prelink
Conflicts: ldso/ldso/sh/elfinterp.c Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
Diffstat (limited to 'ldso')
-rw-r--r--ldso/ldso/sh/elfinterp.c43
1 files changed, 25 insertions, 18 deletions
diff --git a/ldso/ldso/sh/elfinterp.c b/ldso/ldso/sh/elfinterp.c
index e94c44dad..928a84b40 100644
--- a/ldso/ldso/sh/elfinterp.c
+++ b/ldso/ldso/sh/elfinterp.c
@@ -167,26 +167,33 @@ _dl_do_reloc (struct elf_resolve *tpnt, struct r_scope_elem *scope,
reloc_type = ELF32_R_TYPE(rpnt->r_info);
symtab_index = ELF32_R_SYM(rpnt->r_info);
symbol_addr = 0;
- symname = strtab + symtab[symtab_index].st_name;
if (symtab_index) {
- symbol_addr = (unsigned long) _dl_find_hash(symname, scope, tpnt, &current_value,
- elf_machine_type_class(reloc_type), &tls_tpnt);
- /*
- * We want to allow undefined references to weak symbols - this might
- * have been intentional. We should not be linking local symbols
- * here, so all bases should be covered.
- */
-
- if (!symbol_addr
- && (ELF_ST_TYPE(symtab[symtab_index].st_info) != STT_TLS)
- && (ELF32_ST_BIND(symtab[symtab_index].st_info) != STB_WEAK)) {
- _dl_dprintf(2, "%s: can't resolve symbol '%s'\n",
- _dl_progname, strtab + symtab[symtab_index].st_name);
-
- /* Let the caller to handle the error: it may be non fatal if called from dlopen */
- return 1;
- }
+ symname = strtab + symtab[symtab_index].st_name;
+ if (ELF32_ST_VISIBILITY(symtab[symtab_index].st_other)
+ != STV_PROTECTED) {
+ symbol_addr = (unsigned long) _dl_find_hash(symname, scope, tpnt, &current_value,
+ elf_machine_type_class(reloc_type), &tls_tpnt);
+ /*
+ * We want to allow undefined references to weak symbols - this might
+ * have been intentional. We should not be linking local symbols
+ * here, so all bases should be covered.
+ */
+
+ if (!symbol_addr
+ && (ELF_ST_TYPE(symtab[symtab_index].st_info) != STT_TLS)
+ && (ELF32_ST_BIND(symtab[symtab_index].st_info) != STB_WEAK)) {
+ _dl_dprintf(2, "%s: can't resolve symbol '%s'\n",
+ _dl_progname, strtab + symtab[symtab_index].st_name);
+
+ /* Let the caller to handle the error: it may be non fatal if called from dlopen */
+ return 1;
+ }
+ } else
+ /* Resolve protected symbols locally */
+ symbol_addr = DL_FIND_HASH_VALUE(tpnt, elf_machine_type_class(reloc_type),
+ &symtab[symtab_index]);
+
if (_dl_trace_prelink)
_dl_debug_lookup (symname, tpnt, &symtab[symtab_index],
&current_value, elf_machine_type_class(reloc_type));