]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gas: centralize declaration of listing_tail
authorJan Beulich <jbeulich@suse.com>
Fri, 7 Mar 2025 10:26:43 +0000 (11:26 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 7 Mar 2025 10:26:43 +0000 (11:26 +0100)
Besides it being somewhat off to have three decls scattered across the
code base, it is generally bad practice for the definition of a symbol
to not also observe its declaration (making sure the two won't go out of
sync).

gas/config/tc-arm.c
gas/frags.c
gas/listing.h
gas/read.c

index ed910b857dfed7678453c40d6b8756fec9c6eacc..822fd3dabbcafaa618ca576fe1dfa5b473a6e58e 100644 (file)
@@ -3260,7 +3260,6 @@ s_thumb_set (int equiv)
         for this symbol.  */
       if (listing & LISTING_SYMBOLS)
        {
-         extern struct list_info_struct * listing_tail;
          fragS * dummy_frag = (fragS * ) xmalloc (sizeof (fragS));
 
          memset (dummy_frag, 0, sizeof (fragS));
index d067bb4761e0a240b1d84e4519ff796555fab425..6684e27618997eb9130d6f7cfc07dcba4fc01c0b 100644 (file)
@@ -192,10 +192,7 @@ frag_new (size_t old_frags_var_max_size
   frchP->frch_last = frag_now;
 
 #ifndef NO_LISTING
-  {
-    extern struct list_info_struct *listing_tail;
-    frag_now->line = listing_tail;
-  }
+  frag_now->line = listing_tail;
 #endif
 
   gas_assert (frchain_now->frch_last == frag_now);
index 791d58410e9bca833f70ca14792215002d1aa34f..cd4949861a9b3647db81b5e84c071710b1b9d307 100644 (file)
@@ -62,6 +62,8 @@ extern int listing_lhs_width_second;
 extern int listing_lhs_cont_lines;
 extern int listing_rhs_width;
 
+extern struct list_info_struct *listing_tail;
+
 #endif /* __listing_h__ */
 
 /* end of listing.h */
index 2acb4e03a7fabe0f4bc5152dbfa42ce92186ab41..171182d5a0f6a9595362f523c3b5e13e58c943fc 100644 (file)
@@ -3270,7 +3270,6 @@ assign_symbol (char *name, int mode)
         for this symbol.  */
       if (listing & LISTING_SYMBOLS)
        {
-         extern struct list_info_struct *listing_tail;
          fragS *dummy_frag = notes_calloc (1, sizeof (*dummy_frag));
          dummy_frag->line = listing_tail;
          dummy_frag->fr_symbol = symbolP;