mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-26 22:07:58 +08:00
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).
This commit is contained in:
@ -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>
|
2010-02-11 Sterling Augustine <sterling@jaw.hq.tensilica.com>
|
||||||
|
|
||||||
* config/tc-xtensa.c (istack_init): Don't call memset.
|
* config/tc-xtensa.c (istack_init): Don't call memset.
|
||||||
|
@ -103,6 +103,9 @@ enum reloc_func
|
|||||||
FUNC_LT_DTP_RELATIVE,
|
FUNC_LT_DTP_RELATIVE,
|
||||||
FUNC_LT_TP_RELATIVE,
|
FUNC_LT_TP_RELATIVE,
|
||||||
FUNC_IPLT_RELOC,
|
FUNC_IPLT_RELOC,
|
||||||
|
#ifdef TE_VMS
|
||||||
|
FUNC_SLOTCOUNT_RELOC,
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
enum reg_symbol
|
enum reg_symbol
|
||||||
@ -163,6 +166,11 @@ struct label_fix
|
|||||||
bfd_boolean dw2_mark_labels;
|
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. */
|
/* This is the endianness of the current section. */
|
||||||
extern int target_big_endian;
|
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_DTP_RELATIVE */
|
||||||
{ NULL, 0, { 0 } }, /* placeholder for FUNC_LT_TP_RELATIVE */
|
{ NULL, 0, { 0 } }, /* placeholder for FUNC_LT_TP_RELATIVE */
|
||||||
{ "iplt", PSEUDO_FUNC_RELOC, { 0 } },
|
{ "iplt", PSEUDO_FUNC_RELOC, { 0 } },
|
||||||
|
#ifdef TE_VMS
|
||||||
|
{ "slotcount", PSEUDO_FUNC_RELOC, { 0 } },
|
||||||
|
#endif
|
||||||
|
|
||||||
/* mbtype4 constants: */
|
/* mbtype4 constants: */
|
||||||
{ "alt", PSEUDO_FUNC_CONST, { 0xa } },
|
{ "alt", PSEUDO_FUNC_CONST, { 0xa } },
|
||||||
@ -7158,6 +7169,12 @@ md_begin (void)
|
|||||||
symbol_new (".<iplt>", undefined_section, FUNC_IPLT_RELOC,
|
symbol_new (".<iplt>", undefined_section, FUNC_IPLT_RELOC,
|
||||||
&zero_address_frag);
|
&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)
|
if (md.tune != itanium1)
|
||||||
{
|
{
|
||||||
/* Convert MFI NOPs bundles into MMI NOPs bundles. */
|
/* Convert MFI NOPs bundles into MMI NOPs bundles. */
|
||||||
@ -7744,6 +7761,15 @@ ia64_parse_name (char *name, expressionS *e, char *nextcharP)
|
|||||||
}
|
}
|
||||||
/* Skip ')'. */
|
/* Skip ')'. */
|
||||||
++input_line_pointer;
|
++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_symbol)
|
||||||
{
|
{
|
||||||
if (e->X_op != O_pseudo_fixup)
|
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;
|
break;
|
||||||
|
|
||||||
|
#ifdef TE_VMS
|
||||||
|
case FUNC_SLOTCOUNT_RELOC:
|
||||||
|
return DUMMY_RELOC_IA64_SLOTCOUNT;
|
||||||
|
#endif
|
||||||
|
|
||||||
default:
|
default:
|
||||||
abort ();
|
abort ();
|
||||||
}
|
}
|
||||||
@ -11278,12 +11309,48 @@ md_apply_fix (fixS *fix, valueT *valP, segT seg ATTRIBUTE_UNUSED)
|
|||||||
S_SET_THREAD_LOCAL (fix->fx_addsy);
|
S_SET_THREAD_LOCAL (fix->fx_addsy);
|
||||||
break;
|
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:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (fix->tc_fix_data.opnd == IA64_OPND_NIL)
|
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)
|
if (fix->tc_fix_data.bigendian)
|
||||||
number_to_chars_bigendian (fixpos, value, fix->fx_size);
|
number_to_chars_bigendian (fixpos, value, fix->fx_size);
|
||||||
else
|
else
|
||||||
|
@ -120,7 +120,7 @@ Reference Guide.
|
|||||||
* IA-64-Chars:: Special Characters
|
* IA-64-Chars:: Special Characters
|
||||||
* IA-64-Regs:: Register Names
|
* IA-64-Regs:: Register Names
|
||||||
* IA-64-Bits:: Bit Names
|
* IA-64-Bits:: Bit Names
|
||||||
@c * IA-64-Relocs:: Relocations // to be written
|
* IA-64-Relocs:: Relocations
|
||||||
@end menu
|
@end menu
|
||||||
|
|
||||||
@node IA-64-Chars
|
@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
|
instructions, but they can be used anywhere else where an integer
|
||||||
constant is expected.
|
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
|
@node IA-64 Opcodes
|
||||||
@section Opcodes
|
@section Opcodes
|
||||||
For detailed information on the IA-64 machine instruction set, see the
|
For detailed information on the IA-64 machine instruction set, see the
|
||||||
|
@ -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>
|
2010-02-10 Quentin Neill <quentin.neill@amd.com>
|
||||||
Sebastian Pop <sebastian.pop@amd.com>
|
Sebastian Pop <sebastian.pop@amd.com>
|
||||||
|
|
||||||
|
@ -89,4 +89,9 @@ if [istarget "ia64-*"] then {
|
|||||||
run_dump_test "operand-or"
|
run_dump_test "operand-or"
|
||||||
run_list_test "hint.b-err" ""
|
run_list_test "hint.b-err" ""
|
||||||
run_list_test "hint.b-warn" "-mhint.b=warning"
|
run_list_test "hint.b-warn" "-mhint.b=warning"
|
||||||
|
|
||||||
|
if [istarget "ia64-*-*vms*"] then {
|
||||||
|
run_dump_test "slotcount"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
10
gas/testsuite/gas/ia64/slotcount.d
Normal file
10
gas/testsuite/gas/ia64/slotcount.d
Normal file
@ -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 ....
|
51
gas/testsuite/gas/ia64/slotcount.s
Normal file
51
gas/testsuite/gas/ia64/slotcount.s
Normal file
@ -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)
|
Reference in New Issue
Block a user