From: Magnus Damm The ELF32 spec says we should plus we include the zero on other platforms. Signed-off-by: Magnus Damm Cc: Daniel Jacobowitz Cc: Roland McGrath Cc: Jakub Jelinek Signed-off-by: Andrew Morton --- arch/mips/kernel/irixelf.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff -puN arch/mips/kernel/irixelf.c~elf-include-terminating-zero-in-n_namesz arch/mips/kernel/irixelf.c --- a/arch/mips/kernel/irixelf.c~elf-include-terminating-zero-in-n_namesz +++ a/arch/mips/kernel/irixelf.c @@ -1009,7 +1009,7 @@ static int notesize(struct memelfnote *e int sz; sz = sizeof(struct elf_note); - sz += roundup(strlen(en->name), 4); + sz += roundup(strlen(en->name) + 1, 4); sz += roundup(en->datasz, 4); return sz; @@ -1028,7 +1028,7 @@ static int writenote(struct memelfnote * { struct elf_note en; - en.n_namesz = strlen(men->name); + en.n_namesz = strlen(men->name) + 1; en.n_descsz = men->datasz; en.n_type = men->type; _