From 65e68b04b1bfc88c11a5a49e0ccfd636cd995a46 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Sat, 22 Jul 2000 04:23:48 +0000 Subject: [PATCH] Correct absolute section alignment. --- gas/ChangeLog | 4 ++++ gas/frags.c | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index bca4ec028ec..f7501d0e785 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,7 @@ +2000-07-22 Alan Modra + + * frags.c (frag_align): Correct absolute section alignment. + 2000-07-20 DJ Delorie * config/obj-coff.c (obj_frob_symbol): revert previous change, diff --git a/gas/frags.c b/gas/frags.c index 2b2c91d41d5..5c31b7e8931 100644 --- a/gas/frags.c +++ b/gas/frags.c @@ -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; } -- 2.30.2