This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Bug in gas: frags.c @ frag_align (absolute section alignment)
- To: <binutils at sourceware dot cygnus dot com>
- Subject: Bug in gas: frags.c @ frag_align (absolute section alignment)
- From: "Serge Nikulin" <nikulin at actsw dot amat dot com>
- Date: Fri, 21 Jul 2000 13:17:03 -0700
- Cc: <mark_golden at amat dot com>
Hi,
As I reported already, I had a problem with alignment in absolute section.
I found the bug in frags.c file in frag_align function.
Old buggy 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