diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2013-10-08 11:05:01 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-11-09 00:16:27 -0500 |
commit | 22a8cb8248ba5d340307ba72432253b1dbdb5cf7 (patch) | |
tree | ddb88cce781598c909769c4d92f1e38d2716cd52 /fs/binfmt_elf.c | |
parent | 7b1f4020d0d16a17b9c48570bdb7b4ad99be3553 (diff) |
new helper: dump_align()
dump_skip to given alignment...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/binfmt_elf.c')
-rw-r--r-- | fs/binfmt_elf.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c index c56ae3264a65..864154972670 100644 --- a/fs/binfmt_elf.c +++ b/fs/binfmt_elf.c | |||
@@ -1225,12 +1225,6 @@ static int notesize(struct memelfnote *en) | |||
1225 | return sz; | 1225 | return sz; |
1226 | } | 1226 | } |
1227 | 1227 | ||
1228 | static int alignfile(struct coredump_params *cprm) | ||
1229 | { | ||
1230 | static const char buf[4] = { 0, }; | ||
1231 | return dump_emit(cprm, buf, roundup(cprm->written, 4) - cprm->written); | ||
1232 | } | ||
1233 | |||
1234 | static int writenote(struct memelfnote *men, struct coredump_params *cprm) | 1228 | static int writenote(struct memelfnote *men, struct coredump_params *cprm) |
1235 | { | 1229 | { |
1236 | struct elf_note en; | 1230 | struct elf_note en; |
@@ -1239,8 +1233,8 @@ static int writenote(struct memelfnote *men, struct coredump_params *cprm) | |||
1239 | en.n_type = men->type; | 1233 | en.n_type = men->type; |
1240 | 1234 | ||
1241 | return dump_emit(cprm, &en, sizeof(en)) && | 1235 | return dump_emit(cprm, &en, sizeof(en)) && |
1242 | dump_emit(cprm, men->name, en.n_namesz) && alignfile(cprm) && | 1236 | dump_emit(cprm, men->name, en.n_namesz) && dump_align(cprm, 4) && |
1243 | dump_emit(cprm, men->data, men->datasz) && alignfile(cprm); | 1237 | dump_emit(cprm, men->data, men->datasz) && dump_align(cprm, 4); |
1244 | } | 1238 | } |
1245 | 1239 | ||
1246 | static void fill_elf_header(struct elfhdr *elf, int segs, | 1240 | static void fill_elf_header(struct elfhdr *elf, int segs, |