Bug (and fix) in gas: frags.c @ frag_align
Serge Nikulin
nikulin@actsw.amat.com
Fri Jul 21 16:58:00 GMT 2000
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
More information about the Binutils
mailing list