gas standardise md_section_align

The point here is that when valueT is 64 bits and int is 32 bits,
1 << align doesn't work for shifts larger than the size of int.  (Not
that anyone is likely to use such large alignments in real code.)
This commit is contained in:
Alan Modra
2025-07-09 09:13:14 +09:30
parent c78eda50fe
commit a093ef7af4
25 changed files with 25 additions and 25 deletions

View File

@@ -380,7 +380,7 @@ valueT
md_section_align (segT segment, valueT size)
{
int align = bfd_section_alignment (segment);
return ((size + (1 << align) - 1) & -(1 << align));
return (size + ((valueT) 1 << align) - 1) & -((valueT) 1 << align);
}
symbolS *