This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Add TLS support to binutils (ia32 and ia64 for now)


On Thu, Feb 14, 2002 at 12:02:10AM +1030, Alan Modra wrote:
> Hi Jakub,
>   Some suggestions after a quick scan through the diff..
> 
> On Tue, Feb 12, 2002 at 02:47:44PM +0100, Jakub Jelinek wrote:
> > +
> > +#define local_got_tls_type(abfd, symsize, n) \
> > +  ((char *)(elf_local_got_refcounts (abfd) + (symsize)))[n]
> 
> A separate var, initialised when elf_local_got_refcounts is
> allocated, would be better than the define.

I wanted to avoid subclassing elf_tdata for i386 just for this.
But can try if you think it is necessary.

> > +/* Return the base VMA address which should be subtracted from real addresses
> > +   when resolving @dtpoff relocation.
> > +   This is PT_TLS segment p_vaddr.  */
> > +
> > +static bfd_vma
> > +dtpoff_base (abfd)
> > +     bfd *abfd;
> 
> Perhaps cache this, and tpoff, in elf_i386_link_hash_table?

Well, I think it should go into elf_link_hash_table (not exactly these two
offsets, but vma of PT_TLS segment, alignment of PT_TLS segment and its
memory size.
Then these can be computed very cheaply (and is what may differ among
arches). All arches implementing TLS will need this.
Will rework the patch for this.

> > --- bfd/section.c.jj	Mon Jan 14 17:02:48 2002
> > +++ bfd/section.c	Mon Jan 28 16:02:38 2002
> > @@ -367,6 +367,11 @@ CODE_FRAGMENT
> >  .
> >  .  {*  End of section flags.  *}
> >  .
> > +.  flagword flags2;
> > +.
> > +.  {* The section contains thread local data.  *}
> > +.#define SEC_FLAG2_THREAD_LOCAL	1
> 
> I would rather see bit-fields than another flagword.

I can change that, though with every single new field one will have to
chase or the flags copying code chunks and add the new bitfield in.

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]