summaryrefslogtreecommitdiff
path: root/bfd/bfd-in2.h
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/bfd-in2.h')
-rw-r--r--bfd/bfd-in2.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index 0d2e915b41..4ab7e2d693 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -1201,6 +1201,8 @@ bfd_set_section_lma (asection *sec, bfd_vma val)
static inline bool
bfd_set_section_alignment (asection *sec, unsigned int val)
{
+ if (val >= sizeof (bfd_vma) * 8 - 1)
+ return false;
sec->alignment_power = val;
return true;
}