public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Bug (and fix) in gas: frags.c @ frag_align
@ 2000-07-21 16:58 Serge Nikulin
  2000-07-21 21:25 ` Alan Modra
  0 siblings, 1 reply; 2+ messages in thread
From: Serge Nikulin @ 2000-07-21 16:58 UTC (permalink / raw)
  To: Serge Nikulin; +Cc: binutils

Hi,

As I have reported already, I had a problem with alignment in absolute
section.
I found the bug in frags.c file in frag_align function.

Old code:
---------
      new_off = ((abs_section_offset + alignment - 1)
   &~ ((1 << alignment) - 1));
---------

When abs_section_offset == 1 and alignment == 1 then new_off should be == 2

In the above code new_off == 0

The proposed new code:
-------------------
if ((abs_section_offset & ((1 << alignment) - 1)) != 0)
    new_off = ((abs_section_offset  >> alignment) + 1) << alignment;
else
    new_off = abs_section_offset;    /* aligned already */
-------------------

Serge





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2000-07-21 21:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-07-21 16:58 Bug (and fix) in gas: frags.c @ frag_align Serge Nikulin
2000-07-21 21:25 ` 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).