aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2011-10-25 03:06:33 +0000
committerAlan Modra <amodra@gmail.com>2011-10-25 03:06:33 +0000
commitd690455615e0f0780b25475d5a28a7d2ab9bbf92 (patch)
treebad6d1f7c4606bc3e414c484bca3f5e6dc80dda9
parentb65fcc7c84c921cc4357db3df19581a400ef969f (diff)
downloadgdb-d690455615e0f0780b25475d5a28a7d2ab9bbf92.zip
gdb-d690455615e0f0780b25475d5a28a7d2ab9bbf92.tar.gz
gdb-d690455615e0f0780b25475d5a28a7d2ab9bbf92.tar.bz2
2011-10-13 Alan Modra <amodra@gmail.com>
* as.c (main): Define .gasversion. rather than __GAS_VERSION__. * frags.h (bss_address_frag): Delete (predefined_address_frag): New. * frags.c (frag_init): Init predefined_address_frag. Delete ref to bss_address_frag. * symbols.c (S_CAN_BE_REDEFINED): New function. * symbols.h (S_CAN_BE_REDEFINED): Declare. * read.c (assign_symbol): Use S_CAN_BE_REDEFINED. 2011-10-12 Alan Modra <amodra@gmail.com> * symbols.c (local_symbol_make): Make global. * symbols.h (local_symbol_make): Declare. * as.c (main): Define __GAS_VERSION__.
-rw-r--r--gas/ChangeLog18
-rw-r--r--gas/as.c3
-rw-r--r--gas/frags.c4
-rw-r--r--gas/frags.h3
-rw-r--r--gas/read.c3
-rw-r--r--gas/symbols.c14
-rw-r--r--gas/symbols.h3
7 files changed, 39 insertions, 9 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 4d0d622..50f9de8 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,21 @@
+2011-10-25 Alan Modra <amodra@gmail.com>
+
+ Apply mainline patches
+ 2011-10-13 Alan Modra <amodra@gmail.com>
+ * as.c (main): Define .gasversion. rather than __GAS_VERSION__.
+ * frags.h (bss_address_frag): Delete
+ (predefined_address_frag): New.
+ * frags.c (frag_init): Init predefined_address_frag. Delete ref
+ to bss_address_frag.
+ * symbols.c (S_CAN_BE_REDEFINED): New function.
+ * symbols.h (S_CAN_BE_REDEFINED): Declare.
+ * read.c (assign_symbol): Use S_CAN_BE_REDEFINED.
+
+ 2011-10-12 Alan Modra <amodra@gmail.com>
+ * symbols.c (local_symbol_make): Make global.
+ * symbols.h (local_symbol_make): Declare.
+ * as.c (main): Define __GAS_VERSION__.
+
2011-09-22 Tristan Gingold <gingold@adacore.com>
* NEWS: Add marker for 2.22.
diff --git a/gas/as.c b/gas/as.c
index e58d861..b99ea1e 100644
--- a/gas/as.c
+++ b/gas/as.c
@@ -1206,6 +1206,9 @@ main (int argc, char ** argv)
dwarf2_init ();
+ local_symbol_make (".gasversion.", absolute_section,
+ BFD_VERSION / 10000UL, &predefined_address_frag);
+
/* Now that we have fully initialized, and have created the output
file, define any symbols requested by --defsym command line
arguments. */
diff --git a/gas/frags.c b/gas/frags.c
index fb3c02d..fe3e78f 100644
--- a/gas/frags.c
+++ b/gas/frags.c
@@ -25,7 +25,7 @@
#include "obstack.h"
extern fragS zero_address_frag;
-extern fragS bss_address_frag;
+extern fragS predefined_address_frag;
/* Initialization for frag routines. */
@@ -33,7 +33,7 @@ void
frag_init (void)
{
zero_address_frag.fr_type = rs_fill;
- bss_address_frag.fr_type = rs_fill;
+ predefined_address_frag.fr_type = rs_fill;
}
/* Check that we're not trying to assemble into a section that can't
diff --git a/gas/frags.h b/gas/frags.h
index 650ea5e..dd247f9 100644
--- a/gas/frags.h
+++ b/gas/frags.h
@@ -118,8 +118,7 @@ extern addressT frag_now_fix_octets (void);
/* For foreign-segment symbol fixups. */
COMMON fragS zero_address_frag;
-/* For local common (N_BSS segment) fixups. */
-COMMON fragS bss_address_frag;
+COMMON fragS predefined_address_frag;
extern void frag_append_1_char (int);
#define FRAG_APPEND_1_CHAR(X) frag_append_1_char (X)
diff --git a/gas/read.c b/gas/read.c
index 2ab58ec..445caa1 100644
--- a/gas/read.c
+++ b/gas/read.c
@@ -3091,9 +3091,8 @@ assign_symbol (char *name, int mode)
if (S_IS_DEFINED (symbolP) || symbol_equated_p (symbolP))
{
- /* Permit register names to be redefined. */
if ((mode != 0 || !S_IS_VOLATILE (symbolP))
- && S_GET_SEGMENT (symbolP) != reg_section)
+ && !S_CAN_BE_REDEFINED (symbolP))
{
as_bad (_("symbol `%s' is already defined"), name);
symbolP = symbol_clone (symbolP, 0);
diff --git a/gas/symbols.c b/gas/symbols.c
index fc475ca..086e01d 100644
--- a/gas/symbols.c
+++ b/gas/symbols.c
@@ -23,11 +23,9 @@
/* #define DEBUG_SYMS / * to debug symbol list maintenance. */
#include "as.h"
-
#include "safe-ctype.h"
#include "obstack.h" /* For "symbols.h" */
#include "subsegs.h"
-
#include "struc-symbol.h"
/* This is non-zero if symbols are case sensitive, which is the
@@ -191,7 +189,7 @@ static unsigned long local_symbol_conversion_count;
/* Create a local symbol and insert it into the local hash table. */
-static struct local_symbol *
+struct local_symbol *
local_symbol_make (const char *name, segT section, valueT val, fragS *frag)
{
char *name_copy;
@@ -2139,6 +2137,16 @@ S_IS_STABD (symbolS *s)
}
int
+S_CAN_BE_REDEFINED (const symbolS *s)
+{
+ if (LOCAL_SYMBOL_CHECK (s))
+ return (local_symbol_get_frag ((struct local_symbol *) s)
+ == &predefined_address_frag);
+ /* Permit register names to be redefined. */
+ return s->bsym->section == reg_section;
+}
+
+int
S_IS_VOLATILE (const symbolS *s)
{
if (LOCAL_SYMBOL_CHECK (s))
diff --git a/gas/symbols.h b/gas/symbols.h
index 1d5b2a3..a3a31f7 100644
--- a/gas/symbols.h
+++ b/gas/symbols.h
@@ -50,6 +50,8 @@ symbolS *symbol_new (const char *name, segT segment, valueT value,
fragS * frag);
symbolS *symbol_create (const char *name, segT segment, valueT value,
fragS * frag);
+struct local_symbol *local_symbol_make (const char *name, segT section,
+ valueT val, fragS *frag);
symbolS *symbol_clone (symbolS *, int);
#undef symbol_clone_if_forward_ref
symbolS *symbol_clone_if_forward_ref (symbolS *, int);
@@ -98,6 +100,7 @@ extern int S_FORCE_RELOC (symbolS *, int);
extern int S_IS_DEBUG (symbolS *);
extern int S_IS_LOCAL (symbolS *);
extern int S_IS_STABD (symbolS *);
+extern int S_CAN_BE_REDEFINED (const symbolS *);
extern int S_IS_VOLATILE (const symbolS *);
extern int S_IS_FORWARD_REF (const symbolS *);
extern const char *S_GET_NAME (symbolS *);