summaryrefslogtreecommitdiff
path: root/gas/frags.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2000-07-22 04:23:48 +0000
committerAlan Modra <amodra@bigpond.net.au>2000-07-22 04:23:48 +0000
commit42c62f773b76c093a057f6e2d4c0d14f06896e8f (patch)
tree70f5dac509777b1fe9c72b6e78b886f0f3f5faec /gas/frags.c
parent6f9cb1ba00ab0d43f41b0d45489f5757af3b108b (diff)
downloadbinutils-redhat-42c62f773b76c093a057f6e2d4c0d14f06896e8f.tar.gz
Correct absolute section alignment.
Diffstat (limited to 'gas/frags.c')
-rw-r--r--gas/frags.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gas/frags.c b/gas/frags.c
index 2b2c91d41d..5c31b7e893 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;
}