[svn:parrot] r38209 - trunk/src

Infinoid at svn.parrot.org Infinoid at svn.parrot.org
Sun Apr 19 14:24:50 UTC 2009


Author: Infinoid
Date: Sun Apr 19 14:24:49 2009
New Revision: 38209
URL: https://trac.parrot.org/parrot/changeset/38209

Log:
[ppc] Move the TT #512 fix down a bit, it needs to be below the inclusion of <elf.h>.
Patch courtesy of heidnes++.

Modified:
   trunk/src/exec_save.c

Modified: trunk/src/exec_save.c
==============================================================================
--- trunk/src/exec_save.c	Sun Apr 19 13:56:34 2009	(r38208)
+++ trunk/src/exec_save.c	Sun Apr 19 14:24:49 2009	(r38209)
@@ -30,26 +30,6 @@
 static void save_short(FILE *fp, short s);
 static void save_struct(FILE *fp, void *sp, size_t size);
 
-#if defined(PARROT_PPC)
-#  if !defined(R_PPC_ADDR16_HI) && !defined(R_PPC_ADDR16_LO) && \
-       defined(R_PPC_16_HI) && defined(R_PPC_16_LO)
-#    define	R_PPC_ADDR16_HI	R_PPC_16_HI
-#    define	R_PPC_ADDR16_LO	R_PPC_16_LO
-#  endif
-   /*
-    * NetBSD/powerpc 3.x and OpenBSD/powerpc doesn't define these constants,
-    * but instead has them as enums, so add some workarounds for those.
-    */
-#  if !defined(R_PPC_ADDR16_HI) && !defined(R_PPC_ADDR16_LO) && \
-       (defined(__NetBSD__) || defined(__OpenBSD__))
-#    define	R_PPC_ADDR16_HI RELOC_16_HI
-#    define	R_PPC_ADDR16_LO RELOC_16_LO
-#  endif
-#  if !defined(R_PPC_REL24) && (defined(__NetBSD__) || defined(__OpenBSD__))
-#    define	R_PPC_REL24	RELOC_REL24
-#  endif
-#endif /* PARROT_PPC */
-
 #ifdef EXEC_A_OUT
 
 #  include <a.out.h>
@@ -170,6 +150,26 @@
 #    include <elf.h>
 #  endif
 
+#  if defined(PARROT_PPC)
+#    if !defined(R_PPC_ADDR16_HI) && !defined(R_PPC_ADDR16_LO) && \
+         defined(R_PPC_16_HI) && defined(R_PPC_16_LO)
+#      define	R_PPC_ADDR16_HI	R_PPC_16_HI
+#      define	R_PPC_ADDR16_LO	R_PPC_16_LO
+#    endif
+     /*
+      * NetBSD/powerpc 3.x and OpenBSD/powerpc doesn't define these constants,
+      * but instead has them as enums, so add some workarounds for those.
+      */
+#    if !defined(R_PPC_ADDR16_HI) && !defined(R_PPC_ADDR16_LO) && \
+         (defined(__NetBSD__) || defined(__OpenBSD__))
+#      define	R_PPC_ADDR16_HI RELOC_16_HI
+#      define	R_PPC_ADDR16_LO RELOC_16_LO
+#    endif
+#    if !defined(R_PPC_REL24) && (defined(__NetBSD__) || defined(__OpenBSD__))
+#      define	R_PPC_REL24	RELOC_REL24
+#    endif
+#  endif /* PARROT_PPC */
+
 /* Add a section to the file
  *
  * n = Name


More information about the parrot-commits mailing list