Commit-ID: bcf038948173e20419d9eae84171e302ecf3b1de
Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=bcf038948173e20419d9eae84171e302ecf3b1de
Author: Cyrill Gorcunov <gor...@gm...>
AuthorDate: Wed, 8 Mar 2017 21:19:23 +0300
Committer: Cyrill Gorcunov <gor...@gm...>
CommitDate: Sun, 12 Mar 2017 11:37:41 +0300
elf: Drop code duplication in elf_section_header
Signed-off-by: Cyrill Gorcunov <gor...@gm...>
---
output/outelf.c | 15 +--------------
1 file changed, 1 insertion(+), 14 deletions(-)
diff --git a/output/outelf.c b/output/outelf.c
index b347fdf..8be97b3 100644
--- a/output/outelf.c
+++ b/output/outelf.c
@@ -2118,20 +2118,7 @@ static void elf_section_header(int name, int type, uint64_t flags,
elf_sects[elf_nsect].is_saa = is_saa;
elf_nsect++;
- if (is_elf32()) {
- fwriteint32_t((int32_t)name, ofile);
- fwriteint32_t((int32_t)type, ofile);
- fwriteint32_t((int32_t)flags, ofile);
- fwriteint32_t(0L, ofile); /* no address, ever, in object files */
- fwriteint32_t(type == 0 ? 0L : elf_foffs, ofile);
- fwriteint32_t(datalen, ofile);
- if (data)
- elf_foffs += ALIGN(datalen, SEC_FILEALIGN);
- fwriteint32_t((int32_t)link, ofile);
- fwriteint32_t((int32_t)info, ofile);
- fwriteint32_t((int32_t)align, ofile);
- fwriteint32_t((int32_t)eltsize, ofile);
- } else if (is_elfx32()) {
+ if (is_elf32() || is_elfx32()) {
fwriteint32_t((int32_t)name, ofile);
fwriteint32_t((int32_t)type, ofile);
fwriteint32_t((int32_t)flags, ofile);
|