aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gas/macro.c6
-rw-r--r--gas/macro.h1
-rw-r--r--gas/output-file.c5
-rw-r--r--gas/read.c13
-rw-r--r--gas/read.h1
-rw-r--r--gas/symbols.c6
-rw-r--r--gas/symbols.h1
7 files changed, 33 insertions, 0 deletions
diff --git a/gas/macro.c b/gas/macro.c
index b360b2e..e2cfbee 100644
--- a/gas/macro.c
+++ b/gas/macro.c
@@ -84,6 +84,12 @@ macro_init (int alternate, int mri, int strip_at,
macro_expr = exp;
}
+void
+macro_end (void)
+{
+ htab_delete (macro_hash);
+}
+
/* Switch in and out of alternate mode on the fly. */
void
diff --git a/gas/macro.h b/gas/macro.h
index 227c9cb..03d6a81 100644
--- a/gas/macro.h
+++ b/gas/macro.h
@@ -85,6 +85,7 @@ extern int buffer_and_nest (const char *, const char *, sb *,
size_t (*) (sb *));
extern void macro_init (int, int, int,
size_t (*) (const char *, size_t, sb *, offsetT *));
+extern void macro_end (void);
extern void macro_set_alternate (int);
extern void macro_mri_mode (int);
extern const char *define_macro (size_t, sb *, sb *, size_t (*) (sb *),
diff --git a/gas/output-file.c b/gas/output-file.c
index 584deb2..3c4074b 100644
--- a/gas/output-file.c
+++ b/gas/output-file.c
@@ -20,6 +20,8 @@
#include "as.h"
#include "subsegs.h"
+#include "sb.h"
+#include "macro.h"
#include "output-file.h"
#ifndef TARGET_MACH
@@ -103,6 +105,9 @@ output_file_close (void)
if (!keep_it && filename)
unlink_if_ordinary (filename);
+ macro_end ();
+ read_end ();
+ symbol_end ();
subsegs_end (obs);
if (!res)
diff --git a/gas/read.c b/gas/read.c
index 2f9a22a..edf3f2a 100644
--- a/gas/read.c
+++ b/gas/read.c
@@ -248,6 +248,7 @@ static void s_reloc (int);
static int hex_float (int, char *);
static segT get_known_segmented_expression (expressionS * expP);
static void pobegin (void);
+static void poend (void);
static size_t get_non_macro_line_sb (sb *);
static void generate_file_debug (void);
static char *_find_end_of_line (char *, int, int, int);
@@ -276,6 +277,12 @@ read_begin (void)
if (flag_mri)
lex_type['?'] = 3;
}
+
+void
+read_end (void)
+{
+ poend ();
+}
#ifndef TC_ADDRESS_BYTES
#define TC_ADDRESS_BYTES address_bytes
@@ -561,6 +568,12 @@ pobegin (void)
pop_override_ok = 1;
cfi_pop_insert ();
}
+
+static void
+poend (void)
+{
+ htab_delete (po_hash);
+}
#define HANDLE_CONDITIONAL_ASSEMBLY(num_read) \
if (ignore_input ()) \
diff --git a/gas/read.h b/gas/read.h
index 0fa9e79..acab667 100644
--- a/gas/read.h
+++ b/gas/read.h
@@ -141,6 +141,7 @@ extern unsigned output_leb128 (char *, valueT, int);
extern void pseudo_set (symbolS * symbolP);
extern void read_a_source_file (const char *name);
extern void read_begin (void);
+extern void read_end (void);
extern void read_print_statistics (FILE *);
extern char *read_symbol_name (void);
extern unsigned sizeof_leb128 (valueT, int);
diff --git a/gas/symbols.c b/gas/symbols.c
index 00ae49b..744f6e1 100644
--- a/gas/symbols.c
+++ b/gas/symbols.c
@@ -3063,6 +3063,12 @@ symbol_begin (void)
}
void
+symbol_end (void)
+{
+ htab_delete (sy_hash);
+}
+
+void
dot_symbol_init (void)
{
dot_symbol.name = ".";
diff --git a/gas/symbols.h b/gas/symbols.h
index 240e08f..c33a28f 100644
--- a/gas/symbols.h
+++ b/gas/symbols.h
@@ -67,6 +67,7 @@ symbolS *symbol_temp_make (void);
symbolS *colon (const char *sym_name);
void local_colon (int n);
void symbol_begin (void);
+void symbol_end (void);
void dot_symbol_init (void);
void symbol_print_statistics (FILE *);
void symbol_table_insert (symbolS * symbolP);