static void setup_section PARAMS ((bfd *, asection *, PTR));
static void copy_section PARAMS ((bfd *, asection *, PTR));
static void get_sections PARAMS ((bfd *, asection *, PTR));
-static int compare_section_vma PARAMS ((const PTR, const PTR));
+static int compare_section_lma PARAMS ((const PTR, const PTR));
static void add_specific_symbol PARAMS ((const char *, struct symlist **));
static boolean is_specified_symbol PARAMS ((const char *, struct symlist *));
static boolean is_strip_section PARAMS ((bfd *, asection *));
static int interleave = 4;
static boolean verbose; /* Print file and target names. */
+static boolean preserve_dates; /* Preserve input file timestamp. */
static int status = 0; /* Exit status. */
enum strip_action
FILE *stream;
int exit_status;
{
- fprintf (stream, "\
+ fprintf (stream, _("\
Usage: %s [-vVSpgxX] [-I bfdname] [-O bfdname] [-F bfdname] [-b byte]\n\
[-R section] [-i interleave] [--interleave=interleave] [--byte=byte]\n\
[--input-target=bfdname] [--output-target=bfdname] [--target=bfdname]\n\
[--strip-all] [--strip-debug] [--strip-unneeded] [--discard-all]\n\
- [--discard-locals] [--debugging] [--remove-section=section]\n",
+ [--discard-locals] [--debugging] [--remove-section=section]\n"),
program_name);
- fprintf (stream, "\
+ fprintf (stream, _("\
[--gap-fill=val] [--pad-to=address] [--preserve-dates]\n\
[--set-start=val] [--adjust-start=incr]\n\
[--adjust-vma=incr] [--adjust-section-vma=section{=,+,-}val]\n\
[--keep-symbol symbol] [-K symbol] [--strip-symbol symbol] [-N symbol]\n\
[--localize-symbol symbol] [-L symbol] [--weaken-symbol symbol]\n\
[-W symbol] [--change-leading-char] [--remove-leading-char] [--weaken]\n\
- [--verbose] [--version] [--help] in-file [out-file]\n");
+ [--verbose] [--version] [--help] in-file [out-file]\n"));
list_supported_targets (program_name, stream);
if (exit_status == 0)
- fprintf (stream, "Report bugs to bug-gnu-utils@gnu.org\n");
+ fprintf (stream, _("Report bugs to bug-gnu-utils@gnu.org\n"));
exit (exit_status);
}
FILE *stream;
int exit_status;
{
- fprintf (stream, "\
+ fprintf (stream, _("\
Usage: %s [-vVsSpgxX] [-I bfdname] [-O bfdname] [-F bfdname] [-R section]\n\
[--input-target=bfdname] [--output-target=bfdname] [--target=bfdname]\n\
[--strip-all] [--strip-debug] [--strip-unneeded] [--discard-all]\n\
[--discard-locals] [--keep-symbol symbol] [-K symbol]\n\
[--strip-symbol symbol] [-N symbol] [--remove-section=section]\n\
- [-o file] [--preserve-dates] [--verbose] [--version] [--help] file...\n",
+ [-o file] [--preserve-dates] [--verbose] [--version] [--help] file...\n"),
program_name);
list_supported_targets (program_name, stream);
if (exit_status == 0)
- fprintf (stream, "Report bugs to bug-gnu-utils@gnu.org\n");
+ fprintf (stream, _("Report bugs to bug-gnu-utils@gnu.org\n"));
exit (exit_status);
}
copy = xmalloc (len + 1);
strncpy (copy, s, len);
copy[len] = '\0';
- fprintf (stderr, "%s: unrecognized section flag `%s'\n",
+ fprintf (stderr, _("%s: unrecognized section flag `%s'\n"),
program_name, copy);
fprintf (stderr,
- "%s: supported flags: alloc, load, readonly, code, data, rom, contents\n",
+ _("%s: supported flags: alloc, load, readonly, code, data, rom, contents\n"),
program_name);
exit (1);
}
}
if (verbose)
- printf ("copy from %s(%s) to %s(%s)\n",
+ printf (_("copy from %s(%s) to %s(%s)\n"),
bfd_get_filename(ibfd), bfd_get_target(ibfd),
bfd_get_filename(obfd), bfd_get_target(obfd));
bfd_get_mach (ibfd)))
{
fprintf (stderr,
- "Warning: Output file cannot represent architecture %s\n",
+ _("Warning: Output file cannot represent architecture %s\n"),
bfd_printable_arch_mach (bfd_get_arch (ibfd),
bfd_get_mach (ibfd)));
}
padd->section = bfd_make_section (obfd, padd->name);
if (padd->section == NULL)
{
- fprintf (stderr, "%s: can't create section `%s': %s\n",
+ fprintf (stderr, _("%s: can't create section `%s': %s\n"),
program_name, padd->name,
bfd_errmsg (bfd_get_error ()));
status = 1;
set = osections;
bfd_map_over_sections (obfd, get_sections, (void *) &set);
- qsort (osections, c, sizeof (asection *), compare_section_vma);
+ qsort (osections, c, sizeof (asection *), compare_section_lma);
gaps = (bfd_size_type *) xmalloc (c * sizeof (bfd_size_type));
memset (gaps, 0, c * sizeof (bfd_size_type));
continue;
size = bfd_section_size (obfd, osections[i]);
- gap_start = bfd_section_vma (obfd, osections[i]) + size;
- gap_stop = bfd_section_vma (obfd, osections[i + 1]);
+ gap_start = bfd_section_lma (obfd, osections[i]) + size;
+ gap_stop = bfd_section_lma (obfd, osections[i + 1]);
if (gap_start < gap_stop)
{
if (! bfd_set_section_size (obfd, osections[i],
size + (gap_stop - gap_start)))
{
- fprintf (stderr, "%s: Can't fill gap after %s: %s\n",
+ fprintf (stderr, _("%s: Can't fill gap after %s: %s\n"),
program_name,
bfd_get_section_name (obfd, osections[i]),
bfd_errmsg (bfd_get_error()));
if (pad_to_set)
{
- bfd_vma vma;
+ bfd_vma lma;
bfd_size_type size;
- vma = bfd_section_vma (obfd, osections[c - 1]);
+ lma = bfd_section_lma (obfd, osections[c - 1]);
size = bfd_section_size (obfd, osections[c - 1]);
- if (vma + size < pad_to)
+ if (lma + size < pad_to)
{
if (! bfd_set_section_size (obfd, osections[c - 1],
- pad_to - vma))
+ pad_to - lma))
{
- fprintf (stderr, "%s: Can't add padding to %s: %s\n",
+ fprintf (stderr, _("%s: Can't add padding to %s: %s\n"),
program_name,
bfd_get_section_name (obfd, osections[c - 1]),
bfd_errmsg (bfd_get_error ()));
}
else
{
- gaps[c - 1] = pad_to - (vma + size);
- if (max_gap < pad_to - (vma + size))
- max_gap = pad_to - (vma + size);
+ gaps[c - 1] = pad_to - (lma + size);
+ if (max_gap < pad_to - (lma + size))
+ max_gap = pad_to - (lma + size);
}
}
- }
+ }
}
/* Symbol filtering must happen after the output sections have
important for the ECOFF code at least. */
if (!bfd_copy_private_bfd_data (ibfd, obfd))
{
- fprintf (stderr, "%s: %s: error copying private BFD data: %s\n",
+ fprintf (stderr, _("%s: %s: error copying private BFD data: %s\n"),
program_name, bfd_get_filename (obfd),
bfd_errmsg (bfd_get_error ()));
status = 1;
if (mkdir (dir, 0700) != 0)
#endif
{
- fatal ("cannot mkdir %s for archive copying (error: %s)",
+ fatal (_("cannot mkdir %s for archive copying (error: %s)"),
dir, strerror (errno));
}
obfd->has_armap = ibfd->has_armap;
return;
loser:
- fprintf (stderr, "%s: %s: section `%s': error in %s: %s\n",
+ fprintf (stderr, _("%s: %s: section `%s': error in %s: %s\n"),
program_name,
bfd_get_filename (ibfd), bfd_section_name (ibfd, isection),
err, bfd_errmsg (bfd_get_error ()));
sections to the front, where they are easier to ignore. */
static int
-compare_section_vma (arg1, arg2)
+compare_section_lma (arg1, arg2)
const PTR arg1;
const PTR arg2;
{
return 1;
}
- /* Sort sections by VMA. */
- if ((*sec1)->vma > (*sec2)->vma)
+ /* Sort sections by LMA. */
+ if ((*sec1)->lma > (*sec2)->lma)
return 1;
- else if ((*sec1)->vma < (*sec2)->vma)
+ else if ((*sec1)->lma < (*sec2)->lma)
return -1;
- /* Sort sections with the same VMA by size. */
+ /* Sort sections with the same LMA by size. */
if ((*sec1)->_raw_size > (*sec2)->_raw_size)
return 1;
else if ((*sec1)->_raw_size < (*sec2)->_raw_size)
| SEC_READONLY
| SEC_DEBUGGING)))
{
- fprintf (stderr, "%s: can't create debugging section: %s\n",
+ fprintf (stderr, _("%s: can't create debugging section: %s\n"),
bfd_get_filename (obfd), bfd_errmsg (bfd_get_error ()));
return false;
}
|| ! bfd_set_section_contents (obfd, stabstrsec, strings,
(file_ptr) 0, stringsize))
{
- fprintf (stderr, "%s: can't set debugging section contents: %s\n",
+ fprintf (stderr, _("%s: can't set debugging section contents: %s\n"),
bfd_get_filename (obfd), bfd_errmsg (bfd_get_error ()));
return false;
}
}
fprintf (stderr,
- "%s: don't know how to write debugging information for %s\n",
+ _("%s: don't know how to write debugging information for %s\n"),
bfd_get_filename (obfd), bfd_get_target (obfd));
return false;
}
errno = saved;
perror ("simple_copy");
}
+ if (preserve_dates)
+ set_times (to, &s);
unlink (from);
}
#endif /* _WIN32 && !__CYGWIN32__ */
if (result != 0)
{
fprintf (stderr, "%s: ", destination);
- perror ("can not set time");
+ perror (_("can not set time"));
}
}
{
char *input_target = NULL, *output_target = NULL;
boolean show_version = false;
- boolean preserve_dates = false;
int c, i;
struct section_list *p;
char *output_file = NULL;
if (stat (argv[i], &statbuf) < 0)
{
fprintf (stderr, "%s: ", argv[i]);
- perror ("cannot stat");
+ perror (_("cannot stat"));
continue;
}
}
char *input_target = NULL, *output_target = NULL;
boolean show_version = false;
boolean adjust_warn = true;
- boolean preserve_dates = false;
int c;
struct section_list *p;
struct stat statbuf;
copy_byte = atoi(optarg);
if (copy_byte < 0)
{
- fprintf (stderr, "%s: byte number must be non-negative\n",
+ fprintf (stderr, _("%s: byte number must be non-negative\n"),
program_name);
exit (1);
}
interleave = atoi(optarg);
if (interleave < 1)
{
- fprintf(stderr, "%s: interleave must be positive\n",
+ fprintf(stderr, _("%s: interleave must be positive\n"),
program_name);
exit (1);
}
if (s == NULL)
{
fprintf (stderr,
- "%s: bad format for --add-section NAME=FILENAME\n",
+ _("%s: bad format for --add-section NAME=FILENAME\n"),
program_name);
exit (1);
}
if (fread (pa->contents, 1, pa->size, f) == 0
|| ferror (f))
{
- fprintf (stderr, "%s: %s: fread failed\n",
+ fprintf (stderr, _("%s: %s: fread failed\n"),
program_name, pa->filename);
exit (1);
}
if (s == NULL)
{
fprintf (stderr,
- "%s: bad format for --adjust-section-vma\n",
+ _("%s: bad format for --adjust-section-vma\n"),
program_name);
exit (1);
}
gap_fill = (bfd_byte) gap_fill_vma;
if ((bfd_vma) gap_fill != gap_fill_vma)
{
- fprintf (stderr, "%s: warning: truncating gap-fill from 0x",
+ fprintf (stderr, _("%s: warning: truncating gap-fill from 0x"),
program_name);
fprintf_vma (stderr, gap_fill_vma);
fprintf (stderr, "to 0x%x\n", (unsigned int) gap_fill);
s = strchr (optarg, '=');
if (s == NULL)
{
- fprintf (stderr, "%s: bad format for --set-section-flags\n",
+ fprintf (stderr, _("%s: bad format for --set-section-flags\n"),
program_name);
exit (1);
}
if (copy_byte >= interleave)
{
- fprintf (stderr, "%s: byte number must be less than interleave\n",
+ fprintf (stderr, _("%s: byte number must be less than interleave\n"),
program_name);
exit (1);
}
if (stat (input_filename, &statbuf) < 0)
{
fprintf (stderr, "%s: ", input_filename);
- perror ("cannot stat");
+ perror (_("cannot stat"));
exit (1);
}
}
{
if (! p->used && p->adjust != ignore_vma)
{
- fprintf (stderr, "%s: warning: --adjust-section-vma %s%c0x",
+ fprintf (stderr, _("%s: warning: --adjust-section-vma %s%c0x"),
program_name, p->name,
p->adjust == set_vma ? '=' : '+');
fprintf_vma (stderr, p->val);
- fprintf (stderr, " never used\n");
+ fprintf (stderr, _(" never used\n"));
}
}
}
int argc;
char *argv[];
{
+ setlocale (LC_MESSAGES, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+
program_name = argv[0];
xmalloc_set_program_name (program_name);