This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
Patch to tc-arm.c to fix .force_thumb
- To: binutils at sourceware dot cygnus dot com
- Subject: Patch to tc-arm.c to fix .force_thumb
- From: Nick Clifton <nickc at cygnus dot com>
- Date: Mon, 29 Nov 1999 15:29:06 GMT
- Reply-to: nickc at cygnus dot co dot uk
Hi Guys,
I have applied the following patch to tc-arm.c. It fixes the
.force_thumb pseudo op which had become broken when the code was added
to support v5 thumb instructions.
Cheers
Nick
1999-11-29 Nick Clifton <nickc@cygnus.com>
* config/tc-arm.c (thumb_mode): Turn into a tristate variable.
(s_force_thumb): Set thumb_mode to 2.
(md_assemble): Do not complain about thumb instructions on a
non-thumb target if thumb_mode is set to 2.
Index: config/tc-arm.c
===================================================================
RCS file: /cvs/binutils/binutils/gas/config/tc-arm.c,v
retrieving revision 1.26
diff -p -r1.26 tc-arm.c
*** tc-arm.c 1999/11/16 04:15:55 1.26
--- tc-arm.c 1999/11/29 15:27:13
*************** CONST char FLT_CHARS[] = "rRsSfFdDxXeEpP
*** 139,148 ****
symbolS * GOT_symbol; /* Pre-defined "_GLOBAL_OFFSET_TABLE_" */
#endif
! CONST int md_reloc_size = 8; /* Size of relocation record */
! static int thumb_mode = 0; /* non-zero if assembling thumb instructions */
!
typedef struct arm_fix
{
int thumb_mode;
--- 139,149 ----
symbolS * GOT_symbol; /* Pre-defined "_GLOBAL_OFFSET_TABLE_" */
#endif
! CONST int md_reloc_size = 8; /* Size of relocation record */
! static int thumb_mode = 0; /* 0: assemble for ARM, 1: assemble for Thumb,
! 2: assemble for Thumb even though target cpu
! does not support thumb instructions */
typedef struct arm_fix
{
int thumb_mode;
*************** s_force_thumb (ignore)
*** 1260,1266 ****
if (! thumb_mode)
{
! thumb_mode = 1;
record_alignment (now_seg, 1);
}
--- 1261,1267 ----
if (! thumb_mode)
{
! thumb_mode = 2;
record_alignment (now_seg, 1);
}
*************** md_assemble (str)
*** 6068,6074 ****
if (opcode)
{
/* Check that this instruction is supported for this CPU. */
! if ((opcode->variants & cpu_variant) == 0)
{
as_bad (_("selected processor does not support this opcode"));
return;
--- 6069,6075 ----
if (opcode)
{
/* Check that this instruction is supported for this CPU. */
! if (thumb_mode == 1 && (opcode->variants & cpu_variant) == 0)
{
as_bad (_("selected processor does not support this opcode"));
return;