Bug (and fix) in gas: frags.c @ frag_align
Alan Modra
alan@linuxcare.com.au
Fri Jul 21 21:25:00 GMT 2000
More information about the Binutils mailing list
Fri Jul 21 21:25:00 GMT 2000
- Previous message (by thread): Bug (and fix) in gas: frags.c @ frag_align
- Next message (by thread): Bug in gas: frags.c @ frag_align (absolute section alignment)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Fri, 21 Jul 2000, Serge Nikulin wrote:
> I found the bug in frags.c file in frag_align function.
>
> new_off = ((abs_section_offset + alignment - 1)
> &~ ((1 << alignment) - 1));
Yes, that's broken. I'm checking in the following to fix it.
Thanks, Alan Modra
--
Linuxcare. Support for the Revolution.
gas/ChangeLog
* frags.c (frag_align): Correct absolute section alignment.
Index: frags.c
===================================================================
RCS file: /cvs/src/src/gas/frags.c,v
retrieving revision 1.5
diff -u -p -r1.5 frags.c
--- frags.c 2000/05/23 05:07:47 1.5
+++ frags.c 2000/07/22 04:11:36
@@ -303,9 +303,10 @@ frag_align (alignment, fill_character, m
if (now_seg == absolute_section)
{
addressT new_off;
+ addressT mask;
- new_off = ((abs_section_offset + alignment - 1)
- &~ ((1 << alignment) - 1));
+ mask = (~ (addressT) 0) << alignment;
+ new_off = (abs_section_offset + ~ mask) & mask;
if (max == 0 || new_off - abs_section_offset <= (addressT) max)
abs_section_offset = new_off;
}
- Previous message (by thread): Bug (and fix) in gas: frags.c @ frag_align
- Next message (by thread): Bug in gas: frags.c @ frag_align (absolute section alignment)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Binutils mailing list