Skip to content

Commit

Permalink
Alignment mask was incorrectly checked for 1 instead of 0
Browse files Browse the repository at this point in the history
This caused an `ALIGN[1]` to be ignored.
  • Loading branch information
daid authored and ISSOtm committed Mar 11, 2021
1 parent 60019cf commit a81d383
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/link/section.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ static void doSanityChecks(struct Section *section, void *ptr)
* Check if alignment is reasonable, this is important to avoid UB
* An alignment of zero is equivalent to no alignment, basically
*/
if (section->isAlignFixed && section->alignMask == 1)
if (section->isAlignFixed && section->alignMask == 0)
section->isAlignFixed = false;

/* Too large an alignment may not be satisfiable */
Expand Down

0 comments on commit a81d383

Please sign in to comment.