summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans-Peter Nilsson <hp@axis.com>2008-12-21 20:16:47 +0000
committerHans-Peter Nilsson <hp@axis.com>2008-12-21 20:16:47 +0000
commitd2b52762b71a9e1bddd70635b791c3c15b039377 (patch)
tree0749b651fe736f75f8b22f07f80478ca13ba0158
parent0f34d0b4f9026a1b3b1f4780f8a942addd34f1a7 (diff)
downloadbinutils-d2b52762b71a9e1bddd70635b791c3c15b039377.tar.gz
binutils-d2b52762b71a9e1bddd70635b791c3c15b039377.tar.bz2
binutils-d2b52762b71a9e1bddd70635b791c3c15b039377.zip
* config/tc-cris.c (s_cris_dtpoff): New function.
(md_pseudo_table): Add "dtpoffd".
-rw-r--r--gas/ChangeLog5
-rw-r--r--gas/config/tc-cris.c26
2 files changed, 31 insertions, 0 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 2b6eb317a98..adf99e2d24e 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,8 @@
+2008-12-21 Hans-Peter Nilsson <hp@axis.com>
+
+ * config/tc-cris.c (s_cris_dtpoff): New function.
+ (md_pseudo_table): Add "dtpoffd".
+
2008-12-20 H.J. Lu <hongjiu.lu@intel.com>
* config/tc-i386.c (parse_insn): Optimize ".s" handling.
diff --git a/gas/config/tc-cris.c b/gas/config/tc-cris.c
index 48e17be4507..44a3bc97b9e 100644
--- a/gas/config/tc-cris.c
+++ b/gas/config/tc-cris.c
@@ -148,6 +148,7 @@ static void s_syntax (int);
static void s_cris_file (int);
static void s_cris_loc (int);
static void s_cris_arch (int);
+static void s_cris_dtpoff (int);
/* Get ":GOT", ":GOTOFF", ":PLT" etc. suffixes. */
static void cris_get_reloc_suffix (char **, bfd_reloc_code_real_type *,
@@ -198,6 +199,7 @@ static enum cris_archs cris_arch = XCONCAT2 (arch_,DEFAULT_CRIS_ARCH);
const pseudo_typeS md_pseudo_table[] =
{
{"dword", cons, 4},
+ {"dtpoffd", s_cris_dtpoff, 4},
{"syntax", s_syntax, 0},
{"file", s_cris_file, 0},
{"loc", s_cris_loc, 0},
@@ -4213,6 +4215,30 @@ s_cris_loc (int dummy)
dwarf2_directive_loc (dummy);
}
+/* Worker for .dtpoffd: generate a R_CRIS_32_DTPREL reloc, as for
+ expr:DTPREL but for use in debug info. */
+
+static void
+s_cris_dtpoff (int bytes)
+{
+ expressionS ex;
+ char *p;
+
+ if (bytes != 4)
+ as_fatal (_("internal inconsistency problem: %s called for %d bytes"),
+ __FUNCTION__, bytes);
+
+ expression (&ex);
+
+ p = frag_more (bytes);
+ md_number_to_chars (p, 0, bytes);
+ fix_new_exp (frag_now, p - frag_now->fr_literal, bytes, &ex, FALSE,
+ BFD_RELOC_CRIS_32_DTPREL);
+
+ demand_empty_rest_of_line ();
+}
+
+
/* Translate a <arch> string (as common to --march=<arch> and .arch <arch>)
into an enum. If the string *STR is recognized, *STR is updated to point
to the end of the string. If the string is not recognized,