Skip to content

Commit

Permalink
Local label checks in integer_constant
Browse files Browse the repository at this point in the history
"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.
  • Loading branch information
amodra committed Feb 10, 2023
1 parent aa18074 commit fe8cdc8
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions gas/expr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit fe8cdc8

Please sign in to comment.