* ar.c: Likewise.
* arsup.c: Likewise.
* arsup.h: Likewise.
* binemul.c: Likewise.
* binemul.h: Likewise.
* bucomm.c: Likewise.
* coffdump.c: Likewise.
* coffgrok.c: Likewise.
* coffgrok.h: Likewise.
+2002-05-19 Kazu Hirata <kazu@cs.umass.edu>
+
+ * addr2line.c: Fix formatting.
+ * ar.c: Likewise.
+ * arsup.c: Likewise.
+ * arsup.h: Likewise.
+ * binemul.c: Likewise.
+ * binemul.h: Likewise.
+ * bucomm.c: Likewise.
+ * coffdump.c: Likewise.
+ * coffgrok.c: Likewise.
+ * coffgrok.h: Likewise.
+
2002-05-16 Marek Michalkiewicz <marekm@amelek.gda.pl>
* MAINTAINERS: Add myself as the second AVR port maintainer.
/* Derived from objdump.c and nm.c by Ulrich.Lauther@mchp.siemens.de
- Usage:
+ Usage:
addr2line [options] addr addr ...
or
- addr2line [options]
+ addr2line [options]
both forms write results to stdout, the second form reads addresses
to be converted from stdin. */
if (optarg != NULL)
{
enum demangling_styles style;
-
+
style = cplus_demangle_name_to_style (optarg);
- if (style == unknown_demangling)
+ if (style == unknown_demangling)
fatal (_("unknown demangling style `%s'"),
optarg);
-
+
cplus_demangle_set_style (style);
- }
+ }
break;
case 'e':
filename = optarg;
{
++match_count;
if (counted_name_mode
- && match_count != counted_name_counter)
+ && match_count != counted_name_counter)
{
/* Counting, and didn't match on count; go on to the
next one. */
FILE *s;
s = help ? stdout : stderr;
-
+
if (! is_ranlib)
{
/* xgettext:c-format */
}
else
{
- /* xgettext:c-format */
+ /* xgettext:c-format */
fprintf (s, _("Usage: %s [options] archive\n"), program_name);
fprintf (s, _(" Generate an index to speed access to archives\n"));
fprintf (s, _(" The options are:\n\
temp = strrchr (program_name, '/');
#ifdef HAVE_DOS_BASED_FILE_SYSTEM
- {
- /* We could have foo/bar\\baz, or foo\\bar, or d:bar. */
- char *bslash = strrchr (program_name, '\\');
- if (temp == NULL || (bslash != NULL && bslash > temp))
- temp = bslash;
- if (temp == NULL && program_name[0] != '\0' && program_name[1] == ':')
- temp = program_name + 1;
- }
+ {
+ /* We could have foo/bar\\baz, or foo\\bar, or d:bar. */
+ char *bslash = strrchr (program_name, '\\');
+ if (temp == NULL || (bslash != NULL && bslash > temp))
+ temp = bslash;
+ if (temp == NULL && program_name[0] != '\0' && program_name[1] == ':')
+ temp = program_name + 1;
+ }
#endif
if (temp == NULL)
temp = program_name;
break;
argv += (i - 1);
argc -= (i - 1);
-
+
if (is_ranlib)
{
boolean touch = false;
if (postype != pos_default)
posname = argv[arg_index++];
- if (counted_name_mode)
+ if (counted_name_mode)
{
- if (operation != extract && operation != delete)
+ if (operation != extract && operation != delete)
fatal (_("`N' is only meaningful with the `x' and `d' options."));
counted_name_counter = atoi (argv[arg_index++]);
- if (counted_name_counter <= 0)
+ if (counted_name_counter <= 0)
fatal (_("Value for `N' must be positive."));
}
if (operation == quick_append)
{
/* Note that quick appending to a non-existent archive creates it,
- even if there are no files to append. */
+ even if there are no files to append. */
do_quick_append (inarch_filename, files);
xexit (0);
}
long ncopied = 0;
long size;
struct stat buf;
-
+
if (bfd_stat_arch_elt (abfd, &buf) != 0)
/* xgettext:c-format */
fatal (_("internal stat error on %s"), bfd_get_filename (abfd));
if (size < 0)
/* xgettext:c-format */
fatal (_("stat returns negative size for %s"), bfd_get_filename (abfd));
-
+
if (verbose)
printf ("x - %s\n", bfd_get_filename (abfd));
while (*current_ptr_ptr)
{
if (FILENAME_CMP (normalize (*files_to_delete, arch),
- (*current_ptr_ptr)->filename) == 0)
+ (*current_ptr_ptr)->filename) == 0)
{
++match_count;
if (counted_name_mode
- && match_count != counted_name_counter)
+ && match_count != counted_name_counter)
{
/* Counting, and didn't match on count; go on to the
next one. */
after_bfd = get_pos_bfd (&arch->next, pos_after,
current->filename);
- if (ar_emul_replace (after_bfd, *files_to_move,
+ if (ar_emul_replace (after_bfd, *files_to_move,
verbose))
{
/* Snip out this entry from the chain. */
boolean found = false;
bfd *prev = arch;
- for (head = arch->next; head; head = head->next)
+ for (head = arch->next; head; head = head->next)
{
if (head->filename != NULL
&& FILENAME_CMP (ptr->name, head->filename) == 0)
output = 0;
}
}
- else
+ else
outfile = stdout;
map_over_list (arch, ar_directory_doer, list);
DEFUN_VOID(prompt)
{
extern int interactive;
- if (interactive)
+ if (interactive)
{
printf("AR >");
- fflush(stdout);
+ fflush(stdout);
}
}
void
maybequit ()
{
- if (! interactive)
+ if (! interactive)
xexit (9);
}
bfd *obfd;
-char *real_name ;
+char *real_name ;
void
DEFUN(ar_open,(name, t),
char *name AND
fprintf(stderr, _("%s: no open output archive\n"), program_name);
maybequit();
}
- else
+ else
{
while (list) {
bfd *abfd = bfd_openr(list->name, NULL);
void
DEFUN_VOID(ar_clear)
{
-if (obfd)
+if (obfd)
obfd->archive_head = 0;
}
fprintf(stderr, _("%s: no open output archive\n"), program_name);
maybequit();
}
- else
+ else
{
while (list) {
/* Find this name in the archive */
else {
char *ofilename = xstrdup (bfd_get_filename (obfd));
bfd_close(obfd);
-
+
rename (ofilename, real_name);
obfd = 0;
free(ofilename);
fprintf(stderr, _("%s: no open output archive\n"), program_name);
maybequit();
}
- else
+ else
{
while (list) {
/* Find this name in the archive */
bfd *member = obfd->archive_head;
bfd **prev = &(obfd->archive_head);
int found = 0;
- while (member)
+ while (member)
{
- if (FILENAME_CMP(member->filename, list->name) == 0)
+ if (FILENAME_CMP(member->filename, list->name) == 0)
{
/* Found the one to replace */
bfd *abfd = bfd_openr(list->name, 0);
- if (!abfd)
+ if (!abfd)
{
fprintf(stderr, _("%s: can't open file %s\n"), program_name, list->name);
maybequit();
bfd *abfd = bfd_openr(list->name, 0);
fprintf(stderr,_("%s: can't find module file %s\n"), program_name,
list->name);
- if (!abfd)
+ if (!abfd)
{
fprintf(stderr, _("%s: can't open file %s\n"), program_name, list->name);
maybequit();
}
- else
+ else
{
*prev = abfd;
}
void
DEFUN_VOID(ar_list)
{
- if (!obfd)
+ if (!obfd)
{
fprintf(stderr, _("%s: no open output archive\n"), program_name);
maybequit();
printf(_("Current open archive is %s\n"), bfd_get_filename (obfd));
for (abfd = obfd->archive_head;
abfd != (bfd *)NULL;
- abfd = abfd->next)
+ abfd = abfd->next)
{
ar_directory_doer (abfd, (bfd *) NULL);
}
}
-void
+void
DEFUN_VOID(ar_end)
{
if (obfd)
DEFUN(ar_extract,(list),
struct list *list)
{
- if (!obfd)
+ if (!obfd)
{
fprintf(stderr, _("%s: no open archive\n"), program_name);
maybequit();
}
- else
+ else
{
while (list) {
/* Find this name in the archive */
bfd *member = obfd->archive_head;
int found = 0;
- while (member && !found)
+ while (member && !found)
{
- if (FILENAME_CMP(member->filename, list->name) == 0)
+ if (FILENAME_CMP(member->filename, list->name) == 0)
{
extract_file(member);
found = 1;
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
struct list {
- char *name;
+ char *name;
struct list *next;
};
char *file_name;
{
if (bin_dummy_emulation.ar_create)
- return bin_dummy_emulation.ar_create (abfd_out, archive_file_name,
+ return bin_dummy_emulation.ar_create (abfd_out, archive_file_name,
file_name);
return false;
#define AR_EMUL_REPLACE_PRINT_VERBOSE(verbose, file_name) \
do { if (verbose) printf ("r - %s\n", file_name); } while (0)
-typedef struct bin_emulation_xfer_struct
+typedef struct bin_emulation_xfer_struct
{
/* Print out the extra options. */
void (* ar_usage) PARAMS ((FILE *fp));
}
bin_emulation_xfer_type;
-#endif
+#endif
const char *end;
ret = bfd_scan_vma (s, &end, 0);
-
+
if (*end != '\0')
fatal (_("%s: bad number: %s"), arg, s);
tab (1);
printf (_("#lines %d "),p->nlines);
- for (i = 0; i < p->nlines; i++)
+ for (i = 0; i < p->nlines; i++)
{
printf ("(%d 0x%x)", p->lines[i], p->addresses[i]);
switch (p->type)
{
case coff_secdef_type:
- printf ("section definition at %x size %x\n",
+ printf ("section definition at %x size %x\n",
p->u.asecdef.address,
p->u.asecdef.size);
nl ();
int i;
tab (1);
- printf ("section %s %d %d address %x size %x number %d nrelocs %d",
+ printf ("section %s %d %d address %x size %x number %d nrelocs %d",
ptr->name, ptr->code, ptr->data, ptr->address,ptr->size,
ptr->number, ptr->nrelocs);
nl ();
- for (i = 0; i < ptr->nrelocs; i++)
+ for (i = 0; i < ptr->nrelocs; i++)
{
- tab (0);
+ tab (0);
printf ("(%x %s %x)",
ptr->relocs[i].offset,
ptr->relocs[i].symbol->name,
if (relsize < 0)
bfd_fatal (bfd_get_filename (abfd));
if (relsize == 0)
- continue;
+ continue;
relpp = (arelent **) xmalloc (relsize);
relcount = bfd_canonicalize_reloc (abfd, section, relpp, syms);
if (relcount < 0)
/* These lines are for this function - so count them and stick them on */
int c = 0;
/* Find the linenumber of the top of the function, since coff linenumbers
- are relative to the start of the function. */
+ are relative to the start of the function. */
int start_line = rawsyms[i + 3].u.auxent.x_sym.x_misc.x_lnsz.x_lnno;
l++;
int i;
int infile = 0;
struct coff_ofile *head =
- (struct coff_ofile *) xmalloc (sizeof (struct coff_ofile));
+ (struct coff_ofile *) xmalloc (sizeof (struct coff_ofile));
ofile = head;
head->source_head = 0;
head->source_tail = 0;
-/* coffgrok.h
+/* coffgrok.h
Copyright 2001 Free Software Foundation, Inc.
This file is part of GNU Binutils.
int addend;
};
- struct coff_section
+ struct coff_section
{
char *name;
int code;
/* Vector which maps where in each output section
the input file has it's data */
- struct coff_isection *section;
+ struct coff_isection *section;
};
} type;
union
{
- struct
+ struct
{
int address;
int size;
};
- struct coff_line
+ struct coff_line
{
int nlines;
int *lines;
coff_vis_tag,
coff_vis_member_of_struct,
coff_vis_member_of_enum,
- coff_vis_autoparam,
+ coff_vis_autoparam,
coff_vis_regparam,
} type;
};