* config/tc-i960.c (ARCH_HX): Define.

(arch_tab): Add HX.
	(targ_has_sfr): Handle ARCH_HX.
	(targ_has_iclass): Handle ARCH_HX.
	(tc_coff_fix2rtype): Add return 0 to avoid warning.
	(tc_headers_hook): If the architecture was specified explicitly,
	use it when setting the flags.  Set the extern variable coff_flags
	rather than headers->filehdr.f_flags, since the latter is set
	unconditionally in obj-coff.c.
	(i960_handle_align): Remove unused variable fixp.
This commit is contained in:
Ian Lance Taylor 1996-02-05 23:52:42 +00:00
parent 2192180d13
commit f9e90c2ec6
2 changed files with 66 additions and 32 deletions

View File

@ -1,5 +1,16 @@
Mon Feb 5 16:29:11 1996 Ian Lance Taylor <ian@cygnus.com> Mon Feb 5 16:29:11 1996 Ian Lance Taylor <ian@cygnus.com>
* config/tc-i960.c (ARCH_HX): Define.
(arch_tab): Add HX.
(targ_has_sfr): Handle ARCH_HX.
(targ_has_iclass): Handle ARCH_HX.
(tc_coff_fix2rtype): Add return 0 to avoid warning.
(tc_headers_hook): If the architecture was specified explicitly,
use it when setting the flags. Set the extern variable coff_flags
rather than headers->filehdr.f_flags, since the latter is set
unconditionally in obj-coff.c.
(i960_handle_align): Remove unused variable fixp.
Support for building bfd and opcodes as shared libraries, based on Support for building bfd and opcodes as shared libraries, based on
patches from Alan Modra <alan@spri.levels.unisa.edu.au>: patches from Alan Modra <alan@spri.levels.unisa.edu.au>:
* configure.in: Set OPCODES and BFD to search directories. * configure.in: Set OPCODES and BFD to search directories.

View File

@ -446,7 +446,8 @@ static struct hash_control *areg_hash; /* Abase register hash table */
#define ARCH_KB 2 #define ARCH_KB 2
#define ARCH_MC 3 #define ARCH_MC 3
#define ARCH_CA 4 #define ARCH_CA 4
#define ARCH_XL 5 #define ARCH_HX 5
#define ARCH_XL 6
int architecture = ARCH_ANY; /* Architecture requested on invocation line */ int architecture = ARCH_ANY; /* Architecture requested on invocation line */
int iclasses_seen; /* OR of instruction classes (I_* constants) int iclasses_seen; /* OR of instruction classes (I_* constants)
* for which we've actually assembled * for which we've actually assembled
@ -938,6 +939,7 @@ static const struct tabentry arch_tab[] =
{"KC", ARCH_MC}, /* Synonym for MC */ {"KC", ARCH_MC}, /* Synonym for MC */
{"MC", ARCH_MC}, {"MC", ARCH_MC},
{"CA", ARCH_CA}, {"CA", ARCH_CA},
{"HX", ARCH_HX},
{"XL", ARCH_XL}, {"XL", ARCH_XL},
{NULL, 0} {NULL, 0}
}; };
@ -2751,6 +2753,8 @@ targ_has_sfr (n)
case ARCH_MC: case ARCH_MC:
case ARCH_XL: case ARCH_XL:
return 0; return 0;
case ARCH_HX:
return ((0 <= n) && (n <= 4));
case ARCH_CA: case ARCH_CA:
default: default:
return ((0 <= n) && (n <= 2)); return ((0 <= n) && (n <= 2));
@ -2766,8 +2770,7 @@ static
int int
targ_has_iclass (ic) targ_has_iclass (ic)
/* Instruction class; one of: /* Instruction class; one of:
I_BASE, I_CX, I_DEC, I_KX, I_FP, I_MIL, I_CASIM I_BASE, I_CX, I_DEC, I_KX, I_FP, I_MIL, I_CASIM, I_CX2, I_HX, I_HX2
or I_XL
*/ */
int ic; int ic;
{ {
@ -2782,8 +2785,10 @@ targ_has_iclass (ic)
return ic & (I_BASE | I_KX | I_FP | I_DEC | I_MIL); return ic & (I_BASE | I_KX | I_FP | I_DEC | I_MIL);
case ARCH_CA: case ARCH_CA:
return ic & (I_BASE | I_CX | I_CX2 | I_CASIM); return ic & (I_BASE | I_CX | I_CX2 | I_CASIM);
case ARCH_HX:
return ic & (I_BASE | I_CX2 | I_HX | I_HX2);
case ARCH_XL: case ARCH_XL:
return ic & (I_BASE | I_CX2 | I_XL); return ic & (I_BASE | I_CX2 | I_HX2); /* XL */
default: default:
if ((iclasses_seen & (I_KX | I_FP | I_DEC | I_MIL)) if ((iclasses_seen & (I_KX | I_FP | I_DEC | I_MIL))
&& (iclasses_seen & (I_CX | I_CX2))) && (iclasses_seen & (I_CX | I_CX2)))
@ -2952,6 +2957,7 @@ tc_coff_fix2rtype (fixP)
return R_IPRMED; return R_IPRMED;
abort (); abort ();
return 0;
} }
int int
@ -2974,37 +2980,56 @@ md_section_align (seg, addr)
return ((addr + (1 << section_alignment[(int) seg]) - 1) & (-1 << section_alignment[(int) seg])); return ((addr + (1 << section_alignment[(int) seg]) - 1) & (-1 << section_alignment[(int) seg]));
} /* md_section_align() */ } /* md_section_align() */
extern int coff_flags;
#ifdef OBJ_COFF #ifdef OBJ_COFF
void void
tc_headers_hook (headers) tc_headers_hook (headers)
object_headers *headers; object_headers *headers;
{ {
if (iclasses_seen == I_BASE) switch (architecture)
{ {
headers->filehdr.f_flags |= F_I960CORE; case ARCH_KA:
coff_flags |= F_I960KA;
break;
case ARCH_KB:
coff_flags |= F_I960KB;
break;
case ARCH_MC:
coff_flags |= F_I960MC;
break;
case ARCH_CA:
coff_flags |= F_I960CA;
break;
case ARCH_HX:
coff_flags |= F_I960HX;
break;
case ARCH_XL:
coff_flags |= F_I960XL;
break; /* XL */
default:
if (iclasses_seen == I_BASE)
coff_flags |= F_I960CORE;
else if (iclasses_seen & I_CX)
coff_flags |= F_I960CA;
else if (iclasses_seen & (I_HX | I_HX2))
coff_flags |= F_I960HX;
else if (iclasses_seen & I_CX2)
coff_flags |= F_I960CA;
else if (iclasses_seen & I_MIL)
coff_flags |= F_I960MC;
else if (iclasses_seen & (I_DEC | I_FP))
coff_flags |= F_I960KB;
else
coff_flags |= F_I960KA;
break;
} }
else if (iclasses_seen & I_CX)
{
headers->filehdr.f_flags |= F_I960CA;
}
else if (iclasses_seen & I_XL)
headers->filehdr.f_flags |= F_I960XL;
else if (iclasses_seen & I_CX2)
{
headers->filehdr.f_flags |= F_I960CA;
}
else if (iclasses_seen & I_MIL)
{
headers->filehdr.f_flags |= F_I960MC;
}
else if (iclasses_seen & (I_DEC | I_FP))
{
headers->filehdr.f_flags |= F_I960KB;
}
else
{
headers->filehdr.f_flags |= F_I960KA;
} /* set arch flag */
if (flag_readonly_data_in_text) if (flag_readonly_data_in_text)
{ {
@ -3171,8 +3196,6 @@ void
i960_handle_align (fragp) i960_handle_align (fragp)
fragS *fragp; fragS *fragp;
{ {
fixS *fixp;
if (!linkrelax) if (!linkrelax)
return; return;
@ -3191,8 +3214,8 @@ i960_handle_align (fragp)
return; return;
/* alignment directive */ /* alignment directive */
fixp = fix_new (fragp, fragp->fr_fix, fragp->fr_offset, 0, 0, 0, fix_new (fragp, fragp->fr_fix, fragp->fr_offset, 0, 0, 0,
(int) fragp->fr_type); (int) fragp->fr_type);
#endif /* OBJ_BOUT */ #endif /* OBJ_BOUT */
} }