This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [RFC] Change bin2c binary to target tool (was [RFA] Fix bin2c executable generation for cross-generation)
- From: Alan Modra <amodra at gmail dot com>
- To: Pierre Muller <pierre dot muller at ics-cnrs dot unistra dot fr>
- Cc: 'Ralf Wildenhues' <Ralf dot Wildenhues at gmx dot de>, 'Tristan Gingold' <gingold at adacore dot com>, binutils at sourceware dot org
- Date: Fri, 5 Nov 2010 21:19:23 +1030
- Subject: Re: [RFC] Change bin2c binary to target tool (was [RFA] Fix bin2c executable generation for cross-generation)
- References: <001e01cb7c35$11ca4290$355ec7b0$@muller@ics-cnrs.unistra.fr> <ACB7C5BA-C11C-400C-AC96-11C744BC5D4C@adacore.com> <002f01cb7c37$b2ca50c0$185ef240$@muller@ics-cnrs.unistra.fr> <68421137-DA11-403C-BA9A-90241AF64D94@adacore.com> <20101104184959.GD9168@gmx.de> <001201cb7cbe$a16df700$e449e500$@muller@ics-cnrs.unistra.fr>
On Fri, Nov 05, 2010 at 08:54:09AM +0100, Pierre Muller wrote:
> As it isn't used anymore
See ld/Makefile.am. I think Ralf's suggestion of simplifying bin2c
is the way to go.
* bin2c.c: Remove internationalization and version report.
* Makefile.am: Update bin2c rule.
* Makefile.in: Regenerate.
Index: binutils/bin2c.c
===================================================================
RCS file: /cvs/src/src/binutils/bin2c.c,v
retrieving revision 1.5
diff -u -p -r1.5 bin2c.c
--- binutils/bin2c.c 25 Aug 2008 04:38:13 -0000 1.5
+++ binutils/bin2c.c 5 Nov 2010 10:44:15 -0000
@@ -18,9 +18,9 @@
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
02110-1301, USA. */
-#include "sysdep.h"
-#include "bfd.h"
-#include "bucomm.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include "binary-io.h"
int
main (int argc, char *argv[])
@@ -28,19 +28,9 @@ main (int argc, char *argv[])
int c;
int i;
-#if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES)
- setlocale (LC_MESSAGES, "");
-#endif
-#if defined (HAVE_SETLOCALE)
- setlocale (LC_CTYPE, "");
-#endif
- bindtextdomain (PACKAGE, LOCALEDIR);
- textdomain (PACKAGE);
-
if (argc != 1)
{
int ishelp = 0;
- int isvers = 0;
FILE *stream;
if (argc == 2 && argv[1][0] == '-')
@@ -49,15 +39,11 @@ main (int argc, char *argv[])
if (*opt == '-')
++opt;
ishelp = *opt == 'h' || *opt == 'H';
- isvers = *opt == 'v' || *opt == 'V';
}
- if (isvers)
- print_version ("bin2c");
-
stream = ishelp ? stdout : stderr;
- fprintf (stream, _("Usage: %s < input_file > output_file\n"), argv[0]);
- fprintf (stream, _("Prints bytes from stdin in hex format.\n"));
+ fprintf (stream, "Usage: %s < input_file > output_file\n", argv[0]);
+ fprintf (stream, "Prints bytes from stdin in hex format.\n");
exit (!ishelp);
}
Index: binutils/Makefile.am
===================================================================
RCS file: /cvs/src/src/binutils/Makefile.am,v
retrieving revision 1.125
diff -u -p -r1.125 Makefile.am
--- binutils/Makefile.am 25 May 2010 14:02:38 -0000 1.125
+++ binutils/Makefile.am 5 Nov 2010 10:44:15 -0000
@@ -273,8 +273,8 @@ sysinfo.@OBJEXT@: sysinfo.c
$(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(NO_WERROR) $(srcdir)/sysinfo.c ; \
fi
-bin2c$(EXEEXT_FOR_BUILD): $(LIBINTL_DEP)
- $(CC_FOR_BUILD) -o $@ $(AM_CPPFLAGS) $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) $(srcdir)/bin2c.c $(srcdir)/version.c $(LIBINTL)
+bin2c$(EXEEXT_FOR_BUILD): bin2c.c
+ $(CC_FOR_BUILD) -o $@ $(AM_CPPFLAGS) $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) $(srcdir)/bin2c.c
embedspu: embedspu.sh
sed "s@^program_transform_name=@program_transform_name=$(program_transform_name)@" < $< > $@
--
Alan Modra
Australia Development Lab, IBM