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_fdpic.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_fdpic.c')
-rw-r--r-- | fs/binfmt_elf_fdpic.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/fs/binfmt_elf_fdpic.c b/fs/binfmt_elf_fdpic.c index a69fc4ae1c85..645f6e56f378 100644 --- a/fs/binfmt_elf_fdpic.c +++ b/fs/binfmt_elf_fdpic.c | |||
@@ -1267,12 +1267,6 @@ static int notesize(struct memelfnote *en) | |||
1267 | 1267 | ||
1268 | /* #define DEBUG */ | 1268 | /* #define DEBUG */ |
1269 | 1269 | ||
1270 | static int alignfile(struct coredump_params *cprm) | ||
1271 | { | ||
1272 | static const char buf[4] = { 0, }; | ||
1273 | return dump_emit(cprm, buf, roundup(cprm->written, 4) - cprm->written); | ||
1274 | } | ||
1275 | |||
1276 | static int writenote(struct memelfnote *men, struct coredump_params *cprm) | 1270 | static int writenote(struct memelfnote *men, struct coredump_params *cprm) |
1277 | { | 1271 | { |
1278 | struct elf_note en; | 1272 | struct elf_note en; |
@@ -1281,8 +1275,8 @@ static int writenote(struct memelfnote *men, struct coredump_params *cprm) | |||
1281 | en.n_type = men->type; | 1275 | en.n_type = men->type; |
1282 | 1276 | ||
1283 | return dump_emit(cprm, &en, sizeof(en)) && | 1277 | return dump_emit(cprm, &en, sizeof(en)) && |
1284 | dump_emit(cprm, men->name, en.n_namesz) && alignfile(cprm) && | 1278 | dump_emit(cprm, men->name, en.n_namesz) && dump_align(cprm, 4) && |
1285 | dump_emit(cprm, men->data, men->datasz) && alignfile(cprm); | 1279 | dump_emit(cprm, men->data, men->datasz) && dump_align(cprm, 4); |
1286 | } | 1280 | } |
1287 | 1281 | ||
1288 | static inline void fill_elf_fdpic_header(struct elfhdr *elf, int segs) | 1282 | static inline void fill_elf_fdpic_header(struct elfhdr *elf, int segs) |