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().
This commit is contained in:
H. Peter Anvin 2009-02-21 17:27:51 -08:00
parent a5c2455f8a
commit 577f57614a
2 changed files with 4 additions and 8 deletions

View file

@ -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);
}
}

View file

@ -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);
}
}