public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Thiemo Seufer <ica2_ts@csv.ica.uni-stuttgart.de>
To: binutils@sources.redhat.com
Subject: Re: TLS support for MIPS
Date: Wed, 09 Feb 2005 08:17:00 -0000	[thread overview]
Message-ID: <20050208233242.GB6840@rembrandt.csv.ica.uni-stuttgart.de> (raw)
In-Reply-To: <20050207230014.GA32655@nevyn.them.org>

Daniel Jacobowitz wrote:
[snip]
> @@ -237,6 +284,21 @@ struct mips_elf_link_hash_table
>    bfd_boolean mips16_stubs_seen;
>  };
>  
> +#define IS_TLS_RELOC(r_type) \

Other places use _P convention, so TLS_RELOC_P is probably better.

[snip]
> +      if (need_relocs)
> +	{
> +	  memset (rel, 0, sizeof (rel));
> +	  if (ABI_64_P (abfd))
> +	    rel[0].r_info = ELF_R_INFO (abfd, (unsigned long) indx,
> +					R_MIPS_TLS_DTPMOD64);
> +	  else
> +	    rel[0].r_info = ELF_R_INFO (abfd, (unsigned long) indx,
> +					R_MIPS_TLS_DTPMOD32);
> +	  rel[0].r_offset = rel[1].r_offset = rel[2].r_offset
> +	    = sgot->output_offset + sgot->output_section->vma + offset;
> +	  rel[1].r_info = ELF_R_INFO (abfd, 0, R_MIPS_NONE);
> +	  rel[2].r_info = ELF_R_INFO (abfd, 0, R_MIPS_NONE);

Clearing the r_info was already done with memset().

[snip]
> Index: binutils/gas/config/tc-mips.c
> ===================================================================
> --- binutils.orig/gas/config/tc-mips.c	2005-02-01 17:00:04.000000000 -0500
> +++ binutils/gas/config/tc-mips.c	2005-02-07 16:25:18.556720211 -0500
> @@ -1,6 +1,6 @@
>  /* tc-mips.c -- assemble code for a MIPS chip.
>     Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
> -   2003, 2004 Free Software Foundation, Inc.
> +   2003, 2004, 2005 Free Software Foundation, Inc.
>     Contributed by the OSF and Ralph Campbell.
>     Written by Keith Knowles and Ralph Campbell, working independently.
>     Modified for ECOFF and R4000 support by Ian Lance Taylor of Cygnus
> @@ -9819,6 +9819,13 @@ static const struct percent_op_match
>    {"%highest", BFD_RELOC_MIPS_HIGHEST},
>    {"%higher", BFD_RELOC_MIPS_HIGHER},
>    {"%neg", BFD_RELOC_MIPS_SUB},
> +  {"%tlsgd", BFD_RELOC_MIPS_TLS_GD},
> +  {"%tlsldm", BFD_RELOC_MIPS_TLS_LDM},
> +  /* These must always be used with %lo or %hi (for now).  */
> +  {"%dtpoff", BFD_RELOC_MIPS_TLS_LDO_LO16},
> +  {"%tpoff", BFD_RELOC_MIPS_TLS_TPOFF_LO16},
> +  /* This one must be used without %lo or %hi (for now).  */
> +  {"%gottpoff", BFD_RELOC_MIPS_TLS_TPOFF},

As already mentioned, explcit _lo, _hi suffixes are better.

Otherwise, great work! (And a special thanks for adding decent comments
to the multigot handling :-)


Thiemo

  parent reply	other threads:[~2005-02-08 23:32 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-08  9:30 Daniel Jacobowitz
2005-02-08 13:42 ` Alan Modra
2005-02-21 19:23   ` Daniel Jacobowitz
2005-02-22  9:23     ` Alan Modra
2005-02-08 16:26 ` Richard Sandiford
2005-02-08 18:04   ` Daniel Jacobowitz
2005-02-09  0:21     ` Eric Christopher
2005-02-09  7:07     ` Thiemo Seufer
2005-02-09  8:17 ` Thiemo Seufer [this message]
2005-02-24 21:56 ` Daniel Jacobowitz
2005-03-02  2:07   ` Thiemo Seufer
2005-03-03 10:27   ` Richard Sandiford
2005-03-03 14:28     ` Daniel Jacobowitz
2005-03-03 15:03       ` Richard Sandiford

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050208233242.GB6840@rembrandt.csv.ica.uni-stuttgart.de \
    --to=ica2_ts@csv.ica.uni-stuttgart.de \
    --cc=binutils@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).