public inbox for binutils-cvs@sourceware.org
 help / color / mirror / Atom feed
* [binutils-gdb] Local label checks in integer_constant
@ 2023-02-10  7:40 Alan Modra
  0 siblings, 0 replies; only message in thread
From: Alan Modra @ 2023-02-10  7:40 UTC (permalink / raw)
  To: bfd-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=fe8cdc8ec145a166414fc375cf2cb65d9a8085a1

commit fe8cdc8ec145a166414fc375cf2cb65d9a8085a1
Author: Alan Modra <amodra@gmail.com>
Date:   Fri Feb 10 18:03:35 2023 +1030

    Local label checks in integer_constant
    
    "Local labels are never absolute" says the comment.  Except when they
    are.  Testcase
     .offset
    0:
     a=0b
    I don't see any particular reason to disallow local labels inside
    struct definitions, so delete the comment and assertions.
    
            * expr.c (integer_constant): Delete local label assertions.

Diff:
---
 gas/expr.c | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/gas/expr.c b/gas/expr.c
index 189236bec6d..78900b50e46 100644
--- a/gas/expr.c
+++ b/gas/expr.c
@@ -573,10 +573,6 @@ integer_constant (int radix, expressionS *expressionP)
 	  symbolP = symbol_find (name);
 	  if ((symbolP != NULL) && (S_IS_DEFINED (symbolP)))
 	    {
-	      /* Local labels are never absolute.  Don't waste time
-		 checking absoluteness.  */
-	      know (SEG_NORMAL (S_GET_SEGMENT (symbolP)));
-
 	      expressionP->X_op = O_symbol;
 	      expressionP->X_add_symbol = symbolP;
 	    }
@@ -604,11 +600,6 @@ integer_constant (int radix, expressionS *expressionP)
 	  name = fb_label_name (number, 1);
 	  symbolP = symbol_find_or_make (name);
 	  /* We have no need to check symbol properties.  */
-#ifndef many_segments
-	  /* Since "know" puts its arg into a "string", we
-	     can't have newlines in the argument.  */
-	  know (S_GET_SEGMENT (symbolP) == undefined_section || S_GET_SEGMENT (symbolP) == text_section || S_GET_SEGMENT (symbolP) == data_section);
-#endif
 	  expressionP->X_op = O_symbol;
 	  expressionP->X_add_symbol = symbolP;
 	  expressionP->X_add_number = 0;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-02-10  7:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-10  7:40 [binutils-gdb] Local label checks in integer_constant Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).