> Timo Teräs <[email protected]> wrote on 2010/04/17 12:09:22:
> >
> > Joakim Tjernlund wrote:
> > >> Finally looked at the ldso patch and I am not entirely happy with it.
> > >> I think the general structure should be different to make it easier
> > >> to follow the code and port it to other archs. I can probably
> > >> take a stab at it during the weekend but I have no env. to test in
> > >> so I will have to do it blindly.
> > >
> > > So this is what I came up with. I do wonder if not linux_resolver
> > > need PROTECTED support too? Have you tested with LAZY relocation too?
> >
> > Have not tested lazy yet.
> >
> > > --- a/ldso/ldso/i386/elfinterp.c
> > > +++ b/ldso/ldso/i386/elfinterp.c
> > > @@ -175,11 +175,16 @@ _dl_do_reloc(struct elf_resolve *tpnt, struct 
> > > dyn_elf *scope,
> > >     symbol_addr = 0;
> > >     symname = strtab + symtab[symtab_index].st_name;
> > >
> > > -   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);
> > > +   if (symtab_index) {
> > > +       if (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);
> > > +       else
> > > +          symbol_addr = DL_FIND_HASH_VALUE(tpnt, elf_machine_type_class
> (reloc_type),
> > > +                       &symtab[symtab_index]);
> > >
> > >        /*
> > >         * We want to allow undefined references to weak symbols - this
> > > @@ -190,11 +195,7 @@ _dl_do_reloc(struct elf_resolve *tpnt, struct 
> > > dyn_elf *scope,
> > >                 && ELF32_ST_BIND(symtab[symtab_index].st_info) != 
> > > STB_WEAK))
> > >           return 1;
> > >     } else {
> > > -      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;
> > > +      symbol_addr = symtab[symtab_index].st_value;
> > >        tls_tpnt = tpnt;
> > >     }
> >
> > This looks functionally equivalent. And yes, looks like this is more 
> > consistent
> > approach.
> >
> > Related, I noticed that _dl_lookup_hash that uses DL_FIND_HASH_VALUE does 
> > actually
> > first a check for TLS symbols: if ELF_ST_TYPE(sym->st_info) == STT_TLS the
> > DL_FIND_HASH_VALUE is never called. I would suspect that protected TLS 
> > symbols
> > are broken currently.
>
> hmm, looks like it. Either one can add a hack for that or just not support
> protected for TLS ATM. Protected is very rare so we could get away with
> just supporting it for internal uClibc needs.
>
> The LAZY relocs is a bigger problem though. That has to work so it would be 
> great if
> you could test that too.

Hi Timo, did you get a chance to test LAZY relocs too? Now that
NPTL is in main line it would be good to know if PROTECTED works
as is or if more work is needed.

 Jocke

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

Reply via email to