MIPS NPTL patches [1/3]

Dan E trg_info at mailhaven.com
Fri Apr 10 08:28:10 UTC 2009


On Fri, 10 Apr 2009 08:49 +0200, "Carmelo AMOROSO"
<carmelo.amoroso at st.com> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Dan E wrote:
> > It figures.  Let's try that again without the word wrapping.
> > 
> 
> I agree with Mike to stop talking, and let's go back to code...

OK

> > ---------- patch start ----------
> > Index: uClibc-nptl/include/unistd.h
> > ===================================================================
> > --- uClibc-nptl/include/unistd.h	(revision 26031)
> > +++ uClibc-nptl/include/unistd.h	(working copy)
> > @@ -771,7 +771,7 @@
> >  #endif /* Use BSD. */
> >  
> >  /* Special exit function which only terminates the current thread.  */
> > -extern void __exit_thread (int val) __attribute__ ((noreturn));
> > +extern void __exit_thread (int val) __attribute__ ((__noreturn__));
> >  
> >  /* Return the pathname of the terminal FD is open on, or NULL on errors.
> >     The returned storage is good only until the next call to this function.  */
> > Index: uClibc-nptl/ldso/ldso/mips/elfinterp.c
> > ===================================================================
> > --- uClibc-nptl/ldso/ldso/mips/elfinterp.c	(revision 26031)
> > +++ uClibc-nptl/ldso/ldso/mips/elfinterp.c	(working copy)
> > @@ -210,7 +210,7 @@
> >  
> >  				if (ELF32_ST_BIND(symtab[symtab_index].st_info) != STB_LOCAL) {
> >  					_dl_find_hash((strtab + symtab[symtab_index].st_name),
> > -							_dl_symbol_tables, tpnt_tls, 1, &sym_tls);
> > +							_dl_symbol_tables, tpnt_tls, 1, &tpnt_tls);
> 
> this change is correct, last parameter must but the address of the
> tpnt that will resolve a tls symbol. Anyway I've looked at

That last parameter is the crux of everything I posted.

> elfinterp.c for mips, and there some part that are not convincing
> me: unfortunately the implementation is quite different from other
> arch I know better (sh/arm): I'll try to find some time to review
> it. I'd suggest you in the meanwhile to go back in the change
> history and look at the version before the Deny's commit that
> removed all TLS related stuff: after that I tried to roll back to
> the previous version, at least going back to a build-able tree, but
> probably not totally working: likely I've lost some piece.

Can you give me a hint about the timeframe of that TLS commit?
I saw it mentioned here a few months ago but I wasn't able to find it.

Is there anything that uses TLS outside of NPTL?  It might help to
isolate and validate the TLS code before adding NPTL to the mix.

> 
> I'd not commit this for now, I'd prefer to have tested before.
> 

As you wish.

> > Index: uClibc-nptl/ldso/ldso/mips/dl-sysdep.h
> > ===================================================================
> > --- uClibc-nptl/ldso/ldso/mips/dl-sysdep.h	(revision 26031)
> > +++ uClibc-nptl/ldso/ldso/mips/dl-sysdep.h	(working copy)
> > @@ -127,7 +127,7 @@
> >  	GOT_BASE[0] = (unsigned long) _dl_runtime_resolve;			\
> >  	GOT_BASE[1] = (unsigned long) MODULE;					\
> >  										\
> > -	pltgot = MODULE->dynamic_info[DT_MIPS_PLTGOT_IDX];			\
> > +	pltgot = (unsigned long *) MODULE->dynamic_info[DT_MIPS_PLTGOT_IDX];	\
> 
> is this change required just for a warning ? or pointer arithmetic
> requires it ?

It eliminates a warning.  There's a lot of typecasting going on and it
was a warning that originally led me to the tpnt parameter problem, so I
tried to eliminate other warnings, too.  It would be nice to compile
everything using -Werror but I realize that may not be practical.

> 
> cheers,
> carmelo

DanE

-- 
http://www.fastmail.fm - Same, same, but different...



More information about the uClibc mailing list