Correct absolute section alignment.

This commit is contained in:
Alan Modra
2000-07-22 04:23:48 +00:00
parent e9d196c53f
commit 65e68b04b1
2 changed files with 7 additions and 2 deletions

View File

@ -303,9 +303,10 @@ frag_align (alignment, fill_character, max)
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;
}