diff options
author | Freya Murphy <freya@freyacat.org> | 2024-10-04 19:55:38 -0400 |
---|---|---|
committer | Freya Murphy <freya@freyacat.org> | 2024-10-04 19:55:38 -0400 |
commit | e470009a16711555ae887fdacec061a7d092df17 (patch) | |
tree | c2ccf49a30e594295fd89fdf3850644988448b86 /mld/obj.c | |
parent | make offsets return pc relative reltab entry (diff) | |
download | mips-e470009a16711555ae887fdacec061a7d092df17.tar.gz mips-e470009a16711555ae887fdacec061a7d092df17.tar.bz2 mips-e470009a16711555ae887fdacec061a7d092df17.zip |
update mld,msim with new headers
Diffstat (limited to '')
-rw-r--r-- | mld/obj.c | 29 |
1 files changed, 2 insertions, 27 deletions
@@ -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) { @@ -149,29 +148,6 @@ static int create_phdr(struct object *object) } /** - * 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 */ static int load_strtabs(struct object *object) @@ -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); |