From 9ae3442c85196d7c25d9916520b0c19202a1dd40 Mon Sep 17 00:00:00 2001 From: Freya Murphy Date: Fri, 4 Oct 2024 22:09:01 -0400 Subject: fixed forced section padding in mld --- mld/obj.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'mld/obj.c') diff --git a/mld/obj.c b/mld/obj.c index a37527a..d6861d3 100644 --- a/mld/obj.c +++ b/mld/obj.c @@ -67,7 +67,7 @@ static int load_ehdr(struct object *object) */ static int load_shdr(struct object *object) { - size_t shdr_len = B16(object->ehdr->e_shentsize) * + size_t shdr_len = sizeof(Elf32_Shdr) * B16(object->ehdr->e_shnum); size_t shdr_off = B32(object->ehdr->e_shoff); object->shdr = (Elf32_Shdr *) (object->mapped + shdr_off); @@ -334,6 +334,7 @@ int object_load(struct object *object, char *path, uint32_t index) object->mapped = NULL; object->name = path; object->index = index; + object->phdr = NULL; object->phdr_to_shdr_mapping = NULL; /** load the file */ -- cgit v1.2.3-freya