From d2b52762b71a9e1bddd70635b791c3c15b039377 Mon Sep 17 00:00:00 2001 From: Hans-Peter Nilsson Date: Sun, 21 Dec 2008 20:16:47 +0000 Subject: * config/tc-cris.c (s_cris_dtpoff): New function. (md_pseudo_table): Add "dtpoffd". --- gas/ChangeLog | 5 +++++ gas/config/tc-cris.c | 26 ++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) 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 + + * config/tc-cris.c (s_cris_dtpoff): New function. + (md_pseudo_table): Add "dtpoffd". + 2008-12-20 H.J. Lu * 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 string (as common to --march= and .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, -- cgit v1.2.3