elfcopy: Avoid divide-by-0 on section alignment 0
According to ELF ABI, alignment 0 and 1 has the same meaning: the section has no alignment constraints. PR: 196715 Sponsored by: The FreeBSD Foundation
This commit is contained in:
parent
07dbde6777
commit
2b39d4f68b
@ -777,6 +777,8 @@ resync_sections(struct elfcopy *ecp)
|
||||
continue;
|
||||
|
||||
/* Align section offset. */
|
||||
if (s->align == 0)
|
||||
s->align = 1;
|
||||
if (off <= s->off) {
|
||||
if (!s->loadable)
|
||||
s->off = roundup(off, s->align);
|
||||
|
Loading…
x
Reference in New Issue
Block a user