summaryrefslogtreecommitdiff
path: root/mld/obj.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--mld/obj.c3
1 files changed, 2 insertions, 1 deletions
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 */