/* careful, this file includes data *declarations* */
#include "opcode/sparc.h"
-void md_begin ();
-void md_end ();
-void md_number_to_chars ();
-void md_assemble ();
-char *md_atof ();
-void md_create_short_jump ();
-void md_create_long_jump ();
-int md_estimate_size_before_relax ();
-void md_ri_to_chars ();
-symbolS *md_undefined_symbol ();
-static void sparc_ip ();
+static void sparc_ip PARAMS ((char *));
static enum sparc_architecture current_architecture = v6;
static int architecture_requested;
/* handle of the OPCODE hash table */
static struct hash_control *op_hash = NULL;
-static void s_seg (), s_proc (), s_data1 (), s_reserve (), s_common ();
-extern void s_globl (), s_long (), s_short (), s_space (), cons ();
-extern void s_align_bytes (), s_ignore (), s_local();
-/* start-sanitize-v9 */
-#ifndef NO_V9
-static void s_xword ();
-#endif
-/* end-sanitize-v9 */
+static void s_data1 PARAMS ((void));
+static void s_seg PARAMS ((int));
+static void s_proc PARAMS ((int));
+static void s_reserve PARAMS ((int));
+static void s_common PARAMS ((int));
/* Ugly hack to keep non-BFD version working. */
#ifndef BFD_ASSEMBLER
#define BFD_RELOC_SPARC_BASE13 RELOC_BASE13
#define BFD_RELOC_SPARC13 RELOC_13
#define BFD_RELOC_SPARC_BASE22 RELOC_BASE22
-#define subseg_set subseg_new
#endif
const pseudo_typeS md_pseudo_table[] =
{"word", cons, 4},
/* start-sanitize-v9 */
#ifndef NO_V9
- {"xword", s_xword, 0},
+ {"xword", cons, 8},
#ifdef OBJ_ELF
{"uaxword", cons, 8},
#endif
#endif
static void
-s_reserve ()
+s_reserve (ignore)
+ int ignore;
{
char *name;
char *p;
{
if (! need_pass_2)
{
- char *p;
+ char *pfrag;
segT current_seg = now_seg;
subsegT current_subseg = now_subseg;
symbolP->sy_frag->fr_symbol = NULL;
symbolP->sy_frag = frag_now;
- p = frag_var (rs_org, 1, 1, (relax_substateT)0, symbolP,
- size, (char *)0);
- *p = 0;
+ pfrag = frag_var (rs_org, 1, 1, (relax_substateT)0, symbolP,
+ size, (char *)0);
+ *pfrag = 0;
S_SET_SEGMENT (symbolP, bss_section);
}
static void
-s_common ()
+s_common (ignore)
+ int ignore;
{
char *name;
char c;
else
{
#ifndef OBJ_ELF
- S_SET_VALUE (symbolP, size);
+ S_SET_VALUE (symbolP, (valueT) size);
S_SET_EXTERNAL (symbolP);
#endif
}
#endif
{
allocate_common:
- S_SET_VALUE (symbolP, size);
+ S_SET_VALUE (symbolP, (valueT) size);
S_SET_EXTERNAL (symbolP);
/* should be common, but this is how gas does it for now */
S_SET_SEGMENT (symbolP, &bfd_und_section);
}
static void
-s_seg ()
+s_seg (ignore)
+ int ignore;
{
if (strncmp (input_line_pointer, "\"text\"", 6) == 0)
{
input_line_pointer += 6;
- s_text ();
+ s_text (0);
return;
}
if (strncmp (input_line_pointer, "\"data\"", 6) == 0)
{
input_line_pointer += 6;
- s_data ();
+ s_data (0);
return;
}
if (strncmp (input_line_pointer, "\"data1\"", 7) == 0)
} /* s_data1() */
static void
-s_proc ()
+s_proc (ignore)
+ int ignore;
{
while (!is_end_of_line[(unsigned char) *input_line_pointer])
{
/* start-sanitize-v9 */
#ifndef NO_V9
-static void
-s_xword ()
-{
- SKIP_WHITESPACE ();
- if (isdigit (*input_line_pointer))
- big_cons (8);
- else
- cons (8);
-}
struct priv_reg_entry
{
struct membar_masks
{
char *name;
- int len;
- int mask;
+ unsigned int len;
+ unsigned int mask;
};
#define MEMBAR_MASKS_SIZE 7
void
md_begin ()
{
- register char *retval = NULL;
+ register const char *retval = NULL;
int lose = 0;
register unsigned int i = 0;
{
const char *name = sparc_opcodes[i].name;
retval = hash_insert (op_hash, name, &sparc_opcodes[i]);
- if (retval != NULL && *retval != '\0')
+ if (retval != NULL)
{
fprintf (stderr, "internal error: can't hash `%s': %s\n",
sparc_opcodes[i].name, retval);
#ifndef NO_V9
case 'K':
{
- int mask = 0;
+ int kmask = 0;
int i;
/* Parse a series of masks. */
break;
if (i < MEMBAR_MASKS_SIZE)
{
- mask |= membar_masks[i].mask;
+ kmask |= membar_masks[i].mask;
s += membar_masks[i].len;
}
else
{
while (isdigit (*s))
{
- mask = mask * 10 + *s - '0';
+ kmask = kmask * 10 + *s - '0';
++s;
}
- if (mask < 0 || mask > 127)
+ if (kmask < 0 || kmask > 127)
{
error_message = ": invalid membar mask number";
goto error;
error_message = ": unrecognizable membar mask";
goto error;
}
- opcode |= SIMM13 (mask);
+ opcode |= SIMM13 (kmask);
continue;
}
if (*s == '%')
{
struct priv_reg_entry *p = priv_reg_table;
- int len = 9999999; /* init to make gcc happy */
+ unsigned int len = 9999999; /* init to make gcc happy */
s += 1;
while (p->name[0] > s[0])
fixP->fx_addnumber = val; /* Remember value for emit_reloc */
+#ifdef OBJ_ELF
+ /* FIXME: SPARC ELF relocations don't use an addend in the data
+ field itself. This whole approach should be somehow combined
+ with the calls to bfd_perform_relocation. */
+ if (fixP->fx_addsy != NULL)
+ return 1;
+#endif
+
/*
* This is a hack. There should be a better way to
* handle this.
#ifdef OBJ_ELF
else if (**argP == 'V')
{
- extern void print_version_id ();
print_version_id ();
}
else if (**argP == 'Q')
/* use .stab instead of .stab.excl */
}
#endif
+ else if (strcmp (*argP, "sparc") == 0)
+ {
+ /* Ignore -sparc, used by SunOS make default .s.o rule. */
+ }
else
{
/* Unknown option */
{
#ifdef OBJ_AOUT
/* Round all sects to multiple of 8 */
- size = (size + 7) & ~7;
+ size = (size + 7) & (valueT) ~7;
#endif
return size;
}