summaryrefslogtreecommitdiff
path: root/mld/obj.c
diff options
context:
space:
mode:
authorFreya Murphy <freya@freyacat.org>2024-10-04 22:09:01 -0400
committerFreya Murphy <freya@freyacat.org>2024-10-04 22:09:01 -0400
commit9ae3442c85196d7c25d9916520b0c19202a1dd40 (patch)
treec874aab2bf280872276d45f5decf5b7217f9998c /mld/obj.c
parentupdate mld,msim with new headers (diff)
downloadmips-9ae3442c85196d7c25d9916520b0c19202a1dd40.tar.gz
mips-9ae3442c85196d7c25d9916520b0c19202a1dd40.tar.bz2
mips-9ae3442c85196d7c25d9916520b0c19202a1dd40.zip
fixed forced section padding in mld
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 */