1 |
solar 08/04/19 22:31:49 |
2 |
|
3 |
Modified: Makefile scanelf.c |
4 |
Log: |
5 |
- add -Z/--size option |
6 |
|
7 |
Revision Changes Path |
8 |
1.67 pax-utils/Makefile |
9 |
|
10 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-projects/pax-utils/Makefile?rev=1.67&view=markup |
11 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-projects/pax-utils/Makefile?rev=1.67&content-type=text/plain |
12 |
diff : http://sources.gentoo.org/viewcvs.py/gentoo-projects/pax-utils/Makefile?r1=1.66&r2=1.67 |
13 |
|
14 |
Index: Makefile |
15 |
=================================================================== |
16 |
RCS file: /var/cvsroot/gentoo-projects/pax-utils/Makefile,v |
17 |
retrieving revision 1.66 |
18 |
retrieving revision 1.67 |
19 |
diff -u -r1.66 -r1.67 |
20 |
--- Makefile 17 Jan 2008 06:37:44 -0000 1.66 |
21 |
+++ Makefile 19 Apr 2008 22:31:49 -0000 1.67 |
22 |
@@ -1,6 +1,6 @@ |
23 |
# Copyright 2003-2006 Ned Ludd <solar@××××××.net> |
24 |
# Distributed under the terms of the GNU General Public License v2 |
25 |
-# $Header: /var/cvsroot/gentoo-projects/pax-utils/Makefile,v 1.66 2008/01/17 06:37:44 solar Exp $ |
26 |
+# $Header: /var/cvsroot/gentoo-projects/pax-utils/Makefile,v 1.67 2008/04/19 22:31:49 solar Exp $ |
27 |
#################################################################### |
28 |
|
29 |
check_gcc=$(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null > /dev/null 2>&1; \ |
30 |
@@ -13,6 +13,7 @@ |
31 |
-Wchar-subscripts -Wcast-align -Wno-format-nonliteral \ |
32 |
$(call check_gcc, -Wdeclaration-after-statement) \ |
33 |
$(call check-gcc, -Wsequence-point) \ |
34 |
+ $(call check-gcc, -Wstrict-overflow) \ |
35 |
$(call check-gcc, -Wextra) |
36 |
|
37 |
CFLAGS ?= -O2 -pipe |
38 |
|
39 |
|
40 |
|
41 |
1.190 pax-utils/scanelf.c |
42 |
|
43 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-projects/pax-utils/scanelf.c?rev=1.190&view=markup |
44 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-projects/pax-utils/scanelf.c?rev=1.190&content-type=text/plain |
45 |
diff : http://sources.gentoo.org/viewcvs.py/gentoo-projects/pax-utils/scanelf.c?r1=1.189&r2=1.190 |
46 |
|
47 |
Index: scanelf.c |
48 |
=================================================================== |
49 |
RCS file: /var/cvsroot/gentoo-projects/pax-utils/scanelf.c,v |
50 |
retrieving revision 1.189 |
51 |
retrieving revision 1.190 |
52 |
diff -u -r1.189 -r1.190 |
53 |
--- scanelf.c 17 Jan 2008 04:37:19 -0000 1.189 |
54 |
+++ scanelf.c 19 Apr 2008 22:31:49 -0000 1.190 |
55 |
@@ -1,13 +1,13 @@ |
56 |
/* |
57 |
* Copyright 2003-2007 Gentoo Foundation |
58 |
* Distributed under the terms of the GNU General Public License v2 |
59 |
- * $Header: /var/cvsroot/gentoo-projects/pax-utils/scanelf.c,v 1.189 2008/01/17 04:37:19 solar Exp $ |
60 |
+ * $Header: /var/cvsroot/gentoo-projects/pax-utils/scanelf.c,v 1.190 2008/04/19 22:31:49 solar Exp $ |
61 |
* |
62 |
* Copyright 2003-2007 Ned Ludd - <solar@g.o> |
63 |
* Copyright 2004-2007 Mike Frysinger - <vapier@g.o> |
64 |
*/ |
65 |
|
66 |
-static const char *rcsid = "$Id: scanelf.c,v 1.189 2008/01/17 04:37:19 solar Exp $"; |
67 |
+static const char *rcsid = "$Id: scanelf.c,v 1.190 2008/04/19 22:31:49 solar Exp $"; |
68 |
const char * const argv0 = "scanelf"; |
69 |
|
70 |
#include "paxinc.h" |
71 |
@@ -40,6 +40,7 @@ |
72 |
static char dir_crossmount = 1; |
73 |
static char show_pax = 0; |
74 |
static char show_perms = 0; |
75 |
+static char show_size = 0; |
76 |
static char show_phdr = 0; |
77 |
static char show_textrel = 0; |
78 |
static char show_rpath = 0; |
79 |
@@ -1146,6 +1147,7 @@ |
80 |
case 'n': prints("NEEDED "); break; |
81 |
case 'i': prints("INTERP "); break; |
82 |
case 'b': prints("BIND "); break; |
83 |
+ case 'Z': prints("SIZE "); break; |
84 |
case 'S': prints("SONAME "); break; |
85 |
case 's': prints("SYM "); break; |
86 |
case 'N': prints("LIB "); break; |
87 |
@@ -1167,7 +1169,7 @@ |
88 |
for (i = 0; out_format[i]; ++i) { |
89 |
const char *out; |
90 |
const char *tmp; |
91 |
- |
92 |
+ static char ubuf[sizeof(unsigned long)*2]; |
93 |
if (!IS_MODIFIER(out_format[i])) { |
94 |
xchrcat(&out_buffer, out_format[i], &out_len); |
95 |
continue; |
96 |
@@ -1224,6 +1226,7 @@ |
97 |
case 's': out = scanelf_file_sym(elf, &found_sym); break; |
98 |
case 'k': out = scanelf_file_sections(elf, &found_section); break; |
99 |
case 'a': out = get_elfemtype(elf); break; |
100 |
+ case 'Z': snprintf(ubuf, sizeof(ubuf), "%lu", elf->len); out = ubuf; break;; |
101 |
default: warnf("'%c' has no scan code?", out_format[i]); |
102 |
} |
103 |
if (out) { |
104 |
@@ -1588,8 +1591,8 @@ |
105 |
free(path); |
106 |
} |
107 |
|
108 |
-/* usage / invocation handling functions */ /* Free Flags: c d j u w C G H I J K P Q U W Y Z */ |
109 |
-#define PARSE_FLAGS "plRmyAXz:xetrnLibSs:k:gN:TaqvF:f:o:E:M:DO:BhV" |
110 |
+/* usage / invocation handling functions */ /* Free Flags: c d j u w C G H I J K P Q U W Y */ |
111 |
+#define PARSE_FLAGS "plRmyAXz:xetrnLibSs:k:gN:TaqvF:f:o:E:M:DO:ZBhV" |
112 |
#define a_argument required_argument |
113 |
static struct option const long_opts[] = { |
114 |
{"path", no_argument, NULL, 'p'}, |
115 |
@@ -1618,6 +1621,7 @@ |
116 |
{"bits", a_argument, NULL, 'M'}, |
117 |
{"endian", no_argument, NULL, 'D'}, |
118 |
{"perms", a_argument, NULL, 'O'}, |
119 |
+ {"size", no_argument, NULL, 'Z'}, |
120 |
{"all", no_argument, NULL, 'a'}, |
121 |
{"quiet", no_argument, NULL, 'q'}, |
122 |
{"verbose", no_argument, NULL, 'v'}, |
123 |
@@ -1657,6 +1661,7 @@ |
124 |
"Print only ELF files matching numeric bits", |
125 |
"Print Endianness", |
126 |
"Print only ELF files matching octal permissions", |
127 |
+ "Print ELF file size", |
128 |
"Print all scanned info (-x -e -t -r -b)\n", |
129 |
"Only output 'bad' things", |
130 |
"Be verbose (can be specified more than once)", |
131 |
@@ -1804,6 +1809,7 @@ |
132 |
setpax = flags; |
133 |
break; |
134 |
} |
135 |
+ case 'Z': show_size = 1; break; |
136 |
case 'g': g_match = 1; break; |
137 |
case 'L': use_ldcache = 1; break; |
138 |
case 'y': scan_symlink = 0; break; |
139 |
@@ -1843,7 +1849,7 @@ |
140 |
if (out_format) { |
141 |
show_pax = show_phdr = show_textrel = show_rpath = \ |
142 |
show_needed = show_interp = show_bind = show_soname = \ |
143 |
- show_textrels = show_perms = show_endian = 0; |
144 |
+ show_textrels = show_perms = show_endian = show_size = 0; |
145 |
for (i = 0; out_format[i]; ++i) { |
146 |
if (!IS_MODIFIER(out_format[i])) continue; |
147 |
|
148 |
@@ -1860,6 +1866,7 @@ |
149 |
case 'o': break; |
150 |
case 'a': break; |
151 |
case 'M': break; |
152 |
+ case 'Z': show_size = 1; break; |
153 |
case 'D': show_endian = 1; break; |
154 |
case 'O': show_perms = 1; break; |
155 |
case 'x': show_pax = 1; break; |
156 |
@@ -1884,6 +1891,7 @@ |
157 |
if (!be_quiet) xstrcat(&out_format, "%o ", &fmt_len); |
158 |
if (show_pax) xstrcat(&out_format, "%x ", &fmt_len); |
159 |
if (show_perms) xstrcat(&out_format, "%O ", &fmt_len); |
160 |
+ if (show_size) xstrcat(&out_format, "%Z ", &fmt_len); |
161 |
if (show_endian) xstrcat(&out_format, "%D ", &fmt_len); |
162 |
if (show_phdr) xstrcat(&out_format, "%e ", &fmt_len); |
163 |
if (show_textrel) xstrcat(&out_format, "%t ", &fmt_len); |
164 |
|
165 |
|
166 |
|
167 |
-- |
168 |
gentoo-commits@l.g.o mailing list |