diff options
author | Cyrill Gorcunov <gorcunov@gmail.com> | 2017-03-08 21:19:23 +0300 |
---|---|---|
committer | Cyrill Gorcunov <gorcunov@gmail.com> | 2017-03-12 11:37:41 +0300 |
commit | bcf038948173e20419d9eae84171e302ecf3b1de (patch) | |
tree | 6c7dbe74095a83476b662eca865c9415f4bc40a7 | |
parent | 660101a02e43bc4e8141088de38e92b06e6937e9 (diff) | |
download | nasm-bcf038948173e20419d9eae84171e302ecf3b1de.tar.gz |
elf: Drop code duplication in elf_section_header
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
-rw-r--r-- | output/outelf.c | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/output/outelf.c b/output/outelf.c index b347fdfd..8be97b39 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); |