This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Bug (and fix) in gas: frags.c @ frag_align
- To: "Serge Nikulin" <Serge_Nikulin at amat dot com>
- Subject: Bug (and fix) in gas: frags.c @ frag_align
- From: "Serge Nikulin" <nikulin at actsw dot amat dot com>
- Date: Fri, 21 Jul 2000 15:44:33 -0700
- Cc: <binutils at sourceware dot cygnus dot com>
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