|
| From: | Richard Henderson |
| Subject: | Re: [PATCH 1/5] dump: Allocate header |
| Date: | Fri, 11 Mar 2022 12:06:18 -0800 |
| User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 |
On 3/10/22 03:16, Janosch Frank wrote:
Allocating the header lets us write it at a later time and hence also allows us to change section and segment table offsets until we finally write it. Signed-off-by: Janosch Frank <frankja@linux.ibm.com> --- dump/dump.c | 115 ++++++++++++++++++++++-------------------- include/sysemu/dump.h | 1 + 2 files changed, 62 insertions(+), 54 deletions(-)
You're collecting the important pieces that go into the header separately (phdr_offset, phdr_num, etc), and you can certainly change those as you go along. But I don't see the point of allocating the ehdr early. I think you should create it and write it out immediately.
r~
| [Prev in Thread] | Current Thread | [Next in Thread] |