bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug gas/28842] New: colon() problem in gas?


From: jacob at jacob dot remcomp.fr
Subject: [Bug gas/28842] New: colon() problem in gas?
Date: Sat, 29 Jan 2022 11:03:12 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=28842

            Bug ID: 28842
           Summary: colon() problem in gas?
           Product: binutils
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: gas
          Assignee: unassigned at sourceware dot org
          Reporter: jacob at jacob dot remcomp.fr
  Target Milestone: ---

GAS, the GNU assembler features a colon() function that creates labels. In all
versions I have seen, there is a sequence like this:

 391         /* New .comm for prev .comm symbol.
 392 
 393         If the new size is larger we just change its
 394         value.  If the new size is smaller, we ignore
 395         this symbol.  */
 396         if (S_GET_VALUE (symbolP)
 397               < ((unsigned) frag_now_fix ()))
 398          {
 399            S_SET_VALUE (symbolP, (valueT) frag_now_fix ());
 400          }

I am sorry, maybe I am missing something, but the code is doing THE OPPOSITE of
what the comments say. 
Do you see the  < sign above? Shouldn't that be a > sign???

The frag_now_fix() function is defined in frags.c:

383 addressT
384 frag_now_fix (void)
385 {
386   if (now_seg == absolute_section)
387     return abs_section_offset;
388 
389   return ((char *) obstack_next_free (&frchain_now->frch_obstack)
390       - frag_now->fr_literal);
391 }

As far as I understand it,  it returns the size of frag_now.

The whole is utterly incomprehensible.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]