From e787f858a43c9a6b54a74cec24f954b52619433e Mon Sep 17 00:00:00 2001
From: Mike Frysinger <vapier@gentoo.org>
Date: Sun, 12 Apr 2015 05:47:39 -0400
Subject: [PATCH] sim: arm/mips: fix sim_read/sim_write linkage errors

With sim-hrw.o being built & linked in the common list, some people are
getting linking errors now for these targets.  Move the main objects that
provide these functions before the common list to avoid that.
---
 sim/arm/ChangeLog    | 4 ++++
 sim/arm/Makefile.in  | 3 ++-
 sim/mips/ChangeLog   | 4 ++++
 sim/mips/Makefile.in | 2 +-
 4 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/sim/arm/ChangeLog b/sim/arm/ChangeLog
index 88d6c7a5f58..802e837bff7 100644
--- a/sim/arm/ChangeLog
+++ b/sim/arm/ChangeLog
@@ -1,3 +1,7 @@
+2015-04-12  Mike Frysinger  <vapier@gentoo.org>
+
+	* Makefile.in (SIM_OBJS): Move wrapper.o to the start of the list.
+
 2015-04-06  Mike Frysinger  <vapier@gentoo.org>
 
 	* Makefile.in (SIM_OBJS): Delete sim-engine.o.
diff --git a/sim/arm/Makefile.in b/sim/arm/Makefile.in
index 00c9bdf9509..5c3772308dc 100644
--- a/sim/arm/Makefile.in
+++ b/sim/arm/Makefile.in
@@ -20,11 +20,12 @@
 SIM_EXTRA_CFLAGS = -DMODET
 
 SIM_OBJS = \
+	wrapper.o \
 	$(SIM_NEW_COMMON_OBJS) \
 	sim-cpu.o \
 	sim-hload.o \
 	armemu26.o armemu32.o arminit.o armos.o armsupp.o \
-	armvirt.o bag.o thumbemu.o wrapper.o \
+	armvirt.o bag.o thumbemu.o \
 	armcopro.o maverick.o iwmmxt.o
 
 ## COMMON_POST_CONFIG_FRAG
diff --git a/sim/mips/ChangeLog b/sim/mips/ChangeLog
index 477c8c82987..d6a29c18686 100644
--- a/sim/mips/ChangeLog
+++ b/sim/mips/ChangeLog
@@ -1,3 +1,7 @@
+2015-04-12  Mike Frysinger  <vapier@gentoo.org>
+
+	* Makefile.in (SIM_OBJS): Move interp.o to the start of the list.
+
 2015-04-06  Mike Frysinger  <vapier@gentoo.org>
 
 	* Makefile.in (SIM_OBJS): Delete sim-engine.o.
diff --git a/sim/mips/Makefile.in b/sim/mips/Makefile.in
index 2016db3b2fd..17eeab6ae0e 100644
--- a/sim/mips/Makefile.in
+++ b/sim/mips/Makefile.in
@@ -40,10 +40,10 @@ SIM_MULTI_OBJ = itable.o @sim_multi_obj@
 MIPS_EXTRA_LIBS = @mips_extra_libs@
 
 SIM_OBJS = \
+	interp.o \
 	$(SIM_@sim_gen@_OBJ) \
 	$(SIM_NEW_COMMON_OBJS) \
 	cp1.o \
-	interp.o \
 	mdmx.o \
 	dsp.o \
 	sim-main.o \