ruby-elf 1.0.7 → 1.0.8
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +64 -0
- data/lib/elf.rb +1 -1
- data/ruby-elf.gemspec +29 -0
- metadata +38 -74
- data/bin/cowstats +0 -266
- data/bin/elfgrep +0 -246
- data/bin/missingstatic +0 -113
- data/bin/rbelf-nm +0 -113
- data/bin/rbelf-read +0 -146
- data/bin/rbelf-size +0 -184
- data/bin/verify-lfs +0 -125
- data/extras/README.extras +0 -5
- data/extras/bindings-parsers.rb +0 -157
- data/manpages/cowstats.1.xml +0 -234
- data/manpages/elfgrep.1.xml +0 -423
- data/manpages/missingstatic.1.xml +0 -290
- data/manpages/rbelf-nm.1.xml +0 -339
- data/manpages/rbelf-size.1.xml +0 -345
- data/manpages/verify-lfs.1.xml +0 -136
- data/tools/link-collisions/known-broken +0 -154
- data/tools/link-collisions/multimplementations +0 -170
- data/tools/link-collisions/suppressions +0 -287
data/manpages/rbelf-size.1.xml
DELETED
@@ -1,345 +0,0 @@
|
|
1
|
-
<?xml version='1.0'?>
|
2
|
-
<!--
|
3
|
-
Copyright © 2008-2011, Diego Elio Pettenò <flameeyes@flameeyes.eu>
|
4
|
-
|
5
|
-
This program is free software; you can redistribute it and/or modify
|
6
|
-
it under the terms of the GNU General Public License as published by
|
7
|
-
the Free Software Foundation; either version 2 of the License, or
|
8
|
-
(at your option) any later version.
|
9
|
-
|
10
|
-
This program is distributed in the hope that it will be useful,
|
11
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
|
-
GNU General Public License for more details.
|
14
|
-
|
15
|
-
You should have received a copy of the GNU General Public License
|
16
|
-
along with this generator; if not, write to the Free Software
|
17
|
-
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
18
|
-
-->
|
19
|
-
<article xmlns="http://docbook.org/ns/docbook"
|
20
|
-
xmlns:xl="http://www.w3.org/1999/xlink"
|
21
|
-
xmlns:xi="http://www.w3.org/2001/XInclude"
|
22
|
-
version="5.0" xml:lang="en">
|
23
|
-
<info>
|
24
|
-
<title>rbelf-size</title>
|
25
|
-
|
26
|
-
<xi:include parse="xml" href="author.xmli" />
|
27
|
-
</info>
|
28
|
-
|
29
|
-
<section>
|
30
|
-
<title>Reference</title>
|
31
|
-
|
32
|
-
<refentry>
|
33
|
-
<info>
|
34
|
-
<date>October 2008</date>
|
35
|
-
<productname>ruby-elf</productname>
|
36
|
-
</info>
|
37
|
-
<refmeta>
|
38
|
-
<refentrytitle>rbelf-size</refentrytitle>
|
39
|
-
<manvolnum>1</manvolnum>
|
40
|
-
</refmeta>
|
41
|
-
<refnamediv>
|
42
|
-
<refname>rbelf-size</refname>
|
43
|
-
<refpurpose>List section sizes of ELF files</refpurpose>
|
44
|
-
</refnamediv>
|
45
|
-
<refsynopsisdiv>
|
46
|
-
<cmdsynopsis>
|
47
|
-
<command>rbelf-size</command>
|
48
|
-
|
49
|
-
<arg choice="opt">
|
50
|
-
<option>--relocation-stats</option>
|
51
|
-
<arg choice="opt"><option>--decibel</option></arg>
|
52
|
-
</arg>
|
53
|
-
|
54
|
-
<arg choice="opt">
|
55
|
-
<option>--differential</option>
|
56
|
-
</arg>
|
57
|
-
|
58
|
-
<xi:include href="common.xmli" xpointer="xpointer(id('filelist.synopsis')/*)" />
|
59
|
-
</cmdsynopsis>
|
60
|
-
</refsynopsisdiv>
|
61
|
-
|
62
|
-
<refsect1>
|
63
|
-
<title>Description</title>
|
64
|
-
<para>
|
65
|
-
<command>rbelf-size</command> is a replacement for the standard
|
66
|
-
<citerefentry><refentrytitle>size</refentrytitle><manvolnum>1</manvolnum></citerefentry>
|
67
|
-
utility, as provided by GNU binutils and similar suites. Instead of showing the sum of all
|
68
|
-
the invariant, variant and unallocated sections as the size, it divides them depending on
|
69
|
-
how they are treated, differentiating between invariant data, invariant code, variant data
|
70
|
-
and relocated invariant data.
|
71
|
-
</para>
|
72
|
-
</refsect1>
|
73
|
-
|
74
|
-
<refsect1>
|
75
|
-
<title>Options</title>
|
76
|
-
|
77
|
-
<variablelist>
|
78
|
-
<varlistentry>
|
79
|
-
<term><option>-r</option></term>
|
80
|
-
<term><option>--relocation-stats</option></term>
|
81
|
-
<listitem>
|
82
|
-
<para>
|
83
|
-
Instead of reporting size data compatible with
|
84
|
-
<citerefentry><refentrytitle>size</refentrytitle><manvolnum>1</manvolnum></citerefentry>
|
85
|
-
report size for shared, private and relocated areas. This is helpful to assess the
|
86
|
-
validity of shared object approaches.
|
87
|
-
</para>
|
88
|
-
</listitem>
|
89
|
-
</varlistentry>
|
90
|
-
|
91
|
-
<varlistentry>
|
92
|
-
<term><option>-d</option></term>
|
93
|
-
<term><option>--decibel</option></term>
|
94
|
-
<listitem>
|
95
|
-
<para>
|
96
|
-
When using the <option>--relocation-stats</option> option, a ratio is displayed
|
97
|
-
between the size of relocated and shared code areas, to better assess the advantages
|
98
|
-
and disadvantages for shared object approaches.
|
99
|
-
</para>
|
100
|
-
|
101
|
-
<para>
|
102
|
-
Since that ratio can easily skyrocket into thousands if there is very little
|
103
|
-
relocated data, and a lot of shared data, it might be easier to appreciate the
|
104
|
-
results by using a logaritmic scale.
|
105
|
-
</para>
|
106
|
-
</listitem>
|
107
|
-
</varlistentry>
|
108
|
-
|
109
|
-
<varlistentry>
|
110
|
-
<term><option>-D</option></term>
|
111
|
-
<term><option>--differential</option></term>
|
112
|
-
|
113
|
-
<listitem>
|
114
|
-
<para>
|
115
|
-
Provides sizes of multiple arguments as a comparison to the first. It is designed to
|
116
|
-
allow comparing multiple versions of the same binary or multiple implementation of
|
117
|
-
the same application to evaluate the overall trend in static memory allocation.
|
118
|
-
</para>
|
119
|
-
</listitem>
|
120
|
-
</varlistentry>
|
121
|
-
|
122
|
-
<xi:include href="common.xmli" xpointer="xpointer(id('filelist.option')/*)" />
|
123
|
-
</variablelist>
|
124
|
-
</refsect1>
|
125
|
-
|
126
|
-
<refsect1>
|
127
|
-
<title>Compatible Output</title>
|
128
|
-
|
129
|
-
<para>
|
130
|
-
The output of <command>rbelf-size</command> differs from that of <command>size</command>
|
131
|
-
for the number and type of columns it outputs. While the original BSD command outputs the
|
132
|
-
size of the "text", "data" and "bss" sections, this tool splits them further.
|
133
|
-
</para>
|
134
|
-
|
135
|
-
<variablelist>
|
136
|
-
<varlistentry>
|
137
|
-
<term>exec</term>
|
138
|
-
<listitem>
|
139
|
-
<para>
|
140
|
-
Counts in all the sections containing executable code, this includes the
|
141
|
-
<varname>.text</varname> section, and others.
|
142
|
-
</para>
|
143
|
-
</listitem>
|
144
|
-
</varlistentry>
|
145
|
-
|
146
|
-
<varlistentry>
|
147
|
-
<term>data</term>
|
148
|
-
<listitem>
|
149
|
-
<para>
|
150
|
-
Counts in all the sections containing variable data, this excludes read-only data
|
151
|
-
sections, but includes relocated data and other kind of allocated and writeable data
|
152
|
-
sections. If the compiler is GCC or outputs GCC-compatible section names this won't
|
153
|
-
count in relocated constants.
|
154
|
-
</para>
|
155
|
-
</listitem>
|
156
|
-
</varlistentry>
|
157
|
-
|
158
|
-
<varlistentry>
|
159
|
-
<term>relro</term>
|
160
|
-
<listitem>
|
161
|
-
<para>
|
162
|
-
Counts in the relocated constants (read-only relocated data). This column will be
|
163
|
-
non-null only for binaries compiled by GCC or by compilers emitting GCC-compatible
|
164
|
-
section names. The sections counted in this entry will are relocated at runtime, but
|
165
|
-
are never otherwise modified. The reason why this is separated is that this section
|
166
|
-
may be touched by
|
167
|
-
<citerefentry><refentrytitle>prelink</refentrytitle><manvolnum>8</manvolnum></citerefentry>
|
168
|
-
so that the runtime relocation is not needed, and thus would count just as common
|
169
|
-
constant data.
|
170
|
-
</para>
|
171
|
-
</listitem>
|
172
|
-
</varlistentry>
|
173
|
-
|
174
|
-
<varlistentry>
|
175
|
-
<term>bss</term>
|
176
|
-
<listitem>
|
177
|
-
<para>
|
178
|
-
Just like <command>size</command> bss column, this counts in the size of sections
|
179
|
-
that are allocated at runtime as mapped to the zero page. It supports TLS
|
180
|
-
<varname>.tbss</varname> section.
|
181
|
-
</para>
|
182
|
-
</listitem>
|
183
|
-
</varlistentry>
|
184
|
-
|
185
|
-
<varlistentry>
|
186
|
-
<term>overhead</term>
|
187
|
-
<listitem>
|
188
|
-
<para>
|
189
|
-
Total size of sections providing object's metadata for the link editor and dynamic
|
190
|
-
loader. These include the symbol and string tables, the version tables and the hash
|
191
|
-
table used during linking and execution. These values are usually tied to the amount
|
192
|
-
of symbols exposed by an object, and can easily be reduced by hiding internal,
|
193
|
-
non-public symbols.
|
194
|
-
</para>
|
195
|
-
</listitem>
|
196
|
-
</varlistentry>
|
197
|
-
|
198
|
-
<varlistentry>
|
199
|
-
<term>allocated</term>
|
200
|
-
<listitem>
|
201
|
-
<para>
|
202
|
-
Sum of the size of all the previously-shown sections, which shows the actual
|
203
|
-
allocated memory used by the object. It is important to note that sections are
|
204
|
-
usually loaded on an alignment of the page size, which on Linux is 4KiB (4096
|
205
|
-
bytes), so the size of the actual memory reserved for the ELF structures in memory
|
206
|
-
is going to be higher than this number.
|
207
|
-
</para>
|
208
|
-
</listitem>
|
209
|
-
</varlistentry>
|
210
|
-
</variablelist>
|
211
|
-
</refsect1>
|
212
|
-
|
213
|
-
<refsect1>
|
214
|
-
<title>Relocation Statistics</title>
|
215
|
-
|
216
|
-
<para>
|
217
|
-
When using shared objects rather than static linking, there are many trade-offs to be
|
218
|
-
made. One of these relates to the amount of code that will get relocated (and thus becomes
|
219
|
-
private, per-process resident memory).
|
220
|
-
</para>
|
221
|
-
|
222
|
-
<para>
|
223
|
-
The <option>--relocation-stats</option> option was devised as a mean to assess the
|
224
|
-
cost/benefit of using shared objects, rather than using static link (e.g. with multicall
|
225
|
-
binaries).
|
226
|
-
</para>
|
227
|
-
|
228
|
-
<variablelist>
|
229
|
-
<varlistentry>
|
230
|
-
<term>shared</term>
|
231
|
-
<listitem>
|
232
|
-
<para>
|
233
|
-
Areas of memory that are always shared among processes; these include executable
|
234
|
-
areas with Position Indipendent Code, and read-only data areas.
|
235
|
-
</para>
|
236
|
-
|
237
|
-
<para>
|
238
|
-
Generally, this is what we would want to have as big as possible, compared to the
|
239
|
-
rest.
|
240
|
-
</para>
|
241
|
-
</listitem>
|
242
|
-
</varlistentry>
|
243
|
-
|
244
|
-
<varlistentry>
|
245
|
-
<term>private</term>
|
246
|
-
<listitem>
|
247
|
-
<para>
|
248
|
-
Areas of memory that will always be private to the process; these includes writeable
|
249
|
-
data areas and areas remapped to the zero page (what above is called bss).
|
250
|
-
</para>
|
251
|
-
|
252
|
-
<para>
|
253
|
-
This is a worst-case value, as even though the writeable sections _may_ become
|
254
|
-
private, if they are left untouched they will be shared among multiple (if not all)
|
255
|
-
processes. It is, though, useful to consider the worst-case scenario for assesment.
|
256
|
-
</para>
|
257
|
-
</listitem>
|
258
|
-
</varlistentry>
|
259
|
-
|
260
|
-
<varlistentry>
|
261
|
-
<term>relocated</term>
|
262
|
-
<listitem>
|
263
|
-
<para>
|
264
|
-
This value sums up the size of the memory areas that will be relocated when using
|
265
|
-
shared objects (or Position Indipendent Executables). Relocated areas include
|
266
|
-
.data.rel.ro sections, which contain data read-only for the code, but written to by
|
267
|
-
the dynamic linker.
|
268
|
-
</para>
|
269
|
-
|
270
|
-
<para>
|
271
|
-
Again this value is an approximation nearing the worst-case scenario.
|
272
|
-
</para>
|
273
|
-
</listitem>
|
274
|
-
</varlistentry>
|
275
|
-
|
276
|
-
<varlistentry>
|
277
|
-
<term>ratio</term>
|
278
|
-
<listitem>
|
279
|
-
<para>
|
280
|
-
The ratio between shared and relocated code in the current executable or shared
|
281
|
-
object. Using this value you can have a quick idea of the cost/benefit of using
|
282
|
-
shared objects for a particular task.
|
283
|
-
</para>
|
284
|
-
|
285
|
-
<para>
|
286
|
-
When using <option>--decibel</option> the value will be represented in deciBels,
|
287
|
-
which should make it even easier to understand: a negative value shows a overly high
|
288
|
-
cost, while a value between 1 and 10 will indicate some work might be needed to
|
289
|
-
improve the benefits.
|
290
|
-
</para>
|
291
|
-
</listitem>
|
292
|
-
</varlistentry>
|
293
|
-
</variablelist>
|
294
|
-
</refsect1>
|
295
|
-
|
296
|
-
<refsect1>
|
297
|
-
<title>Bugs and Missing Features</title>
|
298
|
-
|
299
|
-
<para>
|
300
|
-
When using the <option>--differential</option> option, analysis of the arguments happens
|
301
|
-
sequentially in a single thread rather than in parallel.
|
302
|
-
</para>
|
303
|
-
|
304
|
-
<xi:include href="common.xmli" xpointer="xpointer(id('filelist.bugpara')/*)" />
|
305
|
-
</refsect1>
|
306
|
-
|
307
|
-
<refsect1>
|
308
|
-
<title>See Also</title>
|
309
|
-
<para>
|
310
|
-
<citation xl:href="http://blog.flameeyes.eu/">Flameeyes's Weblog</citation>
|
311
|
-
http://blog.flameeyes.eu/
|
312
|
-
</para>
|
313
|
-
|
314
|
-
<para>
|
315
|
-
Related tools:
|
316
|
-
|
317
|
-
<citerefentry>
|
318
|
-
<refentrytitle>cowstats</refentrytitle>
|
319
|
-
<manvolnum>1</manvolnum>
|
320
|
-
</citerefentry>,
|
321
|
-
|
322
|
-
<citerefentry>
|
323
|
-
<refentrytitle>size</refentrytitle>
|
324
|
-
<manvolnum>1</manvolnum>
|
325
|
-
</citerefentry>,
|
326
|
-
|
327
|
-
<citerefentry>
|
328
|
-
<refentrytitle>prelink</refentrytitle>
|
329
|
-
<manvolnum>8</manvolnum>
|
330
|
-
</citerefentry>.
|
331
|
-
</para>
|
332
|
-
</refsect1>
|
333
|
-
</refentry>
|
334
|
-
</section>
|
335
|
-
</article>
|
336
|
-
<!--
|
337
|
-
Local Variables:
|
338
|
-
mode: nxml
|
339
|
-
mode: auto-fill
|
340
|
-
mode: flyspell
|
341
|
-
ispell-local-dictionary: "english"
|
342
|
-
fill-column: 100
|
343
|
-
indent-tabs-mode: nil
|
344
|
-
End:
|
345
|
-
-->
|
data/manpages/verify-lfs.1.xml
DELETED
@@ -1,136 +0,0 @@
|
|
1
|
-
<?xml version='1.0'?>
|
2
|
-
<!--
|
3
|
-
Copyright © 2010-2011, Diego Elio Pettenò <flameeyes@flameeyes.eu>
|
4
|
-
|
5
|
-
This program is free software; you can redistribute it and/or modify
|
6
|
-
it under the terms of the GNU General Public License as published by
|
7
|
-
the Free Software Foundation; either version 2 of the License, or
|
8
|
-
(at your option) any later version.
|
9
|
-
|
10
|
-
This program is distributed in the hope that it will be useful,
|
11
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
|
-
GNU General Public License for more details.
|
14
|
-
|
15
|
-
You should have received a copy of the GNU General Public License
|
16
|
-
along with this generator; if not, write to the Free Software
|
17
|
-
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
18
|
-
-->
|
19
|
-
<article xmlns="http://docbook.org/ns/docbook"
|
20
|
-
xmlns:xl="http://www.w3.org/1999/xlink"
|
21
|
-
xmlns:xi="http://www.w3.org/2001/XInclude"
|
22
|
-
version="5.0" xml:lang="en">
|
23
|
-
<info>
|
24
|
-
<title>verify-lfs</title>
|
25
|
-
|
26
|
-
<xi:include parse="xml" href="author.xmli" />
|
27
|
-
</info>
|
28
|
-
|
29
|
-
<section>
|
30
|
-
<title>Reference</title>
|
31
|
-
|
32
|
-
<refentry>
|
33
|
-
<info>
|
34
|
-
<date>December 2010</date>
|
35
|
-
<productname>ruby-elf</productname>
|
36
|
-
</info>
|
37
|
-
<refmeta>
|
38
|
-
<refentrytitle>verify-lfs</refentrytitle>
|
39
|
-
<manvolnum>1</manvolnum>
|
40
|
-
</refmeta>
|
41
|
-
<refnamediv>
|
42
|
-
<refname>verify-lfs</refname>
|
43
|
-
<refpurpose>ELF analyzer to identify software not using solely LFS interfaces</refpurpose>
|
44
|
-
</refnamediv>
|
45
|
-
<refsynopsisdiv>
|
46
|
-
<cmdsynopsis>
|
47
|
-
<command>verify-lfs</command>
|
48
|
-
|
49
|
-
<arg choice="opt">
|
50
|
-
<option>--objects</option>
|
51
|
-
</arg>
|
52
|
-
|
53
|
-
<xi:include href="common.xmli" xpointer="xpointer(id('filelist.synopsis')/*)" />
|
54
|
-
</cmdsynopsis>
|
55
|
-
</refsynopsisdiv>
|
56
|
-
|
57
|
-
<refsect1>
|
58
|
-
<title>Description</title>
|
59
|
-
<para>
|
60
|
-
<command>verify-lfs</command> is a script that analyses the symbols required by ELF
|
61
|
-
executables and libraries, listing the objects that rely entirely or partially on the
|
62
|
-
pre-largefile interface functions of glibc.
|
63
|
-
</para>
|
64
|
-
</refsect1>
|
65
|
-
|
66
|
-
<refsect1>
|
67
|
-
<title>Options</title>
|
68
|
-
|
69
|
-
<variablelist>
|
70
|
-
<varlistentry>
|
71
|
-
<term><option>-o</option></term>
|
72
|
-
<term><option>--objects</option></term>
|
73
|
-
|
74
|
-
<listitem>
|
75
|
-
<para>
|
76
|
-
Scan for relocatable object files (ET_REL) rather than executables or dynamic
|
77
|
-
libraries. This mode is designed to help identify which object might be miscompiled
|
78
|
-
to not use LFS functions as it was instead intended.
|
79
|
-
</para>
|
80
|
-
</listitem>
|
81
|
-
</varlistentry>
|
82
|
-
|
83
|
-
<xi:include href="common.xmli" xpointer="xpointer(id('filelist.option')/*)" />
|
84
|
-
</variablelist>
|
85
|
-
</refsect1>
|
86
|
-
|
87
|
-
<refsect1>
|
88
|
-
<title>Bugs and Missing Features</title>
|
89
|
-
<para>
|
90
|
-
<command>verify-lfs</command> uses a manually-tweaked regular expression to identify which
|
91
|
-
interface is being used; this expressions might be incomplete or lead to false positive,
|
92
|
-
please double-check the results, and report back if you have hit false positives, or false
|
93
|
-
negatives.
|
94
|
-
</para>
|
95
|
-
|
96
|
-
<xi:include href="common.xmli" xpointer="xpointer(id('filelist.bugpara')/*)" />
|
97
|
-
</refsect1>
|
98
|
-
|
99
|
-
<refsect1>
|
100
|
-
<title>Credits</title>
|
101
|
-
|
102
|
-
<para>
|
103
|
-
The original idea for this script comes from the <filename>summarise-stat64</filename>
|
104
|
-
Perl script written by Greg Banks of SGI. A huge thanks to Greg for the idea and the
|
105
|
-
script.
|
106
|
-
</para>
|
107
|
-
</refsect1>
|
108
|
-
|
109
|
-
<refsect1>
|
110
|
-
<title>See Also</title>
|
111
|
-
<para>
|
112
|
-
<citation xl:href="http://blog.flameeyes.eu/">Flameeyes's Weblog</citation>
|
113
|
-
http://blog.flameeyes.eu/
|
114
|
-
</para>
|
115
|
-
|
116
|
-
<para>
|
117
|
-
Related tools:
|
118
|
-
<citerefentry>
|
119
|
-
<refentrytitle>nm</refentrytitle>
|
120
|
-
<manvolnum>1</manvolnum>
|
121
|
-
</citerefentry>.
|
122
|
-
</para>
|
123
|
-
</refsect1>
|
124
|
-
</refentry>
|
125
|
-
</section>
|
126
|
-
</article>
|
127
|
-
<!--
|
128
|
-
Local Variables:
|
129
|
-
mode: nxml
|
130
|
-
mode: auto-fill
|
131
|
-
mode: flyspell
|
132
|
-
ispell-local-dictionary: "english"
|
133
|
-
fill-column: 100
|
134
|
-
indent-tabs-mode: nil
|
135
|
-
End:
|
136
|
-
-->
|