[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[microblaze-uclinux] [patch] elf2flt
Hi Dave/Greg,
Are you OK with the attached patch from one of the microblaze list folks?
Support for Win32 (e.g. not cygwin) builds of elf2flt.
Patch submitted by Scott Thibault <thibault@gmvhdl.com>
Thanks,
John
? Makefile
? busybox.dump
? busybox.elf
? busybox.elf.bflt
? busybox.reloc
? config.cache
? config.log
? config.patch
? config.status
? elf2flt
? elf2flt.c.save
? elf2flt.diff
? elf2flt.dump
? elf2flt.out
? elf2flt.win32.patch
? elf2flt@EXEEXT@
? flthdr
? flthdr@EXEEXT@
? ld-elf2flt
? out
? sh.bin
? sh.dump
? sh.elf
? sh.elf.bflt
? sh.flt
? sh.gdb
? sh.reloc
? sh.sym
Index: elf2flt.c
===================================================================
RCS file: /var/cvs/elf2flt/elf2flt.c,v
retrieving revision 1.28
diff -u -b -B -w -p -r1.28 elf2flt.c
--- elf2flt.c 28 Oct 2004 16:54:25 -0000 1.28
+++ elf2flt.c 7 Nov 2004 22:42:33 -0000
@@ -40,8 +40,11 @@
#include <unistd.h> /* Userland prototypes of the Unix std system calls */
#include <fcntl.h> /* Flag value for file handling functions */
#include <time.h>
-
+#ifndef WIN32
#include <netinet/in.h> /* Consts and structs defined by the internet system */
+#else
+#include <winsock2.h>
+#endif
/* from $(INSTALLDIR)/include */
#include <bfd.h> /* Main header file for the BFD library */
@@ -1686,9 +1689,9 @@ int main(int argc, char *argv[])
} \
} while (0)
- gf = fopen(ofile, "a");
+ gf = fopen(ofile, "ab"); /* Add 'b' to support non-posix (ie windows) */
if (!gf) {
- fprintf(stderr, "Can't opne file %s for writing\n", ofile); \
+ fprintf(stderr, "Can't open file %s for writing\n", ofile); \
exit(4);
}