aboutsummaryrefslogtreecommitdiff
path: root/gas/config
diff options
context:
space:
mode:
Diffstat (limited to 'gas/config')
-rw-r--r--gas/config/obj-ecoff.c45
-rw-r--r--gas/config/obj-elf.c6
-rw-r--r--gas/config/obj-elf.h3
-rw-r--r--gas/config/tc-i386.c5
-rw-r--r--gas/config/tc-mips.c16
-rw-r--r--gas/config/tc-sparc.c66
6 files changed, 63 insertions, 78 deletions
diff --git a/gas/config/obj-ecoff.c b/gas/config/obj-ecoff.c
index edee4e4..0006c2d 100644
--- a/gas/config/obj-ecoff.c
+++ b/gas/config/obj-ecoff.c
@@ -27,6 +27,7 @@
#include "coff/symconst.h"
#include "coff/ecoff.h"
#include "aout/stab_gnu.h"
+#include "../bfd/libcoff.h"
#include "../bfd/libecoff.h"
#include <ctype.h>
@@ -1624,7 +1625,7 @@ add_string (vp, hash_tbl, str, ret_hash)
const char *str; /* string */
shash_t **ret_hash; /* return hash pointer */
{
- register unsigned int len = strlen (str);
+ register unsigned long len = strlen (str);
register shash_t *hash_ptr;
if (len >= PAGE_USIZE)
@@ -1813,20 +1814,20 @@ add_ecoff_symbol (str, type, storage, sym_value, value, indx)
Also, tie the external pointer back to the function begin symbol. */
if (begin_type != st_File && begin_type != st_Block)
{
- symint_t type;
- varray_t *vp = &cur_file_ptr->aux_syms;
+ symint_t ty;
+ varray_t *svp = &cur_file_ptr->aux_syms;
pscope->lsym->ecoff_sym.index = add_aux_sym_symint (0);
pscope->lsym->index_ptr =
- &vp->last->datum->aux[vp->objects_last_page - 1];
- type = add_aux_sym_tir (&last_func_type_info,
- hash_no,
- &cur_file_ptr->thash_head[0]);
+ &svp->last->datum->aux[svp->objects_last_page - 1];
+ ty = add_aux_sym_tir (&last_func_type_info,
+ hash_no,
+ &cur_file_ptr->thash_head[0]);
/*
if (last_func_sym_value != (symbolS *) NULL)
{
last_func_sym_value->ifd = cur_file_ptr->file_index;
- last_func_sym_value->index = type;
+ last_func_sym_value->index = ty;
}
*/
}
@@ -2521,7 +2522,7 @@ obj_ecoff_bend (ignore)
static char *coff_sym_name;
static type_info_t coff_type;
static sc_t coff_storage_class;
-static st_t coff_symbol_type;
+static st_t coff_symbol_typ;
static int coff_is_function;
static char *coff_tag;
static long coff_value; /* FIXME: Might be 64 bits. */
@@ -2556,7 +2557,7 @@ obj_ecoff_def (ignore)
strcpy (coff_sym_name, name);
coff_type = type_info_init;
coff_storage_class = sc_Nil;
- coff_symbol_type = st_Nil;
+ coff_symbol_typ = st_Nil;
coff_is_function = 0;
coff_tag = (char *) NULL;
coff_value = 0;
@@ -2638,7 +2639,7 @@ obj_ecoff_scl (ignore)
val = get_absolute_expression ();
- coff_symbol_type = map_coff_sym_type[val];
+ coff_symbol_typ = map_coff_sym_type[val];
coff_storage_class = map_coff_storage[val];
demand_empty_rest_of_line ();
@@ -2855,7 +2856,7 @@ obj_ecoff_endef (ignore)
that are not in COFF, such as short data, etc. */
if (coff_sym_value != (symbolS *) NULL)
{
- coff_symbol_type = st_Nil;
+ coff_symbol_typ = st_Nil;
coff_storage_class = sc_Nil;
}
@@ -2893,7 +2894,7 @@ obj_ecoff_endef (ignore)
/ coff_type.dimensions[i + 1]);
}
}
- else if (coff_symbol_type == st_Member
+ else if (coff_symbol_typ == st_Member
&& coff_type.num_sizes - coff_type.extra_sizes == 1)
{
/* Is this a bitfield? This is indicated by a structure memeber
@@ -2903,7 +2904,7 @@ obj_ecoff_endef (ignore)
/* Except for enumeration members & begin/ending of scopes, put the
type word in the aux. symbol table. */
- if (coff_symbol_type == st_Block || coff_symbol_type == st_End)
+ if (coff_symbol_typ == st_Block || coff_symbol_typ == st_End)
indx = 0;
else if (coff_inside_enumeration)
indx = cur_file_ptr->void_type;
@@ -2936,7 +2937,7 @@ obj_ecoff_endef (ignore)
}
/* Do any last minute adjustments that are necessary. */
- switch (coff_symbol_type)
+ switch (coff_symbol_typ)
{
default:
break;
@@ -2980,14 +2981,14 @@ obj_ecoff_endef (ignore)
/* Add the symbol. */
sym = add_ecoff_symbol (name,
- coff_symbol_type,
+ coff_symbol_typ,
coff_storage_class,
coff_sym_value,
coff_value,
indx);
/* deal with struct, union, and enum tags. */
- if (coff_symbol_type == st_Block)
+ if (coff_symbol_typ == st_Block)
{
/* Create or update the tag information. */
tag_t *tag_ptr = get_tag (name,
@@ -3432,7 +3433,7 @@ obj_ecoff_stab (type)
dummy_symr.index = code;
if (dummy_symr.index != code)
{
- as_warn ("Line number (%d) for .stab%c directive cannot fit in index field (20 bits)",
+ as_warn ("Line number (%lu) for .stab%c directive cannot fit in index field (20 bits)",
code, type);
demand_empty_rest_of_line ();
return;
@@ -4165,16 +4166,16 @@ ecoff_build_procs (buf, bufend, offset)
proc_link != (vlinks_t *) NULL;
proc_link = proc_link->next)
{
- int proc_cnt;
+ int prc_cnt;
proc_t *proc_ptr;
proc_t *proc_end;
if (proc_link->next == (vlinks_t *) NULL)
- proc_cnt = fil_ptr->procs.objects_last_page;
+ prc_cnt = fil_ptr->procs.objects_last_page;
else
- proc_cnt = fil_ptr->procs.objects_per_page;
+ prc_cnt = fil_ptr->procs.objects_per_page;
proc_ptr = proc_link->datum->proc;
- proc_end = proc_ptr + proc_cnt;
+ proc_end = proc_ptr + prc_cnt;
for (; proc_ptr < proc_end; proc_ptr++)
{
symbolS *adr_sym;
diff --git a/gas/config/obj-elf.c b/gas/config/obj-elf.c
index 1f5d66f..5ccf21d 100644
--- a/gas/config/obj-elf.c
+++ b/gas/config/obj-elf.c
@@ -156,7 +156,7 @@ obj_elf_common ()
char *p;
int align;
- allocate_bss:
+ /* allocate_bss: */
old_sec = now_seg;
old_subsec = now_subseg;
align = temp;
@@ -358,7 +358,7 @@ obj_elf_section (xxx)
#undef CHECK
p = input_line_pointer;
- while (!is_end_of_line[*p] && *p != 0 && *p != ',')
+ while (!is_end_of_line[(unsigned char) *p] && *p != 0 && *p != ',')
p++;
*p = 0;
oldp = *p;
@@ -470,6 +470,8 @@ obj_elf_frob_symbol (sym, punt)
relevant. */
return obj_elf_write_symbol_p (sym);
#endif
+ /* FIXME: Just return 0 until is fixed. */
+ return 0;
}
static void
diff --git a/gas/config/obj-elf.h b/gas/config/obj-elf.h
index 70f8f4e..4775a76 100644
--- a/gas/config/obj-elf.h
+++ b/gas/config/obj-elf.h
@@ -50,7 +50,8 @@
#define S_GET_TYPE(S) (elf_symbol((S)->bsym)->type)
#define S_GET_DESC(S) (elf_symbol((S)->bsym)->desc)
-#define S_SET_SIZE(S,V) (elf_symbol((S)->bsym)->internal_elf_sym.st_size)
+#define S_SET_SIZE(S,V) \
+ (elf_symbol((S)->bsym)->internal_elf_sym.st_size = (V))
extern asection *gdb_section;
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index c77d2cb..f1d92ef 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -316,6 +316,9 @@ const pseudo_typeS md_pseudo_table[] =
{"value", cons, 2},
{"noopt", s_ignore, 0},
{"optim", s_ignore, 0},
+#ifdef OBJ_ELF
+ {"zero", s_space, 0},
+#endif
{0, 0, 0}
};
@@ -2384,7 +2387,7 @@ parse_register (reg_string)
s++; /* skip REGISTER_PREFIX */
for (p = reg_name_given; is_register_char (*s); p++, s++)
{
- *p = register_chars[*s];
+ *p = register_chars[(unsigned char) *s];
if (p >= reg_name_given + MAX_REG_NAME_SIZE)
return (reg_entry *) 0;
}
diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c
index 2ba8fbb..9bf0dcc 100644
--- a/gas/config/tc-mips.c
+++ b/gas/config/tc-mips.c
@@ -2943,8 +2943,8 @@ mips_ip (str, ip)
check_absolute_expr (ip, &imm_expr);
if ((unsigned long) imm_expr.X_add_number > 31)
{
- as_warn ("Improper shift amount (%d)",
- imm_expr.X_add_number);
+ as_warn ("Improper shift amount (%ld)",
+ (long) imm_expr.X_add_number);
imm_expr.X_add_number = imm_expr.X_add_number % 32;
}
ip->insn_opcode |= imm_expr.X_add_number << 6;
@@ -2956,7 +2956,8 @@ mips_ip (str, ip)
my_getExpression (&imm_expr, s);
check_absolute_expr (ip, &imm_expr);
if ((unsigned) imm_expr.X_add_number > 1023)
- as_warn ("Illegal break code (%d)", imm_expr.X_add_number);
+ as_warn ("Illegal break code (%ld)",
+ (long) imm_expr.X_add_number);
ip->insn_opcode |= imm_expr.X_add_number << 16;
imm_expr.X_op = O_absent;
s = expr_end;
@@ -2966,7 +2967,8 @@ mips_ip (str, ip)
my_getExpression (&imm_expr, s);
check_absolute_expr (ip, &imm_expr);
if ((unsigned) imm_expr.X_add_number > 0xfffff)
- as_warn ("Illegal syscall code (%d)", imm_expr.X_add_number);
+ as_warn ("Illegal syscall code (%ld)",
+ (long) imm_expr.X_add_number);
ip->insn_opcode |= imm_expr.X_add_number << 6;
imm_expr.X_op = O_absent;
s = expr_end;
@@ -2977,8 +2979,8 @@ mips_ip (str, ip)
check_absolute_expr (ip, &imm_expr);
if ((unsigned long) imm_expr.X_add_number >= (1<<25))
{
- as_warn ("Coproccesor code > 25 bits (%d)",
- imm_expr.X_add_number);
+ as_warn ("Coproccesor code > 25 bits (%ld)",
+ (long) imm_expr.X_add_number);
imm_expr.X_add_number &= ((1<<25) - 1);
}
ip->insn_opcode |= imm_expr.X_add_number;
@@ -3811,7 +3813,7 @@ md_apply_fix (fixP, valueP)
* the current segment).
*/
if (value & 0x3)
- as_warn ("Branch to odd address (%x)", value);
+ as_warn ("Branch to odd address (%lx)", value);
value >>= 2;
if ((value & ~0xFFFF) && (value & ~0xFFFF) != (-1 & ~0xFFFF))
as_bad ("Relocation overflow");
diff --git a/gas/config/tc-sparc.c b/gas/config/tc-sparc.c
index eb983db..7a29f46 100644
--- a/gas/config/tc-sparc.c
+++ b/gas/config/tc-sparc.c
@@ -95,7 +95,6 @@ const pseudo_typeS md_pseudo_table[] =
#endif
/* end-sanitize-v9 */
#ifdef OBJ_ELF
- {"local", s_local, 0},
/* these are specific to sparc/svr4 */
{"pushsection", obj_elf_section, 0},
{"popsection", obj_elf_previous, 0},
@@ -139,7 +138,7 @@ const char FLT_CHARS[] = "rRsSfFdDxXpP";
*/
static unsigned char octal[256];
-#define isoctal(c) octal[c]
+#define isoctal(c) octal[(unsigned char) (c)]
static unsigned char toHex[256];
struct sparc_it
@@ -177,7 +176,9 @@ static int special_case;
* sort of like s_lcomm
*
*/
+#ifndef OBJ_ELF
static int max_alignment = 15;
+#endif
static void
s_reserve ()
@@ -241,12 +242,14 @@ s_reserve ()
}
align = get_absolute_expression ();
+#ifndef OBJ_ELF
if (align > max_alignment)
{
align = max_alignment;
as_warn ("Alignment too large: %d. assumed.", align);
}
- else if (align < 0)
+#endif
+ if (align < 0)
{
align = 0;
as_warn ("Alignment negative. 0 assumed.");
@@ -310,37 +313,6 @@ s_reserve ()
demand_empty_rest_of_line ();
}
-#ifdef OBJ_ELF
-/* Currently used only by Solaris 2. */
-void
-s_local ()
-{
- char *name;
- int c;
- symbolS *symbolP;
-
- do
- {
- name = input_line_pointer;
- c = get_symbol_end ();
- symbolP = symbol_find_or_make (name);
- *input_line_pointer = c;
- SKIP_WHITESPACE ();
- S_CLEAR_EXTERNAL (symbolP);
- symbolP->local = 1;
- if (c == ',')
- {
- input_line_pointer++;
- SKIP_WHITESPACE ();
- if (*input_line_pointer == '\n')
- c = '\n';
- }
- }
- while (c == ',');
- demand_empty_rest_of_line ();
-}
-#endif
-
static void
s_common ()
{
@@ -406,12 +378,14 @@ s_common ()
if (*input_line_pointer != '"')
{
temp = get_absolute_expression ();
+#ifndef OBJ_ELF
if (temp > max_alignment)
{
temp = max_alignment;
as_warn ("Common alignment too large: %d. assumed", temp);
}
- else if (temp < 0)
+#endif
+ if (temp < 0)
{
temp = 0;
as_warn ("Common alignment negative; 0 assumed");
@@ -536,9 +510,7 @@ s_data1 ()
static void
s_proc ()
{
- extern char is_end_of_line[];
-
- while (!is_end_of_line[*input_line_pointer])
+ while (!is_end_of_line[(unsigned char) *input_line_pointer])
{
++input_line_pointer;
}
@@ -1793,13 +1765,11 @@ getExpression (str)
save_in = input_line_pointer;
input_line_pointer = str;
seg = expression (&the_insn.exp);
- if (seg == absolute_section
- || seg == text_section
- || seg == data_section
- || seg == bss_section
- || seg == undefined_section)
- /* ok */;
- else
+ if (seg != absolute_section
+ && seg != text_section
+ && seg != data_section
+ && seg != bss_section
+ && seg != undefined_section)
{
the_insn.error = "bad segment";
expr_end = input_line_pointer;
@@ -1958,6 +1928,11 @@ md_apply_fix (fixP, value)
switch (fixP->fx_r_type)
{
+ case BFD_RELOC_16:
+ buf[0] = val >> 8;
+ buf[1] = val;
+ break;
+
case BFD_RELOC_32:
buf[0] = val >> 24;
buf[1] = val >> 16;
@@ -2172,6 +2147,7 @@ tc_gen_reloc (section, fixp)
switch (fixp->fx_r_type)
{
+ case BFD_RELOC_16:
case BFD_RELOC_32:
case BFD_RELOC_HI22:
case BFD_RELOC_LO10: