From e470009a16711555ae887fdacec061a7d092df17 Mon Sep 17 00:00:00 2001 From: Freya Murphy Date: Fri, 4 Oct 2024 19:55:38 -0400 Subject: update mld,msim with new headers --- mld/obj.c | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) (limited to 'mld/obj.c') diff --git a/mld/obj.c b/mld/obj.c index e986a75..a37527a 100644 --- a/mld/obj.c +++ b/mld/obj.c @@ -105,7 +105,6 @@ static int create_phdr(struct object *object) object->phdr = phdr; object->phdr_len = entries; - object->phdr_local = true; uint32_t *mapping = malloc(entries * sizeof(uint32_t)); if (mapping == NULL) { @@ -148,29 +147,6 @@ static int create_phdr(struct object *object) return M_SUCCESS; } -/** - * Map the phdr - */ -static int load_phdr(struct object *object) -{ - //size_t phdr_len = B16(object->ehdr->e_phentsize) * - // B16(object->ehdr->e_phnum); - - //if (phdr_len < 1) - return create_phdr(object); - - //size_t phdr_off = B32(object->ehdr->e_phoff); - //object->phdr = (Elf32_Phdr *) (object->mapped + phdr_off); - //object->phdr_len = B16(object->ehdr->e_phnum); - - //if (BOUND_CHK(object, phdr_len, phdr_off)) { - // ERROR("cannot read phdr"); - // return M_ERROR; - //} - - //return M_SUCCESS; -} - /** * Load the strtabs */ @@ -358,7 +334,6 @@ int object_load(struct object *object, char *path, uint32_t index) object->mapped = NULL; object->name = path; object->index = index; - object->phdr_local = false; object->phdr_to_shdr_mapping = NULL; /** load the file */ @@ -374,7 +349,7 @@ int object_load(struct object *object, char *path, uint32_t index) return M_ERROR; /* phdr */ - if (load_phdr(object)) + if (create_phdr(object)) return M_ERROR; /* strtabs */ @@ -404,7 +379,7 @@ void object_free(struct object *obj) free(obj->strtabs); if (obj->segments != NULL) free(obj->segments); - if (obj->phdr_local) + if (obj->phdr != NULL) free(obj->phdr); if (obj->phdr_to_shdr_mapping) free(obj->phdr_to_shdr_mapping); -- cgit v1.2.3-freya