aboutsummaryrefslogtreecommitdiff
path: root/binutils/addr2line.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2006-08-06 15:49:46 +0000
committerNick Clifton <nickc@redhat.com>2006-08-06 15:49:46 +0000
commitd68c385bfc389b5ba3c1cb5684febe74990b5725 (patch)
tree84133f1200209fd123721c542193166d1f2d6be9 /binutils/addr2line.c
parentf301d54cd8e7649c6d1a4473932dcf7d3161b2c1 (diff)
downloadgdb-d68c385bfc389b5ba3c1cb5684febe74990b5725.zip
gdb-d68c385bfc389b5ba3c1cb5684febe74990b5725.tar.gz
gdb-d68c385bfc389b5ba3c1cb5684febe74990b5725.tar.bz2
PR binutils/3001
* addr2line.c (process_file): Change function from void to returning an int. Return 0 upon success, 1 otherwise. (main): Use return value from process_file as the exit value. * ar.c (ranlib_only): Change function from void to returning an int. Return 0 upon success, 1 otherwise. (ranlib_touch): Likewise. (main): Use return value from ranlib functions as exit value. * objcopy.c (add_specific_symbol): Set status to 1 if get_file_size fails. (copy_file): Likewise. (strip_main): Likewise. (copy_main): Likewise. * objdump.c (display_file): Set exit_status to 1 if get_file_size fails. * size.c (display_file): Set return_code to 1 if get_file_size fails.
Diffstat (limited to 'binutils/addr2line.c')
-rw-r--r--binutils/addr2line.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/binutils/addr2line.c b/binutils/addr2line.c
index 7cd67bc..928bf12 100644
--- a/binutils/addr2line.c
+++ b/binutils/addr2line.c
@@ -68,7 +68,6 @@ static void slurp_symtab (bfd *);
static void find_address_in_section (bfd *, asection *, void *);
static void find_offset_in_section (bfd *, asection *);
static void translate_addresses (bfd *, asection *);
-static void process_file (const char *, const char *, const char *);
/* Print a usage message to STREAM and exit with STATUS. */
@@ -261,9 +260,9 @@ translate_addresses (bfd *abfd, asection *section)
}
}
-/* Process a file. */
+/* Process a file. Returns an exit value for main(). */
-static void
+static int
process_file (const char *file_name, const char *section_name,
const char *target)
{
@@ -272,7 +271,7 @@ process_file (const char *file_name, const char *section_name,
char **matching;
if (get_file_size (file_name) < 1)
- return;
+ return 1;
abfd = bfd_openr (file_name, target);
if (abfd == NULL)
@@ -312,6 +311,8 @@ process_file (const char *file_name, const char *section_name,
}
bfd_close (abfd);
+
+ return 0;
}
int
@@ -401,7 +402,5 @@ main (int argc, char **argv)
addr = argv + optind;
naddr = argc - optind;
- process_file (file_name, section_name, target);
-
- return 0;
+ return process_file (file_name, section_name, target);
}