diff options
author | Ed Maste <emaste@FreeBSD.org> | 2015-01-14 14:49:58 +0000 |
---|---|---|
committer | Ed Maste <emaste@FreeBSD.org> | 2015-01-14 14:49:58 +0000 |
commit | 2b39d4f68b42095d5d81bfa1d9aa3da71c93be45 (patch) | |
tree | 6a3ead898adf2261184689256112ca9a5ed548f1 /contrib/elftoolchain | |
parent | 07dbde6777f2861e380f81f84baf1ca63a3996e9 (diff) | |
download | src-2b39d4f68b42095d5d81bfa1d9aa3da71c93be45.tar.gz src-2b39d4f68b42095d5d81bfa1d9aa3da71c93be45.zip |
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
Notes
Notes:
svn path=/head/; revision=277181
Diffstat (limited to 'contrib/elftoolchain')
-rw-r--r-- | contrib/elftoolchain/elfcopy/sections.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/contrib/elftoolchain/elfcopy/sections.c b/contrib/elftoolchain/elfcopy/sections.c index 6c733f8a0f81..4d23bc7e5adf 100644 --- a/contrib/elftoolchain/elfcopy/sections.c +++ b/contrib/elftoolchain/elfcopy/sections.c @@ -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); |