summaryrefslogtreecommitdiffstats
path: root/contrib/elftoolchain/strings/strings.c
diff options
context:
space:
mode:
authoremaste <emaste@FreeBSD.org>2016-02-12 20:54:02 +0000
committeremaste <emaste@FreeBSD.org>2016-02-12 20:54:02 +0000
commita6ae90983efabb9784f1e105ffb29eaec3c0573c (patch)
treecd8537a698afe8dd30dc9c4d04c193e5b3b2e94f /contrib/elftoolchain/strings/strings.c
parent0309ab8781484f9cf0561cbbc3cab6df7139d629 (diff)
parent85217dee0e24c5f3ac285420e843063b4b52c1a0 (diff)
downloadFreeBSD-src-a6ae90983efabb9784f1e105ffb29eaec3c0573c.zip
FreeBSD-src-a6ae90983efabb9784f1e105ffb29eaec3c0573c.tar.gz
Update ELF Tool Chain to upstream rev 3400
Some notable improvements include: readelf: - Add AArch64 relocation definitions. - Report value of unknown relocation types. elfcopy: - Consider symbols with STB_GNU_UNIQUE binding as global symbols. - Fixed support for VMA adjustment for loadable sections found in relocatable objects. - Handle nameless global symbols. - Improve wildcard matching for !-prefixed symbols. - Add PE/COFF support. elfdump: - Improve section type reporting. - Add MIPS-specific section types. This update also includes a significant number of bug fixes. PR: 207091 [exp-run] Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'contrib/elftoolchain/strings/strings.c')
-rw-r--r--contrib/elftoolchain/strings/strings.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/contrib/elftoolchain/strings/strings.c b/contrib/elftoolchain/strings/strings.c
index 6eab165..f122eba 100644
--- a/contrib/elftoolchain/strings/strings.c
+++ b/contrib/elftoolchain/strings/strings.c
@@ -37,6 +37,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <sysexits.h>
#include <unistd.h>
#include <libelf.h>
@@ -45,7 +46,7 @@
#include "_elftc.h"
-ELFTC_VCSID("$Id: strings.c 3174 2015-03-27 17:13:41Z emaste $");
+ELFTC_VCSID("$Id: strings.c 3360 2016-01-24 18:34:06Z jkoshy $");
enum return_code {
RETURN_OK,
@@ -73,10 +74,10 @@ enum encoding_style {
((c) == '\t' || isprint((c)) || \
(encoding == ENCODING_8BIT && (c) > 127)))
-
-static int encoding_size, entire_file, min_len, show_filename, show_loc;
+static int encoding_size, entire_file, show_filename, show_loc;
static enum encoding_style encoding;
static enum radix_style radix;
+static intmax_t min_len;
static struct option strings_longopts[] = {
{ "all", no_argument, NULL, 'a'},
@@ -144,7 +145,10 @@ main(int argc, char **argv)
show_filename = 1;
break;
case 'n':
- min_len = (int)strtoimax(optarg, (char**)NULL, 10);
+ min_len = strtoimax(optarg, (char**)NULL, 10);
+ if (min_len <= 0)
+ errx(EX_USAGE, "option -n should specify a "
+ "positive decimal integer.");
break;
case 'o':
show_loc = 1;
OpenPOWER on IntegriCloud