* filemode.c: Fix formatting.

* ieee.c: Likewise.
	* is-ranlib.c: Likewise.
	* is-strip.c: Likewise.
	* maybe-ranlib.c: Likewise.
	* maybe-strip.c: Likewise.
	* nlmconv.c: Likewise.
	* nm.c: Likewise.
	* not-ranlib.c: Likewise.
	* not-strip.c: Likewise.
	* objcopy.c: Likewise.
	* objdump.c: Likewise.
This commit is contained in:
Kazu Hirata 2002-05-21 19:34:58 +00:00
parent 21611032e1
commit 0af11b59ba
13 changed files with 126 additions and 111 deletions

View file

@ -1,3 +1,18 @@
2002-05-21 Kazu Hirata <kazu@cs.umass.edu>
* filemode.c: Fix formatting.
* ieee.c: Likewise.
* is-ranlib.c: Likewise.
* is-strip.c: Likewise.
* maybe-ranlib.c: Likewise.
* maybe-strip.c: Likewise.
* nlmconv.c: Likewise.
* nm.c: Likewise.
* not-ranlib.c: Likewise.
* not-strip.c: Likewise.
* objcopy.c: Likewise.
* objdump.c: Likewise.
2002-05-21 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de> 2002-05-21 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
* objdump.c (dump_headers): Fix output formatting for ELF32 * objdump.c (dump_headers): Fix output formatting for ELF32

View file

@ -57,7 +57,7 @@ static void setst PARAMS ((unsigned long, char *));
9 'x' if any user may execute, 't' if the file is "sticky" 9 'x' if any user may execute, 't' if the file is "sticky"
(will be retained in swap space after execution), '-' (will be retained in swap space after execution), '-'
otherwise. otherwise.
'T' if the file is sticky but not executable. */ 'T' if the file is sticky but not executable. */
#if 0 #if 0
@ -115,7 +115,7 @@ filemodestring (statp, str)
#endif #endif
/* Like filemodestring, but only the relevant part of the `struct stat' /* Like filemodestring, but only the relevant part of the `struct stat'
is given as an argument. */ is given as an argument. */
void void
mode_string (mode, str) mode_string (mode, str)
@ -144,7 +144,7 @@ mode_string (mode, str)
'l' for symbolic links 'l' for symbolic links
's' for sockets 's' for sockets
'p' for fifos 'p' for fifos
'-' for any other file type. */ '-' for any other file type. */
#ifndef S_ISDIR #ifndef S_ISDIR
#ifdef S_IFDIR #ifdef S_IFDIR
@ -227,7 +227,7 @@ ftypelet (bits)
} }
/* Set the 's' and 't' flags in file attributes string CHARS, /* Set the 's' and 't' flags in file attributes string CHARS,
according to the file mode BITS. */ according to the file mode BITS. */
static void static void
setst (bits, chars) setst (bits, chars)
@ -238,7 +238,7 @@ setst (bits, chars)
if (bits & S_ISUID) if (bits & S_ISUID)
{ {
if (chars[3] != 'x') if (chars[3] != 'x')
/* Set-uid, but not executable by owner. */ /* Set-uid, but not executable by owner. */
chars[3] = 'S'; chars[3] = 'S';
else else
chars[3] = 's'; chars[3] = 's';
@ -248,7 +248,7 @@ setst (bits, chars)
if (bits & S_ISGID) if (bits & S_ISGID)
{ {
if (chars[6] != 'x') if (chars[6] != 'x')
/* Set-gid, but not executable by group. */ /* Set-gid, but not executable by group. */
chars[6] = 'S'; chars[6] = 'S';
else else
chars[6] = 's'; chars[6] = 's';
@ -258,7 +258,7 @@ setst (bits, chars)
if (bits & S_ISVTX) if (bits & S_ISVTX)
{ {
if (chars[9] != 'x') if (chars[9] != 'x')
/* Sticky, but not executable by others. */ /* Sticky, but not executable by others. */
chars[9] = 'T'; chars[9] = 'T';
else else
chars[9] = 't'; chars[9] = 't';

View file

@ -344,7 +344,7 @@ ieee_read_number (info, pp, pv)
} }
/* Read a number in an IEEE file. If ppresent is not NULL, the number /* Read a number in an IEEE file. If ppresent is not NULL, the number
need not be there. */ need not be there. */
static boolean static boolean
ieee_read_optional_number (info, pp, pv, ppresent) ieee_read_optional_number (info, pp, pv, ppresent)
@ -1036,7 +1036,7 @@ parse_ieee_bb (info, pp)
case 2: case 2:
/* BB2: Global type definitions. The name is supposed to be /* BB2: Global type definitions. The name is supposed to be
empty, but we don't check. */ empty, but we don't check. */
if (! debug_set_filename (info->dhandle, "*global*")) if (! debug_set_filename (info->dhandle, "*global*"))
return false; return false;
info->saw_filename = true; info->saw_filename = true;
@ -6207,7 +6207,7 @@ ieee_end_struct_type (p)
/* If we were ignoring this struct definition because it was a /* If we were ignoring this struct definition because it was a
duplicate defintion, just through away whatever bytes we have duplicate defintion, just through away whatever bytes we have
accumulated. Leave the type on the stack. */ accumulated. Leave the type on the stack. */
if (info->type_stack->type.ignorep) if (info->type_stack->type.ignorep)
return true; return true;
@ -6761,7 +6761,7 @@ ieee_tag_type (p, name, id, kind)
if (! nt->type.localp) if (! nt->type.localp)
{ {
/* This is a duplicate of a global type, so it must be /* This is a duplicate of a global type, so it must be
local. */ local. */
localp = true; localp = true;
} }
} }

View file

@ -1,3 +1,3 @@
/* Linked with ar.o to flag that this program is 'ranlib' (not 'ar'). */ /* Linked with ar.o to flag that this program is 'ranlib' (not 'ar'). */
int is_ranlib = 1; int is_ranlib = 1;

View file

@ -1,4 +1,4 @@
/* Linked with objcopy.o to flag that this program is 'strip' (not /* Linked with objcopy.o to flag that this program is 'strip' (not
'objcopy'). */ 'objcopy'). */
int is_strip = 1; int is_strip = 1;

View file

@ -1,4 +1,4 @@
/* Linked with ar.o to flag that this program decides at runtime /* Linked with ar.o to flag that this program decides at runtime
(using argv[0] if it is is 'ar' or 'ranlib'. */ (using argv[0] if it is is 'ar' or 'ranlib'. */
int is_ranlib = -1; int is_ranlib = -1;

View file

@ -1,4 +1,4 @@
/* Linked with objcopy.o to flag that this program decides at runtime /* Linked with objcopy.o to flag that this program decides at runtime
(using argv[0] if it is is 'strip' or 'objcopy'. */ (using argv[0] if it is is 'strip' or 'objcopy'. */
int is_strip = -1; int is_strip = -1;

View file

@ -559,7 +559,7 @@ main (argc, argv)
sym->section = got_sec->output_section; sym->section = got_sec->output_section;
} }
#endif #endif
} }
/* If this is a global symbol, check the export list. */ /* If this is a global symbol, check the export list. */
if ((sym->flags & (BSF_EXPORT | BSF_GLOBAL)) != 0) if ((sym->flags & (BSF_EXPORT | BSF_GLOBAL)) != 0)

View file

@ -448,7 +448,7 @@ main (argc, argv)
optarg); optarg);
cplus_demangle_set_style (style); cplus_demangle_set_style (style);
} }
break; break;
case 'D': case 'D':
dynamic = 1; dynamic = 1;

View file

@ -1,3 +1,3 @@
/* Linked with ar.o to flag that this program is 'ar' (not 'ranlib'). */ /* Linked with ar.o to flag that this program is 'ar' (not 'ranlib'). */
int is_ranlib = 0; int is_ranlib = 0;

View file

@ -1,4 +1,4 @@
/* Linked with objcopy.o to flag that this program is 'objcopy' (not /* Linked with objcopy.o to flag that this program is 'objcopy' (not
'strip'). */ 'strip'). */
int is_strip = 0; int is_strip = 0;

View file

@ -32,7 +32,7 @@
/* A list of symbols to explicitly strip out, or to keep. A linked /* A list of symbols to explicitly strip out, or to keep. A linked
list is good enough for a small number from the command line, but list is good enough for a small number from the command line, but
this will slow things down a lot if many symbols are being this will slow things down a lot if many symbols are being
deleted. */ deleted. */
struct symlist struct symlist
{ {
@ -97,7 +97,7 @@ static asymbol **osympp = NULL; /* Output symbols that survive stripping */
static int copy_byte = -1; static int copy_byte = -1;
static int interleave = 4; static int interleave = 4;
static boolean verbose; /* Print file and target names. */ static boolean verbose; /* Print file and target names. */
static boolean preserve_dates; /* Preserve input file timestamp. */ static boolean preserve_dates; /* Preserve input file timestamp. */
static int status = 0; /* Exit status. */ static int status = 0; /* Exit status. */
@ -110,7 +110,7 @@ enum strip_action
STRIP_ALL /* strip all symbols */ STRIP_ALL /* strip all symbols */
}; };
/* Which symbols to remove. */ /* Which symbols to remove. */
static enum strip_action strip_symbols; static enum strip_action strip_symbols;
enum locals_action enum locals_action
@ -339,7 +339,7 @@ extern char *program_name;
/* This flag distinguishes between strip and objcopy: /* This flag distinguishes between strip and objcopy:
1 means this is 'strip'; 0 means this is 'objcopy'. 1 means this is 'strip'; 0 means this is 'objcopy'.
-1 means if we should use argv[0] to decide. */ -1 means if we should use argv[0] to decide. */
extern int is_strip; extern int is_strip;
/* The maximum length of an S record. This variable is declared in srec.c /* The maximum length of an S record. This variable is declared in srec.c
@ -564,7 +564,7 @@ add_specific_symbol (name, list)
*list = tmp_list; *list = tmp_list;
} }
/* Add symbols listed in `filename' to strip_specific_list. */ /* Add symbols listed in `filename' to strip_specific_list. */
#define IS_WHITESPACE(c) ((c) == ' ' || (c) == '\t') #define IS_WHITESPACE(c) ((c) == ' ' || (c) == '\t')
#define IS_LINE_TERMINATOR(c) ((c) == '\n' || (c) == '\r' || (c) == '\0') #define IS_LINE_TERMINATOR(c) ((c) == '\n' || (c) == '\r' || (c) == '\0')
@ -653,8 +653,8 @@ add_specific_symbols (filename, list)
for (name_end = name; for (name_end = name;
(! IS_WHITESPACE (* name_end)) (! IS_WHITESPACE (* name_end))
&& (! IS_LINE_TERMINATOR (* name_end)); && (! IS_LINE_TERMINATOR (* name_end));
name_end ++) name_end ++)
; ;
if (! IS_LINE_TERMINATOR (* name_end)) if (! IS_LINE_TERMINATOR (* name_end))
{ {
@ -797,7 +797,7 @@ filter_symbols (abfd, obfd, osyms, isyms, symcount)
&& ((*bfd_get_section (sym)->symbol_ptr_ptr)->flags && ((*bfd_get_section (sym)->symbol_ptr_ptr)->flags
& BSF_KEEP) != 0)) & BSF_KEEP) != 0))
keep = 1; keep = 1;
else if (relocatable /* Relocatable file. */ else if (relocatable /* Relocatable file. */
&& (flags & (BSF_GLOBAL | BSF_WEAK)) != 0) && (flags & (BSF_GLOBAL | BSF_WEAK)) != 0)
keep = 1; keep = 1;
else if (bfd_decode_symclass (sym) == 'I') else if (bfd_decode_symclass (sym) == 'I')
@ -961,7 +961,7 @@ copy_object (ibfd, obfd)
start += change_start; start += change_start;
/* Neither the start address nor the flags /* Neither the start address nor the flags
need to be set for a core file. */ need to be set for a core file. */
if (bfd_get_format (obfd) != bfd_core) if (bfd_get_format (obfd) != bfd_core)
{ {
if (!bfd_set_start_address (obfd, start) if (!bfd_set_start_address (obfd, start)
@ -1088,8 +1088,8 @@ copy_object (ibfd, obfd)
size + (gap_stop - gap_start))) size + (gap_stop - gap_start)))
{ {
non_fatal (_("Can't fill gap after %s: %s"), non_fatal (_("Can't fill gap after %s: %s"),
bfd_get_section_name (obfd, osections[i]), bfd_get_section_name (obfd, osections[i]),
bfd_errmsg (bfd_get_error ())); bfd_errmsg (bfd_get_error ()));
status = 1; status = 1;
break; break;
} }
@ -1113,8 +1113,8 @@ copy_object (ibfd, obfd)
pad_to - lma)) pad_to - lma))
{ {
non_fatal (_("Can't add padding to %s: %s"), non_fatal (_("Can't add padding to %s: %s"),
bfd_get_section_name (obfd, osections[c - 1]), bfd_get_section_name (obfd, osections[c - 1]),
bfd_errmsg (bfd_get_error ())); bfd_errmsg (bfd_get_error ()));
status = 1; status = 1;
} }
else else
@ -1363,7 +1363,7 @@ copy_archive (ibfd, obfd, output_target)
if (!bfd_close (output_bfd)) if (!bfd_close (output_bfd))
{ {
bfd_nonfatal (bfd_get_filename (output_bfd)); bfd_nonfatal (bfd_get_filename (output_bfd));
/* Error in new object file. Don't change archive. */ /* Error in new object file. Don't change archive. */
status = 1; status = 1;
} }
@ -1711,7 +1711,7 @@ copy_section (ibfd, isection, obfdarg)
if (size == 0 || osection == 0) if (size == 0 || osection == 0)
return; return;
/* Core files do not need to be relocated. */ /* Core files do not need to be relocated. */
if (bfd_get_format (obfd) == bfd_core) if (bfd_get_format (obfd) == bfd_core)
relsize = 0; relsize = 0;
else else
@ -1732,7 +1732,7 @@ copy_section (ibfd, isection, obfdarg)
if (strip_symbols == STRIP_ALL) if (strip_symbols == STRIP_ALL)
{ {
/* Remove relocations which are not in /* Remove relocations which are not in
keep_strip_specific_list. */ keep_strip_specific_list. */
arelent **temp_relpp; arelent **temp_relpp;
long temp_relcount = 0; long temp_relcount = 0;
long i; long i;
@ -2124,9 +2124,9 @@ copy_main (argc, argv)
fatal (_("byte number must be non-negative")); fatal (_("byte number must be non-negative"));
break; break;
case 'B': case 'B':
binary_architecture = optarg; binary_architecture = optarg;
break; break;
case 'i': case 'i':
interleave = atoi (optarg); interleave = atoi (optarg);
@ -2492,13 +2492,13 @@ copy_main (argc, argv)
set_start_set = true; set_start_set = true;
break; break;
case OPTION_SREC_LEN: case OPTION_SREC_LEN:
Chunk = parse_vma (optarg, "--srec-len"); Chunk = parse_vma (optarg, "--srec-len");
break; break;
case OPTION_SREC_FORCES3: case OPTION_SREC_FORCES3:
S3Forced = true; S3Forced = true;
break; break;
case OPTION_STRIP_SYMBOLS: case OPTION_STRIP_SYMBOLS:
add_specific_symbols (optarg, &strip_specific_list); add_specific_symbols (optarg, &strip_specific_list);
@ -2561,16 +2561,16 @@ copy_main (argc, argv)
if (binary_architecture != (char *) NULL) if (binary_architecture != (char *) NULL)
{ {
if (input_target && strcmp (input_target, "binary") == 0) if (input_target && strcmp (input_target, "binary") == 0)
{ {
const bfd_arch_info_type * temp_arch_info; const bfd_arch_info_type * temp_arch_info;
temp_arch_info = bfd_scan_arch (binary_architecture); temp_arch_info = bfd_scan_arch (binary_architecture);
if (temp_arch_info != NULL) if (temp_arch_info != NULL)
bfd_external_binary_architecture = temp_arch_info->arch; bfd_external_binary_architecture = temp_arch_info->arch;
else else
fatal (_("architecture %s unknown"), binary_architecture); fatal (_("architecture %s unknown"), binary_architecture);
} }
else else
{ {
non_fatal (_("Warning: input target 'binary' required for binary architecture parameter.")); non_fatal (_("Warning: input target 'binary' required for binary architecture parameter."));

View file

@ -441,7 +441,7 @@ slurp_dynamic_symtab (abfd)
/* Filter out (in place) symbols that are useless for disassembly. /* Filter out (in place) symbols that are useless for disassembly.
COUNT is the number of elements in SYMBOLS. COUNT is the number of elements in SYMBOLS.
Return the number of useful symbols. */ Return the number of useful symbols. */
static long static long
remove_useless_symbols (symbols, count) remove_useless_symbols (symbols, count)
@ -1073,10 +1073,10 @@ show_line (abfd, section, addr_offset)
p->next = print_files; p->next = print_files;
print_files = p; print_files = p;
if (file_start_context) if (file_start_context)
l = 0; l = 0;
else else
l = line - SHOW_PRECEDING_CONTEXT_LINES; l = line - SHOW_PRECEDING_CONTEXT_LINES;
if (l < 0) if (l < 0)
l = 0; l = 0;
skip_to_line (p, l, false); skip_to_line (p, l, false);
@ -1172,7 +1172,7 @@ objdump_sprintf VPARAMS ((SFILE *f, const char *format, ...))
static void static void
disassemble_bytes (info, disassemble_fn, insns, data, disassemble_bytes (info, disassemble_fn, insns, data,
start_offset, stop_offset, relppp, start_offset, stop_offset, relppp,
relppend) relppend)
struct disassemble_info *info; struct disassemble_info *info;
disassembler_ftype disassemble_fn; disassembler_ftype disassemble_fn;
@ -1242,7 +1242,7 @@ disassemble_bytes (info, disassemble_fn, insns, data,
|| info->branch_delay_insns == 0) || info->branch_delay_insns == 0)
&& (z - addr_offset * opb >= SKIP_ZEROES && (z - addr_offset * opb >= SKIP_ZEROES
|| (z == stop_offset * opb && || (z == stop_offset * opb &&
z - addr_offset * opb < SKIP_ZEROES_AT_END))) z - addr_offset * opb < SKIP_ZEROES_AT_END)))
{ {
printf ("\t...\n"); printf ("\t...\n");
@ -1449,7 +1449,7 @@ disassemble_bytes (info, disassemble_fn, insns, data,
if ((section->flags & SEC_RELOC) != 0 if ((section->flags & SEC_RELOC) != 0
#ifndef DISASSEMBLER_NEEDS_RELOCS #ifndef DISASSEMBLER_NEEDS_RELOCS
&& dump_reloc_info && dump_reloc_info
#endif #endif
) )
{ {
@ -1773,7 +1773,7 @@ disassemble_data (abfd)
insns = false; insns = false;
disassemble_bytes (&disasm_info, disassemble_fn, insns, data, disassemble_bytes (&disasm_info, disassemble_fn, insns, data,
addr_offset, nextstop_offset, &relpp, relppend); addr_offset, nextstop_offset, &relpp, relppend);
addr_offset = nextstop_offset; addr_offset = nextstop_offset;
sym = nextsym; sym = nextsym;
@ -1929,7 +1929,7 @@ print_section_stabs (abfd, stabsect_name, strsect_name)
printf ("\n%-6d ", i); printf ("\n%-6d ", i);
/* Either print the stab name, or, if unnamed, print its number /* Either print the stab name, or, if unnamed, print its number
again (makes consistent formatting for tools like awk). */ again (makes consistent formatting for tools like awk). */
name = bfd_get_stab_name (type); name = bfd_get_stab_name (type);
if (name != NULL) if (name != NULL)
printf ("%-6s", name); printf ("%-6s", name);
@ -2251,14 +2251,14 @@ dump_data (abfd)
stop_offset = bfd_section_size (abfd, section) / opb; stop_offset = bfd_section_size (abfd, section) / opb;
} }
for (addr_offset = start_offset; for (addr_offset = start_offset;
addr_offset < stop_offset; addr_offset += onaline) addr_offset < stop_offset; addr_offset += onaline)
{ {
bfd_size_type j; bfd_size_type j;
printf (" %04lx ", (unsigned long int) printf (" %04lx ", (unsigned long int)
(addr_offset + section->vma)); (addr_offset + section->vma));
for (j = addr_offset * opb; for (j = addr_offset * opb;
j < addr_offset * opb + onaline; j++) j < addr_offset * opb + onaline; j++)
{ {
if (j < stop_offset * opb) if (j < stop_offset * opb)
printf ("%02x", (unsigned) (data[j])); printf ("%02x", (unsigned) (data[j]));
@ -2805,7 +2805,7 @@ main (argc, argv)
optarg); optarg);
cplus_demangle_set_style (style); cplus_demangle_set_style (style);
} }
break; break;
case 'w': case 'w':
wide_output = true; wide_output = true;