]> git.wh0rd.org Git - elf2flt.git/commitdiff
Tweaked Makefile.in so that post-configured Makefile tests for a Cygwin build
authorJohn Williams <jwilliams@itee.uq.edu.au>
Tue, 3 May 2005 23:26:11 +0000 (23:26 +0000)
committerJohn Williams <jwilliams@itee.uq.edu.au>
Tue, 3 May 2005 23:26:11 +0000 (23:26 +0000)
environment, and if detected, explicitly adjusts the link order so that
libcygwin links *before* libiberty.a.  This gets around a Cygwin problem with
getopt()'s optind/optarg symbols.  See, for example:

http://sources.redhat.com/ml/cygwin/2004-04/msg01179.html

Also tweaked cygwin-elf.h and elf2flt.c so that Cygwin builds for MicroBlaze
target work as expected.

Patch sumbitted by John Williams <jwilliams@itee.uq.edu.au>

Makefile.in
cygwin-elf.h
elf2flt.c

index 4299302417ec29bc25351c150a65e6a81123f082..5a692a6ba0a63148007a8486e3c78a3ee5e19205 100644 (file)
@@ -20,6 +20,11 @@ DEFS = @DEFS@ -DTARGET_$(CPU)
 EXEEXT = @EXEEXT@
 OBJEXT = @OBJEXT@
 
+# force link order under cygwin to avoid getopts / libiberty clash
+ifneq ($(strip $(shell gcc -v 2>&1 | grep "cygwin")),)
+   LIBS := -lcygwin $(LIBS)
+endif
+
 CCFLAGS = $(CFLAGS) $(DEFS) $(INCLUDES)
 
 LDFILE= elf2flt.ld
index 9d91d7a0b0867607c3d307ddc603dcdbb0573e00..30faa9499be8b397641a5dba7a44ab33e704016b 100644 (file)
@@ -2091,4 +2091,21 @@ typedef Elf32_Addr Elf32_Conflict;
 
 #define R_CRIS_NUM             20
 
+#define R_MICROBLAZE_NONE              0
+#define R_MICROBLAZE_32                1
+#define R_MICROBLAZE_32_PCREL          2
+#define R_MICROBLAZE_64_PCREL          3
+#define R_MICROBLAZE_32_PCREL_LO       4
+#define R_MICROBLAZE_64                5
+#define R_MICROBLAZE_32_LO             6
+#define R_MICROBLAZE_SRO32             7
+#define R_MICROBLAZE_SRW32             8
+#define R_MICROBLAZE_64_NONE           9
+#define R_MICROBLAZE_32_SYM_OP_SYM     10
+#define R_MICROBLAZE_GNU_VTINHERIT     11
+#define R_MICROBLAZE_GNU_VTENTRY       12
+   
+#define R_MICROBLAZE_NUM               13
+
+
 #endif /* elf.h */
index c42a93b798c437927a3f0b49329f236f6a43ff5e..7844a7c9a5247f1e10e7497f5a3a63d0c537580d 100644 (file)
--- a/elf2flt.c
+++ b/elf2flt.c
 
 #if defined(TARGET_h8300)
 #include <elf/h8.h>      /* TARGET_* ELF support for the BFD library            */
-#elif defined(TARGET_microblaze)
-#include <elf/microblaze.h>    /* TARGET_* ELF support for the BFD library */
 #elif defined(__CYGWIN__)
 #include "cygwin-elf.h"        /* Cygwin uses a local copy */
+#elif defined(TARGET_microblaze)
+#include <elf/microblaze.h>    /* TARGET_* ELF support for the BFD library */
 #else
 #include <elf.h>      /* TARGET_* ELF support for the BFD library            */
 #endif