aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2014-07-26 21:00:50 +0930
committerAlan Modra <amodra@gmail.com>2014-07-26 21:00:50 +0930
commite57e6ddc2e768323732a7eed6a5d25d3ee350638 (patch)
tree0f7a4d490a72412262207a614d426f548ce8e75e /gas
parentcd9ac21580fa2e2068388d86349b8deb85eafce8 (diff)
downloadgdb-e57e6ddc2e768323732a7eed6a5d25d3ee350638.zip
gdb-e57e6ddc2e768323732a7eed6a5d25d3ee350638.tar.gz
gdb-e57e6ddc2e768323732a7eed6a5d25d3ee350638.tar.bz2
Prepare gas for 64-bit obstacks
Use size_t in a few places involved with obstacks, and don't include obstack.h in files that don't use obstacks. gas/ * config/bfin-parse.y: Don't include obstack.h. * config/obj-aout.c: Likewise. * config/obj-coff.c: Likewise. * config/obj-som.c: Likewise. * config/tc-bfin.c: Likewise. * config/tc-i960.c: Likewise. * config/tc-rl78.c: Likewise. * config/tc-rx.c: Likewise. * config/tc-tic4x.c: Likewise. * expr.c: Likewise. * listing.c: Likewise. * config/obj-elf.c (elf_file_symbol): Make name_length a size_t. * config/tc-aarch64.c (symbol_locate): Likewise. * config/tc-arm.c (symbol_locate): Likewise. * config/tc-mmix.c (mmix_handle_mmixal): Make len_0 a size_t. * config/tc-score.c (s3_build_score_ops_hsh): Make len a size_t. (s3_build_dependency_insn_hsh): Likewise. * config/tc-score7.c (s7_build_score_ops_hsh): Likewise. (s7_build_dependency_insn_hsh): Likewise. * frags.c (frag_grow): Make parameter a size_t, and use size_t locals. (frag_new): Make parameter a size_t. (frag_var_init): Make max_chars and var parameters size_t. (frag_var, frag_variant): Likewise. (frag_room): Return a size_t. (frag_align_pattern): Make n_fill parameter a size_t. * frags.h: Update function prototypes. * symbols.c (save_symbol_name): Make name_length a size_t.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog30
-rw-r--r--gas/config/bfin-parse.y1
-rw-r--r--gas/config/obj-aout.c1
-rw-r--r--gas/config/obj-coff.c1
-rw-r--r--gas/config/obj-elf.c2
-rw-r--r--gas/config/obj-som.c1
-rw-r--r--gas/config/tc-aarch64.c2
-rw-r--r--gas/config/tc-arm.c2
-rw-r--r--gas/config/tc-bfin.c2
-rw-r--r--gas/config/tc-i960.c1
-rw-r--r--gas/config/tc-mmix.c2
-rw-r--r--gas/config/tc-rl78.c1
-rw-r--r--gas/config/tc-rx.c1
-rw-r--r--gas/config/tc-score.c4
-rw-r--r--gas/config/tc-score7.c4
-rw-r--r--gas/config/tc-tic4x.c1
-rw-r--r--gas/expr.c1
-rw-r--r--gas/frags.c29
-rw-r--r--gas/frags.h18
-rw-r--r--gas/listing.c1
-rw-r--r--gas/symbols.c2
21 files changed, 64 insertions, 43 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 28b1fa5..1861e37 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,33 @@
+2014-07-26 Alan Modra <amodra@gmail.com>
+
+ * config/bfin-parse.y: Don't include obstack.h.
+ * config/obj-aout.c: Likewise.
+ * config/obj-coff.c: Likewise.
+ * config/obj-som.c: Likewise.
+ * config/tc-bfin.c: Likewise.
+ * config/tc-i960.c: Likewise.
+ * config/tc-rl78.c: Likewise.
+ * config/tc-rx.c: Likewise.
+ * config/tc-tic4x.c: Likewise.
+ * expr.c: Likewise.
+ * listing.c: Likewise.
+ * config/obj-elf.c (elf_file_symbol): Make name_length a size_t.
+ * config/tc-aarch64.c (symbol_locate): Likewise.
+ * config/tc-arm.c (symbol_locate): Likewise.
+ * config/tc-mmix.c (mmix_handle_mmixal): Make len_0 a size_t.
+ * config/tc-score.c (s3_build_score_ops_hsh): Make len a size_t.
+ (s3_build_dependency_insn_hsh): Likewise.
+ * config/tc-score7.c (s7_build_score_ops_hsh): Likewise.
+ (s7_build_dependency_insn_hsh): Likewise.
+ * frags.c (frag_grow): Make parameter a size_t, and use size_t locals.
+ (frag_new): Make parameter a size_t.
+ (frag_var_init): Make max_chars and var parameters size_t.
+ (frag_var, frag_variant): Likewise.
+ (frag_room): Return a size_t.
+ (frag_align_pattern): Make n_fill parameter a size_t.
+ * frags.h: Update function prototypes.
+ * symbols.c (save_symbol_name): Make name_length a size_t.
+
2014-07-22 Sergey Guriev <sergey.s.guriev@intel.com>
Alexander Ivchenko <alexander.ivchenko@intel.com>
Maxim Kuznetsov <maxim.kuznetsov@intel.com>
diff --git a/gas/config/bfin-parse.y b/gas/config/bfin-parse.y
index fe742ad..435beea 100644
--- a/gas/config/bfin-parse.y
+++ b/gas/config/bfin-parse.y
@@ -20,7 +20,6 @@
%{
#include "as.h"
-#include <obstack.h>
#include "bfin-aux.h" /* Opcode generating auxiliaries. */
#include "libbfd.h"
diff --git a/gas/config/obj-aout.c b/gas/config/obj-aout.c
index 28369c0..93ea904 100644
--- a/gas/config/obj-aout.c
+++ b/gas/config/obj-aout.c
@@ -23,7 +23,6 @@
#include "as.h"
#undef NO_RELOC
#include "aout/aout64.h"
-#include "obstack.h"
void
obj_aout_frob_symbol (symbolS *sym, int *punt ATTRIBUTE_UNUSED)
diff --git a/gas/config/obj-coff.c b/gas/config/obj-coff.c
index 79c8f88..4e7b9b7 100644
--- a/gas/config/obj-coff.c
+++ b/gas/config/obj-coff.c
@@ -22,7 +22,6 @@
#include "as.h"
#include "safe-ctype.h"
-#include "obstack.h"
#include "subsegs.h"
#include "struc-symbol.h"
diff --git a/gas/config/obj-elf.c b/gas/config/obj-elf.c
index e59f27b..e2ef99e 100644
--- a/gas/config/obj-elf.c
+++ b/gas/config/obj-elf.c
@@ -266,7 +266,7 @@ elf_file_symbol (const char *s, int appfile)
|| (symbol_rootP->bsym->flags & BSF_FILE) == 0)
{
symbolS *sym;
- unsigned int name_length;
+ size_t name_length;
sym = symbol_new (s, absolute_section, 0, NULL);
symbol_set_frag (sym, &zero_address_frag);
diff --git a/gas/config/obj-som.c b/gas/config/obj-som.c
index 47acab8..55a9b6a 100644
--- a/gas/config/obj-som.c
+++ b/gas/config/obj-som.c
@@ -24,7 +24,6 @@
#include "as.h"
#include "subsegs.h"
#include "aout/stab_gnu.h"
-#include "obstack.h"
static int version_seen = 0;
static int copyright_seen = 0;
diff --git a/gas/config/tc-aarch64.c b/gas/config/tc-aarch64.c
index c7ace79..0a65b9d 100644
--- a/gas/config/tc-aarch64.c
+++ b/gas/config/tc-aarch64.c
@@ -1681,7 +1681,7 @@ symbol_locate (symbolS * symbolP,
valueT valu, /* Symbol value. */
fragS * frag) /* Associated fragment. */
{
- unsigned int name_length;
+ size_t name_length;
char *preserved_copy_of_name;
name_length = strlen (name) + 1; /* +1 for \0. */
diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
index 7fb8b23..7dc0e7e 100644
--- a/gas/config/tc-arm.c
+++ b/gas/config/tc-arm.c
@@ -3379,7 +3379,7 @@ symbol_locate (symbolS * symbolP,
valueT valu, /* Symbol value. */
fragS * frag) /* Associated fragment. */
{
- unsigned int name_length;
+ size_t name_length;
char * preserved_copy_of_name;
name_length = strlen (name) + 1; /* +1 for \0. */
diff --git a/gas/config/tc-bfin.c b/gas/config/tc-bfin.c
index 8366cbf..447a477 100644
--- a/gas/config/tc-bfin.c
+++ b/gas/config/tc-bfin.c
@@ -948,7 +948,7 @@ int ninsns;
int count_insns;
static void *
-allocate (int n)
+allocate (size_t n)
{
return obstack_alloc (&mempool, n);
}
diff --git a/gas/config/tc-i960.c b/gas/config/tc-i960.c
index 7595e1d..91469eb 100644
--- a/gas/config/tc-i960.c
+++ b/gas/config/tc-i960.c
@@ -64,7 +64,6 @@
#include "as.h"
#include "safe-ctype.h"
-#include "obstack.h"
#include "opcode/i960.h"
diff --git a/gas/config/tc-mmix.c b/gas/config/tc-mmix.c
index 7740ee2..82f48ae 100644
--- a/gas/config/tc-mmix.c
+++ b/gas/config/tc-mmix.c
@@ -3007,7 +3007,7 @@ mmix_handle_mmixal (void)
it the same alignment and address as the associated instruction. */
/* Make room for the label including the ending nul. */
- int len_0 = s - label + 1;
+ size_t len_0 = s - label + 1;
/* Save this label on the MMIX symbol obstack. Saving it on an
obstack is needless for "IS"-pseudos, but it's harmless and we
diff --git a/gas/config/tc-rl78.c b/gas/config/tc-rl78.c
index 0cd7e5b..f2382b7 100644
--- a/gas/config/tc-rl78.c
+++ b/gas/config/tc-rl78.c
@@ -20,7 +20,6 @@
#include "as.h"
#include "struc-symbol.h"
-#include "obstack.h"
#include "safe-ctype.h"
#include "dwarf2dbg.h"
#include "libbfd.h"
diff --git a/gas/config/tc-rx.c b/gas/config/tc-rx.c
index c4842f9..0d7e1d5 100644
--- a/gas/config/tc-rx.c
+++ b/gas/config/tc-rx.c
@@ -20,7 +20,6 @@
#include "as.h"
#include "struc-symbol.h"
-#include "obstack.h"
#include "safe-ctype.h"
#include "dwarf2dbg.h"
#include "libbfd.h"
diff --git a/gas/config/tc-score.c b/gas/config/tc-score.c
index e8c8b6d..72597a0 100644
--- a/gas/config/tc-score.c
+++ b/gas/config/tc-score.c
@@ -6315,7 +6315,7 @@ s3_build_score_ops_hsh (void)
for (i = 0; i < sizeof (s3_score_insns) / sizeof (struct s3_asm_opcode); i++)
{
const struct s3_asm_opcode *insn = s3_score_insns + i;
- unsigned len = strlen (insn->template_name);
+ size_t len = strlen (insn->template_name);
struct s3_asm_opcode *new_opcode;
char *template_name;
new_opcode = (struct s3_asm_opcode *)
@@ -6344,7 +6344,7 @@ s3_build_dependency_insn_hsh (void)
for (i = 0; i < sizeof (s3_insn_to_dependency_table) / sizeof (s3_insn_to_dependency_table[0]); i++)
{
const struct s3_insn_to_dependency *tmp = s3_insn_to_dependency_table + i;
- unsigned len = strlen (tmp->insn_name);
+ size_t len = strlen (tmp->insn_name);
struct s3_insn_to_dependency *new_i2n;
new_i2n = (struct s3_insn_to_dependency *)
diff --git a/gas/config/tc-score7.c b/gas/config/tc-score7.c
index 7bf0ad6..ae15a04 100644
--- a/gas/config/tc-score7.c
+++ b/gas/config/tc-score7.c
@@ -5090,7 +5090,7 @@ s7_build_score_ops_hsh (void)
for (i = 0; i < sizeof (s7_score_insns) / sizeof (struct s7_asm_opcode); i++)
{
const struct s7_asm_opcode *insn = s7_score_insns + i;
- unsigned len = strlen (insn->template_name);
+ size_t len = strlen (insn->template_name);
struct s7_asm_opcode *new_opcode;
char *template_name;
new_opcode = (struct s7_asm_opcode *)
@@ -5119,7 +5119,7 @@ s7_build_dependency_insn_hsh (void)
for (i = 0; i < ARRAY_SIZE (s7_insn_to_dependency_table); i++)
{
const struct s7_insn_to_dependency *tmp = s7_insn_to_dependency_table + i;
- unsigned len = strlen (tmp->insn_name);
+ size_t len = strlen (tmp->insn_name);
struct s7_insn_to_dependency *new_i2d;
new_i2d = (struct s7_insn_to_dependency *)
diff --git a/gas/config/tc-tic4x.c b/gas/config/tc-tic4x.c
index 7559ad5..904a68c 100644
--- a/gas/config/tc-tic4x.c
+++ b/gas/config/tc-tic4x.c
@@ -43,7 +43,6 @@
#include "safe-ctype.h"
#include "opcode/tic4x.h"
#include "subsegs.h"
-#include "obstack.h"
/* OK, we accept a syntax similar to the other well known C30
assembly tools. With TIC4X_ALT_SYNTAX defined we are more
diff --git a/gas/expr.c b/gas/expr.c
index b39c70d..eb7255f 100644
--- a/gas/expr.c
+++ b/gas/expr.c
@@ -27,7 +27,6 @@
#include "as.h"
#include "safe-ctype.h"
-#include "obstack.h"
#ifdef HAVE_LIMITS_H
#include <limits.h>
diff --git a/gas/frags.c b/gas/frags.c
index e14099d..defa853 100644
--- a/gas/frags.c
+++ b/gas/frags.c
@@ -94,12 +94,12 @@ frag_alloc (struct obstack *ob)
do not return. Do not set up any fields of *now_frag. */
void
-frag_grow (unsigned int nchars)
+frag_grow (size_t nchars)
{
if (obstack_room (&frchain_now->frch_obstack) < nchars)
{
- long oldc;
- long newc;
+ size_t oldc;
+ size_t newc;
/* Try to allocate a bit more than needed right now. But don't do
this if we would waste too much memory. Especially necessary
@@ -111,8 +111,8 @@ frag_grow (unsigned int nchars)
newc += SIZEOF_STRUCT_FRAG;
/* Check for possible overflow. */
- if (newc < 0)
- as_fatal (_("can't extend frag %u chars"), nchars);
+ if (newc < nchars)
+ as_fatal (_("can't extend frag %lu chars"), (unsigned long) nchars);
/* Force to allocate at least NEWC bytes, but not less than the
default. */
@@ -152,7 +152,7 @@ frag_grow (unsigned int nchars)
of frchain_now. */
void
-frag_new (int old_frags_var_max_size
+frag_new (size_t old_frags_var_max_size
/* Number of chars (already allocated on obstack frags) in
variable_length part of frag. */)
{
@@ -204,7 +204,7 @@ frag_new (int old_frags_var_max_size
frag_now_growth past the new chars. */
char *
-frag_more (int nchars)
+frag_more (size_t nchars)
{
register char *retval;
@@ -219,8 +219,8 @@ frag_more (int nchars)
new frag. */
static void
-frag_var_init (relax_stateT type, int max_chars, int var,
- relax_substateT subtype, symbolS *symbol, offsetT offset,
+frag_var_init (relax_stateT type, size_t max_chars, size_t var,
+ relax_substateT subtype, symbolS *symbol, offsetT offset,
char *opcode)
{
frag_now->fr_var = var;
@@ -250,8 +250,9 @@ frag_var_init (relax_stateT type, int max_chars, int var,
to write into. */
char *
-frag_var (relax_stateT type, int max_chars, int var, relax_substateT subtype,
- symbolS *symbol, offsetT offset, char *opcode)
+frag_var (relax_stateT type, size_t max_chars, size_t var,
+ relax_substateT subtype, symbolS *symbol, offsetT offset,
+ char *opcode)
{
register char *retval;
@@ -267,7 +268,7 @@ frag_var (relax_stateT type, int max_chars, int var, relax_substateT subtype,
No call to frag_grow is done. */
char *
-frag_variant (relax_stateT type, int max_chars, int var,
+frag_variant (relax_stateT type, size_t max_chars, size_t var,
relax_substateT subtype, symbolS *symbol, offsetT offset,
char *opcode)
{
@@ -291,7 +292,7 @@ frag_wane (register fragS *fragP)
/* Return the number of bytes by which the current frag can be grown. */
-int
+size_t
frag_room (void)
{
return obstack_room (&frchain_now->frch_obstack);
@@ -336,7 +337,7 @@ frag_align (int alignment, int fill_character, int max)
void
frag_align_pattern (int alignment, const char *fill_pattern,
- int n_fill, int max)
+ size_t n_fill, int max)
{
char *p;
diff --git a/gas/frags.h b/gas/frags.h
index 2f9e1b5..bdc3c9d 100644
--- a/gas/frags.h
+++ b/gas/frags.h
@@ -127,27 +127,27 @@ extern void frag_append_1_char (int);
void frag_init (void);
fragS *frag_alloc (struct obstack *);
-void frag_grow (unsigned int nchars);
-char *frag_more (int nchars);
+void frag_grow (size_t nchars);
+char *frag_more (size_t nchars);
void frag_align (int alignment, int fill_character, int max);
void frag_align_pattern (int alignment, const char *fill_pattern,
- int n_fill, int max);
+ size_t n_fill, int max);
void frag_align_code (int alignment, int max);
-void frag_new (int old_frags_var_max_size);
+void frag_new (size_t old_frags_var_max_size);
void frag_wane (fragS * fragP);
-int frag_room (void);
+size_t frag_room (void);
char *frag_variant (relax_stateT type,
- int max_chars,
- int var,
+ size_t max_chars,
+ size_t var,
relax_substateT subtype,
symbolS * symbol,
offsetT offset,
char *opcode);
char *frag_var (relax_stateT type,
- int max_chars,
- int var,
+ size_t max_chars,
+ size_t var,
relax_substateT subtype,
symbolS * symbol,
offsetT offset,
diff --git a/gas/listing.c b/gas/listing.c
index 0192dd0..57425fe 100644
--- a/gas/listing.c
+++ b/gas/listing.c
@@ -89,7 +89,6 @@
#include "as.h"
#include "filenames.h"
-#include "obstack.h"
#include "safe-ctype.h"
#include "input-file.h"
#include "subsegs.h"
diff --git a/gas/symbols.c b/gas/symbols.c
index 9da0468..6af8604 100644
--- a/gas/symbols.c
+++ b/gas/symbols.c
@@ -104,7 +104,7 @@ symbol_new (const char *name, segT segment, valueT valu, fragS *frag)
static char *
save_symbol_name (const char *name)
{
- unsigned int name_length;
+ size_t name_length;
char *ret;
name_length = strlen (name) + 1; /* +1 for \0. */