5cd83f
From 9534a7a09d5919369e16e4f7b69d2d200c8ee3dd Mon Sep 17 00:00:00 2001
5cd83f
From: Petr Machata <pmachata@redhat.com>
5cd83f
Date: Thu, 13 Feb 2014 16:02:50 +0100
5cd83f
Subject: Initialize struct process.e_machine and .e_class for secondary
5cd83f
 threads
5cd83f
5cd83f
5cd83f
diff --git a/proc.c b/proc.c
5cd83f
index 6f4f64e..17bb3cd 100644
5cd83f
--- a/proc.c
5cd83f
+++ b/proc.c
5cd83f
@@ -224,9 +224,11 @@ process_init(struct process *proc, const char *filename, pid_t pid)
5cd83f
 		goto fail;
5cd83f
 	}
5cd83f
 
5cd83f
-	if (proc->leader != proc)
5cd83f
-		return 0;
5cd83f
-	if (process_init_main(proc) < 0) {
5cd83f
+	if (proc->leader != proc) {
5cd83f
+		proc->e_machine = proc->leader->e_machine;
5cd83f
+		proc->e_class = proc->leader->e_class;
5cd83f
+		get_arch_dep(proc);
5cd83f
+	} else if (process_init_main(proc) < 0) {
5cd83f
 		process_bare_destroy(proc, 0);
5cd83f
 		goto fail;
5cd83f
 	}