diff options
author | Tristan Gingold <gingold@adacore.com> | 2010-02-12 14:34:45 +0000 |
---|---|---|
committer | Tristan Gingold <gingold@adacore.com> | 2010-02-12 14:34:45 +0000 |
commit | 9d0e849713a37ee589c203792f8450786733ee63 (patch) | |
tree | 627f06d761b7391c88cd30feca4df7b9538a4076 | |
parent | 8e9c5e020f5fa7b76a1f6694e2eb00a1585151cc (diff) | |
download | gdb-9d0e849713a37ee589c203792f8450786733ee63.zip gdb-9d0e849713a37ee589c203792f8450786733ee63.tar.gz gdb-9d0e849713a37ee589c203792f8450786733ee63.tar.bz2 |
gas/
2010-02-12 Tristan Gingold <gingold@adacore.com>
Douglas B Rupp <rupp@gnat.com>
* config/tc-ia64.c (enum reloc_func): Add FUNC_SLOTCOUNT_RELOC.
(DUMMY_RELOC_IA64_SLOTCOUNT): Added.
(pseudo_func): Add an entry for slotcount.
(md_begin): Initialize slotcount pseudo symbol.
(ia64_parse_name): Handle @slotcount parameter.
(ia64_gen_real_reloc_type): Handle slotcount.
(md_apply_fix): Ditto.
* doc/c-ia64.texi (IA-64-Relocs): Document @slotcount.
gas/testsuite/
2010-02-12 Tristan Gingold <gingold@adacore.com>
* gas/ia64/slotcount.s, gas/ia64/slotcount.s: New test.
* gas/ia64/ia64.exp: Add slotcount test (vms only).
-rw-r--r-- | gas/ChangeLog | 12 | ||||
-rw-r--r-- | gas/config/tc-ia64.c | 67 | ||||
-rw-r--r-- | gas/doc/c-ia64.texi | 17 | ||||
-rw-r--r-- | gas/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gas/testsuite/gas/ia64/ia64.exp | 5 | ||||
-rw-r--r-- | gas/testsuite/gas/ia64/slotcount.d | 10 | ||||
-rw-r--r-- | gas/testsuite/gas/ia64/slotcount.s | 51 |
7 files changed, 166 insertions, 1 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index 1156fe2..d1e9871 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,15 @@ +2010-02-12 Tristan Gingold <gingold@adacore.com> + Douglas B Rupp <rupp@gnat.com> + + * config/tc-ia64.c (enum reloc_func): Add FUNC_SLOTCOUNT_RELOC. + (DUMMY_RELOC_IA64_SLOTCOUNT): Added. + (pseudo_func): Add an entry for slotcount. + (md_begin): Initialize slotcount pseudo symbol. + (ia64_parse_name): Handle @slotcount parameter. + (ia64_gen_real_reloc_type): Handle slotcount. + (md_apply_fix): Ditto. + * doc/c-ia64.texi (IA-64-Relocs): Document @slotcount. + 2010-02-11 Sterling Augustine <sterling@jaw.hq.tensilica.com> * config/tc-xtensa.c (istack_init): Don't call memset. diff --git a/gas/config/tc-ia64.c b/gas/config/tc-ia64.c index e4563a7..73e31aa 100644 --- a/gas/config/tc-ia64.c +++ b/gas/config/tc-ia64.c @@ -103,6 +103,9 @@ enum reloc_func FUNC_LT_DTP_RELATIVE, FUNC_LT_TP_RELATIVE, FUNC_IPLT_RELOC, +#ifdef TE_VMS + FUNC_SLOTCOUNT_RELOC, +#endif }; enum reg_symbol @@ -163,6 +166,11 @@ struct label_fix bfd_boolean dw2_mark_labels; }; +#ifdef TE_VMS +/* An internally used relocation. */ +#define DUMMY_RELOC_IA64_SLOTCOUNT (BFD_RELOC_UNUSED + 1) +#endif + /* This is the endianness of the current section. */ extern int target_big_endian; @@ -575,6 +583,9 @@ pseudo_func[] = { NULL, 0, { 0 } }, /* placeholder for FUNC_LT_DTP_RELATIVE */ { NULL, 0, { 0 } }, /* placeholder for FUNC_LT_TP_RELATIVE */ { "iplt", PSEUDO_FUNC_RELOC, { 0 } }, +#ifdef TE_VMS + { "slotcount", PSEUDO_FUNC_RELOC, { 0 } }, +#endif /* mbtype4 constants: */ { "alt", PSEUDO_FUNC_CONST, { 0xa } }, @@ -7158,6 +7169,12 @@ md_begin (void) symbol_new (".<iplt>", undefined_section, FUNC_IPLT_RELOC, &zero_address_frag); +#ifdef TE_VMS + pseudo_func[FUNC_SLOTCOUNT_RELOC].u.sym = + symbol_new (".<slotcount>", undefined_section, FUNC_SLOTCOUNT_RELOC, + &zero_address_frag); +#endif + if (md.tune != itanium1) { /* Convert MFI NOPs bundles into MMI NOPs bundles. */ @@ -7744,6 +7761,15 @@ ia64_parse_name (char *name, expressionS *e, char *nextcharP) } /* Skip ')'. */ ++input_line_pointer; +#ifdef TE_VMS + if (idx == FUNC_SLOTCOUNT_RELOC) + { + /* @slotcount can accept any expression. Canonicalize. */ + e->X_add_symbol = make_expr_symbol (e); + e->X_op = O_symbol; + e->X_add_number = 0; + } +#endif if (e->X_op != O_symbol) { if (e->X_op != O_pseudo_fixup) @@ -11109,6 +11135,11 @@ ia64_gen_real_reloc_type (struct symbol *sym, bfd_reloc_code_real_type r_type) } break; +#ifdef TE_VMS + case FUNC_SLOTCOUNT_RELOC: + return DUMMY_RELOC_IA64_SLOTCOUNT; +#endif + default: abort (); } @@ -11278,12 +11309,48 @@ md_apply_fix (fixS *fix, valueT *valP, segT seg ATTRIBUTE_UNUSED) S_SET_THREAD_LOCAL (fix->fx_addsy); break; +#ifdef TE_VMS + case DUMMY_RELOC_IA64_SLOTCOUNT: + as_bad_where (fix->fx_file, fix->fx_line, + _("cannot resolve @slotcount parameter")); + fix->fx_done = 1; + return; +#endif + default: break; } } else if (fix->tc_fix_data.opnd == IA64_OPND_NIL) { +#ifdef TE_VMS + if (fix->fx_r_type == DUMMY_RELOC_IA64_SLOTCOUNT) + { + /* For @slotcount, convert an addresses difference to a slots + difference. */ + valueT v; + + v = (value >> 4) * 3; + switch (value & 0x0f) + { + case 0: + case 1: + case 2: + v += value & 0x0f; + break; + case 0x0f: + v += 2; + break; + case 0x0e: + v += 1; + break; + default: + as_bad (_("invalid @slotcount value")); + } + value = v; + } +#endif + if (fix->tc_fix_data.bigendian) number_to_chars_bigendian (fixpos, value, fix->fx_size); else diff --git a/gas/doc/c-ia64.texi b/gas/doc/c-ia64.texi index 6b0f3a9..f684171 100644 --- a/gas/doc/c-ia64.texi +++ b/gas/doc/c-ia64.texi @@ -120,7 +120,7 @@ Reference Guide. * IA-64-Chars:: Special Characters * IA-64-Regs:: Register Names * IA-64-Bits:: Bit Names -@c * IA-64-Relocs:: Relocations // to be written +* IA-64-Relocs:: Relocations @end menu @node IA-64-Chars @@ -170,6 +170,21 @@ the @samp{ssm}/@samp{sum} and @samp{rsm}/@samp{rum} instructions, but they can be used anywhere else where an integer constant is expected. +@node IA-64-Relocs +@subsection Relocations +@cindex IA-64 relocations + +In addition to the standard IA-64 relocations, the following relocations are +implemented by @code{@value{AS}}: + +@table @code +@item @@slotcount(@var{V}) +Convert the address offset @var{V} into a slot count. This pseudo +function is available only on VMS. The expression @var{V} must be +known at assembly time: it can't reference undefined symbols or symbols in +different sections. +@end table + @node IA-64 Opcodes @section Opcodes For detailed information on the IA-64 machine instruction set, see the diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index 07455e4..ad81fae 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2010-02-12 Tristan Gingold <gingold@adacore.com> + + * gas/ia64/slotcount.s, gas/ia64/slotcount.s: New test. + * gas/ia64/ia64.exp: Add slotcount test (vms only). + 2010-02-10 Quentin Neill <quentin.neill@amd.com> Sebastian Pop <sebastian.pop@amd.com> diff --git a/gas/testsuite/gas/ia64/ia64.exp b/gas/testsuite/gas/ia64/ia64.exp index 3dfd10b..221b8d4 100644 --- a/gas/testsuite/gas/ia64/ia64.exp +++ b/gas/testsuite/gas/ia64/ia64.exp @@ -89,4 +89,9 @@ if [istarget "ia64-*"] then { run_dump_test "operand-or" run_list_test "hint.b-err" "" run_list_test "hint.b-warn" "-mhint.b=warning" + + if [istarget "ia64-*-*vms*"] then { + run_dump_test "slotcount" + } + } diff --git a/gas/testsuite/gas/ia64/slotcount.d b/gas/testsuite/gas/ia64/slotcount.d new file mode 100644 index 0000000..3548266 --- /dev/null +++ b/gas/testsuite/gas/ia64/slotcount.d @@ -0,0 +1,10 @@ +#objdump: -s -j .slot_test +#name: ia64 slotcount + +.*: +file format .* + +Contents of section .slot_test: + 0000 04000000 01000000 02000000 03000000 ................ + 0010 04000000 05000000 06000000 07000000 ................ + 0020 08000000 02000000 06000000 03000000 ................ + 0030 02000000 .... diff --git a/gas/testsuite/gas/ia64/slotcount.s b/gas/testsuite/gas/ia64/slotcount.s new file mode 100644 index 0000000..bdbc318 --- /dev/null +++ b/gas/testsuite/gas/ia64/slotcount.s @@ -0,0 +1,51 @@ + .section .slot_test0,"",@progbits + data4.ua @slotcount(.L1-.L0) + + .text + .align 16 +foo: +[.L0:] + mov r2 = r12 +[.L1:] + mov r8 = r14 +[.L2:] + ;; + mov r12 = r2 +[.L3:] + { + .mii + nop 0 +[.L4:] + nop 0 +[.L5:] + nop 0 + } + { +[.L6:] + nop 0 +[.L7:] + nop 0 +[.L8:] + br.ret.sptk.many b0 + ;; + } + + .section .slot_test,"",@progbits +// data4.ua @slotcount(.Lundef) + + data4.ua @slotcount(17) + + data4.ua @slotcount(.L1-.L0) // 1 + data4.ua @slotcount(.L2-.L0) // 2 + data4.ua @slotcount(.L3-.L0) // 3 + data4.ua @slotcount(.L4-.L0) // 4 + data4.ua @slotcount(.L5-.L0) // 5 + data4.ua @slotcount(.L6-.L0) // 6 + data4.ua @slotcount(.L7-.L0) // 7 + data4.ua @slotcount(.L8-.L0) // 8 + + data4.ua @slotcount(.L3-.L1) // 2 + data4.ua @slotcount(.L8-.L2) // 6 + data4.ua @slotcount(.L4-.L1) // 3 + data4.ua @slotcount(.L4-.L2) // 2 +// data4.ua @slotcount(.L2-.Lundef) |