From 577f57614a159e3c5ab10bf03d345846796de932 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Sat, 21 Feb 2009 17:27:51 -0800 Subject: [PATCH] outelf32/64: remove align_str in favor of fwritezero() Drop the use of yet another local all-zero buffer, align_str, in favor of calling fwritezero(). --- output/outelf32.c | 6 ++---- output/outelf64.c | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/output/outelf32.c b/output/outelf32.c index 024b209d..604c353a 100644 --- a/output/outelf32.c +++ b/output/outelf32.c @@ -175,8 +175,6 @@ extern struct ofmt of_elf; #define SOC(ln,aa) ln - line_base + (line_range * aa) + opcode_base -static const char align_str[SEG_ALIGN] = ""; /* ANSI will pad this with 0s */ - static struct ELF_SECTDATA { void *data; int32_t len; @@ -1233,7 +1231,7 @@ static void elf_write(void) loclen, 0, 0, 1, 0); } - fwrite(align_str, align, 1, elffp); + fwritezero(align, elffp); /* * Now output the sections. @@ -1434,7 +1432,7 @@ static void elf_write_sections(void) saa_fpwrite(elf_sects[i].data, elffp); else fwrite(elf_sects[i].data, len, 1, elffp); - fwrite(align_str, align, 1, elffp); + fwritezero(align, elffp); } } diff --git a/output/outelf64.c b/output/outelf64.c index 9960a394..24d0b81c 100644 --- a/output/outelf64.c +++ b/output/outelf64.c @@ -215,8 +215,6 @@ extern struct ofmt of_elf64; #define TY_DEBUGSYMLIN 0x40 /* internal call to debug_out */ -static const char align_str[SEG_ALIGN] = ""; /* ANSI will pad this with 0s */ - static struct ELF_SECTDATA { void *data; int64_t len; @@ -1349,7 +1347,7 @@ static void elf_write(void) loclen, 0, 0, 1, 0); } - fwrite(align_str, align, 1, elffp); + fwritezero(align, elffp); /* * Now output the sections. @@ -1550,7 +1548,7 @@ static void elf_write_sections(void) saa_fpwrite(elf_sects[i].data, elffp); else fwrite(elf_sects[i].data, len, 1, elffp); - fwrite(align_str, align, 1, elffp); + fwritezero(align, elffp); } } -- 2.11.4.GIT