Timo Teräs <[email protected]> wrote on 2010/04/16 11:39:00:
>
> Joakim Tjernlund wrote:
> >>> Yes. Exactly that. It's __attribute__(( visibility("protected") )).
> >>> Or .protected for asm. I'm doing a patch on this right now.
> >>> http://www.ohse.de/uwe/articles/gcc-attributes.html#func-visibility
> >> But this is PROTECTED and you might need to impl. STB_PROTECTED in ldso
> > That should be STV_PROTECTED
> >
> >> to support it. I once looked at that when I was hacking ldso in uClibc
> >> some years ago but I don't remember the details any more.
>
> Ah, you're right. It does need ld.so support. I'll try to figure out
> if it's easy to implement, or if we get away with some linker flags.
>

This MIGHT do it(completely untested):

diff --git a/ldso/ldso/i386/elfinterp.c b/ldso/ldso/i386/elfinterp.c
index a01c1d0..7f1b408 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);


_______________________________________________
uClibc mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/uclibc

Reply via email to