ruby-elf 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,176 @@
1
+ '\" t
2
+ .\" Title: missingstatic
3
+ .\" Author:
4
+ .\" Generator: DocBook XSL-NS Stylesheets v1.76.0 <http://docbook.sf.net/>
5
+ .\" Date: October 2008
6
+ .\" Manual: Reference
7
+ .\" Source: ruby-elf
8
+ .\" Language: English
9
+ .\"
10
+ .TH "MISSINGSTATIC" "1" "October 2008" "ruby-elf" "Reference"
11
+ .\" -----------------------------------------------------------------
12
+ .\" * Define some portability stuff
13
+ .\" -----------------------------------------------------------------
14
+ .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15
+ .\" http://bugs.debian.org/507673
16
+ .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17
+ .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18
+ .ie \n(.g .ds Aq \(aq
19
+ .el .ds Aq '
20
+ .\" -----------------------------------------------------------------
21
+ .\" * set default formatting
22
+ .\" -----------------------------------------------------------------
23
+ .\" disable hyphenation
24
+ .nh
25
+ .\" disable justification (adjust text to left margin only)
26
+ .ad l
27
+ .\" -----------------------------------------------------------------
28
+ .\" * MAIN CONTENT STARTS HERE *
29
+ .\" -----------------------------------------------------------------
30
+ .SH "NAME"
31
+ missingstatic \- ELF analyzer to identify missing static modifiers
32
+ .SH "SYNOPSIS"
33
+ .HP \w'\fBmissingstatic\fR\ 'u
34
+ \fBmissingstatic\fR [\fB\-\-hidden\-only\fR] [\fB\-\-show\-type\fR] [\fB\-\-exclude\-regexp\fR\ \fIregular\-expression\fR] [\fB\-\-exclude\-tags\fR\ \fItags\-file\fR] [\fB\-\-quiet\fR] [\fB\-\-recursive\fR] [\fB@\fR\fIfile\fR | \fIfile\fR...]
35
+ .SH "DESCRIPTION"
36
+ .PP
37
+
38
+ \fBmissingstatic\fR
39
+ is a script that analyses ELF object files to identify symbols that are unused outside their compilation unit\&. Those symbols are usually candidate for the
40
+ \fBstatic\fR
41
+ modifier, to make the symbol local to the unit\&.
42
+ .PP
43
+ In addition to symbols that are used only internally to an unit, this script will most likely report the almost entire set of externally\-visible API in the case of libraries\&. For this reason, options are provided to reduce the scope of action\&.
44
+ .SH "OPTIONS"
45
+ .PP
46
+ \fB\-h\fR, \fB\-\-hidden\-only\fR
47
+ .RS 4
48
+ Only show symbols that have hidden visibility\&. Hidden symbols are not visible from outside the module, and thus will ignore the external visible symbols that compose the externally\-visible API\&. This option is only useful for libraries that make proper use of visibility attributes\&.
49
+ .RE
50
+ .PP
51
+ \fB\-t\fR, \fB\-\-show\-type\fR
52
+ .RS 4
53
+ Show the type of the symbol\&. The symbols reported by the script might be functions, variables, or constants\&. By default, only the name of the symbol, with this option, a letter in front of the symbol will tell you the type of it; the letters are the same as used by GNU
54
+ \fBnm\fR(1):
55
+ .PP
56
+ T
57
+ .RS 4
58
+ The symbol is in the text (code) section, and is thus a function
59
+ .RE
60
+ .PP
61
+ B
62
+ .RS 4
63
+ The symbol is in the uninitialised data section (known as BSS), and is thus a variable\&.
64
+ .RE
65
+ .PP
66
+ D
67
+ .RS 4
68
+ The symbol is in the initialised data section, and is thus a variable\&.
69
+ .RE
70
+ .PP
71
+ R
72
+ .RS 4
73
+ The symbol is in the read only data section, and is thus a constant\&.
74
+ .RE
75
+ .sp
76
+ .RE
77
+ .PP
78
+ \fB\-x\fR \fIregular\-expression\fR, \fB\-\-exclude\-regexp\fR \fIregular\-expression\fR
79
+ .RS 4
80
+ Ignore symbols whose name triggers the given regular expression\&. This option is useful to hide all the symbols of the public API of a library if they all have the same prefix\&. It can be used multiple times\&.
81
+ .RE
82
+ .PP
83
+ \fB\-X\fR \fItags\-file\fR, \fB\-\-exclude\-tags\fR \fItags\-file\fR
84
+ .RS 4
85
+ Ignore symbols present in a tags file created by
86
+ \fBexuberant\-ctags\fR\&. This option is useful to hide all the symbols in the public header files of a project, by creating a list of public\-visible symbols\&. See the
87
+ EXAMPLES
88
+ section for how to generate such a tags file\&. It can be used multiple times\&.
89
+ .RE
90
+ .PP
91
+ \fB\-q\fR, \fB\-\-quiet\fR
92
+ .RS 4
93
+ Do not output warnings and errors to the standard error\&. Designed to increase the signal\-to\-noise ratio when analysing eterogeneous trees recursively, or when producing output to redirect to automated systems\&.
94
+ .RE
95
+ .PP
96
+ \fB\-R\fR, \fB\-\-recursive\fR
97
+ .RS 4
98
+ Recursively descend into directories to search for files to scan\&. This affects both the paths passed from the command line and those found in argument files\&.
99
+ .RE
100
+ .PP
101
+ \fB@\fR\fIpath\fR
102
+ .RS 4
103
+ Read the list of files to analyse from the given file (or standard input if
104
+ \fIpath\fR
105
+ is
106
+ \-)\&. Useful to pass a long list of files\&. When used with stdin or named pipes, this also allows asynchronous analysis\&.
107
+ .RE
108
+ .SH "EXAMPLES"
109
+ .SS "Generating the tags file"
110
+ .PP
111
+ To generate a tags file compatible with the
112
+ \fB\-\-exclude\-tags\fR
113
+ command\-line option, you can use
114
+ \fBexuberant-ctags\fR(1)
115
+ with a command similar to the following:
116
+ .PP
117
+ \fBExample\ \&1.\ \& Generate a tags file for public header files\fR
118
+ .sp
119
+ .if n \{\
120
+ .RS 4
121
+ .\}
122
+ .nf
123
+ exuberant\-ctags \-\-c\-kinds=px \-f public\-symbols include/public/*\&.h
124
+
125
+ .fi
126
+ .if n \{\
127
+ .RE
128
+ .\}
129
+ .SS "Sorting missingstatic output"
130
+ .PP
131
+ Since sorting by translation unit is non\-trivial inside the script, piping through
132
+ \fBsort\fR(1)
133
+ is suggested\&. Using the
134
+ \fB\-k\fR
135
+ option it\*(Aqs possible to sort for the desired key, may it be the symbol name, the translation unit name or the symbol type\&.
136
+ .PP
137
+ \fBExample\ \&2.\ \&Sorting missingstatic output for translation unit name\fR
138
+ .sp
139
+ .if n \{\
140
+ .RS 4
141
+ .\}
142
+ .nf
143
+ find \&. \-name \*(Aq*\&.o\*(Aq | missingstatic \-h | sort \-k2
144
+
145
+ .fi
146
+ .if n \{\
147
+ .RE
148
+ .\}
149
+ .SH "BUGS AND MISSING FEATURES"
150
+ .PP
151
+
152
+ \fBmissingstatic\fR
153
+ assumes that all the sources for a module and just that module will be passed to it, if more or less sources will be passed to the command, the results might not be the expected ones\&.
154
+ .PP
155
+ Parsing of files to provide further arguments (\fB@\fR\fIfile\fR) is not entirely comforming to other tools handling of the same syntax\&. No options are parsed from the file, and filenames are expected to be separated by newlines rather than whitespace\&.
156
+ .PP
157
+ Symbolic links are only followed when they are passed directly to the command line, or through @\-lists; symbolic links are
158
+ \fInot\fR
159
+ followed when using the
160
+ \fB\-\-recursive\fR
161
+ option, to avoid loops\&.
162
+ .SH "SEE ALSO"
163
+ .PP
164
+
165
+ \m[blue]\fBFlameeyes\*(Aqs Weblog\fR\m[]
166
+ http://blog\&.flameeyes\&.eu/
167
+ .PP
168
+ Related tools:
169
+ \fBnm\fR(1),
170
+ \fBexuberant-ctags\fR(1)\&.
171
+ .SH "AUTHOR"
172
+ .PP
173
+ \fBDiego E. Pettenò\fR <\&flameeyes@gmail.com\&>
174
+ .RS 4
175
+ Author and main contributor.
176
+ .RE
@@ -0,0 +1,186 @@
1
+ '\" t
2
+ .\" Title: rbelf-size
3
+ .\" Author:
4
+ .\" Generator: DocBook XSL-NS Stylesheets v1.76.0 <http://docbook.sf.net/>
5
+ .\" Date: October 2008
6
+ .\" Manual: Reference
7
+ .\" Source: ruby-elf
8
+ .\" Language: English
9
+ .\"
10
+ .TH "RBELF\-SIZE" "1" "October 2008" "ruby-elf" "Reference"
11
+ .\" -----------------------------------------------------------------
12
+ .\" * Define some portability stuff
13
+ .\" -----------------------------------------------------------------
14
+ .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15
+ .\" http://bugs.debian.org/507673
16
+ .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17
+ .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18
+ .ie \n(.g .ds Aq \(aq
19
+ .el .ds Aq '
20
+ .\" -----------------------------------------------------------------
21
+ .\" * set default formatting
22
+ .\" -----------------------------------------------------------------
23
+ .\" disable hyphenation
24
+ .nh
25
+ .\" disable justification (adjust text to left margin only)
26
+ .ad l
27
+ .\" -----------------------------------------------------------------
28
+ .\" * MAIN CONTENT STARTS HERE *
29
+ .\" -----------------------------------------------------------------
30
+ .SH "NAME"
31
+ rbelf-size \- List section sizes of ELF files
32
+ .SH "SYNOPSIS"
33
+ .HP \w'\fBrbelf\-size\fR\ 'u
34
+ \fBrbelf\-size\fR [\fB\-\-relocation\-stats\fR\ [\fB\-\-decibel\fR]] [\fB\-\-quiet\fR] [\fB\-\-recursive\fR] [\fB@\fR\fIfile\fR | \fIfile\fR...]
35
+ .SH "DESCRIPTION"
36
+ .PP
37
+
38
+ \fBrbelf\-size\fR
39
+ is a replacement for the standard
40
+ \fBsize\fR(1)
41
+ utility, as provided by GNU binutils and similar suites\&. Instead of showing the sum of all the invariant, variant and unallocated sections as the size, it divides them depending on how they are treated, differentiating between invariant data, invariant code, variant data and relocated invariant data\&.
42
+ .SH "OPTIONS"
43
+ .PP
44
+ \fB\-r\fR, \fB\-\-relocation\-stats\fR
45
+ .RS 4
46
+ Instead of reporting size data compatible with
47
+ \fBsize\fR(1)
48
+ report size for shared, private and relocated areas\&. This is helpful to assess the validity of shared object approaches\&.
49
+ .RE
50
+ .PP
51
+ \fB\-d\fR, \fB\-\-decibel\fR
52
+ .RS 4
53
+ When using the
54
+ \fB\-\-relocation\-stats\fR
55
+ option, a ratio is displayed between the size of relocated and shared code areas, to better assess the advantages and disadvantages for shared object approaches\&.
56
+ .sp
57
+ Since that ratio can easily skyrocket into thousands if there is very little relocated data, and a lot of shared data, it might be easier to appreciate the results by using a logaritmic scale\&.
58
+ .RE
59
+ .PP
60
+ \fB\-q\fR, \fB\-\-quiet\fR
61
+ .RS 4
62
+ Do not output warnings and errors to the standard error\&. Designed to increase the signal\-to\-noise ratio when analysing eterogeneous trees recursively, or when producing output to redirect to automated systems\&.
63
+ .RE
64
+ .PP
65
+ \fB\-R\fR, \fB\-\-recursive\fR
66
+ .RS 4
67
+ Recursively descend into directories to search for files to scan\&. This affects both the paths passed from the command line and those found in argument files\&.
68
+ .RE
69
+ .PP
70
+ \fB@\fR\fIpath\fR
71
+ .RS 4
72
+ Read the list of files to analyse from the given file (or standard input if
73
+ \fIpath\fR
74
+ is
75
+ \-)\&. Useful to pass a long list of files\&. When used with stdin or named pipes, this also allows asynchronous analysis\&.
76
+ .RE
77
+ .SH "COMPATIBLE OUTPUT"
78
+ .PP
79
+ The output of
80
+ \fBrbelf\-size\fR
81
+ differs from that of
82
+ \fBsize\fR
83
+ for the number and type of columns it outputs\&. While the original BSD command outputs the size of the "text", "data" and "bss" sections, this tool splits them further\&.
84
+ .PP
85
+ exec
86
+ .RS 4
87
+ Counts in all the sections containing executable code, this includes the
88
+ \fI\&.text\fR
89
+ section, and others\&.
90
+ .RE
91
+ .PP
92
+ data
93
+ .RS 4
94
+ Counts in all the sections containing variable data, this excludes read\-only data sections, but includes relocated data and other kind of allocated and writeable data sections\&. If the compiler is GCC or outputs GCC\-compatible section names this won\*(Aqt count in relocated constants\&.
95
+ .RE
96
+ .PP
97
+ relro
98
+ .RS 4
99
+ Counts in the relocated constants (read\-only relocated data)\&. This column will be non\-null only for binaries compiled by GCC or by compilers emitting GCC\-compatible section names\&. The sections counted in this entry will are relocated at runtime, but are never otherwise modified\&. The reason why this is separated is that this section may be touched by
100
+ \fBprelink\fR(8)
101
+ so that the runtime relocation is not needed, and thus would count just as common constant data\&.
102
+ .RE
103
+ .PP
104
+ bss
105
+ .RS 4
106
+ Just like
107
+ \fBsize\fR
108
+ bss column, this counts in the size of sections that are allocated at runtime as mapped to the zero page\&. It supports TLS
109
+ \fI\&.tbss\fR
110
+ section\&.
111
+ .RE
112
+ .PP
113
+ total
114
+ .RS 4
115
+ Counts in the sum of all the previous sections\&.
116
+ .RE
117
+ .SH "RELOCATION STATISTICS"
118
+ .PP
119
+ When using shared objects rather than static linking, there are many trade\-offs to be made\&. One of these relates to the amount of code that will get relocated (and thus becomes private, per\-process resident memory)\&.
120
+ .PP
121
+ The
122
+ \fB\-\-relocation\-stats\fR
123
+ option was devised as a mean to assess the cost/benefit of using shared objects, rather than using static link (e\&.g\&. with multicall binaries)\&.
124
+ .PP
125
+ shared
126
+ .RS 4
127
+ Areas of memory that are always shared among processes; these include executable areas with Position Indipendent Code, and read\-only data areas\&.
128
+ .sp
129
+ Generally, this is what we would want to have as big as possible, compared to the rest\&.
130
+ .RE
131
+ .PP
132
+ private
133
+ .RS 4
134
+ Areas of memory that will always be private to the process; these includes writeable data areas and areas remapped to the zero page (what above is called bss)\&.
135
+ .sp
136
+ This is a worst\-case value, as even though the writeable sections _may_ become private, if they are left untouched they will be shared among multiple (if not all) processes\&. It is, though, useful to consider the worst\-case scenario for assesment\&.
137
+ .RE
138
+ .PP
139
+ relocated
140
+ .RS 4
141
+ This value sums up the size of the memory areas that will be relocated when using shared objects (or Position Indipendent Executables)\&. Relocated areas include \&.data\&.rel\&.ro sections, which contain data read\-only for the code, but written to by the dynamic linker\&.
142
+ .sp
143
+ Again this value is an approximation nearing the worst\-case scenario\&.
144
+ .RE
145
+ .PP
146
+ ratio
147
+ .RS 4
148
+ The ratio between shared and relocated code in the current executable or shared object\&. Using this value you can have a quick idea of the cost/benefit of using shared objects for a particular task\&.
149
+ .sp
150
+ When using
151
+ \fB\-\-decibel\fR
152
+ the value will be represented in deciBels, which should make it even easier to understand: a negative value shows a overly high cost, while a value between 1 and 10 will indicate some work might be needed to improve the benefits\&.
153
+ .RE
154
+ .SH "BUGS AND MISSING FEATURES"
155
+ .PP
156
+ The name
157
+ \fItotal\fR
158
+ for the sum of the colums is misleading since it\*(Aqs actually not the total size of the file, nor the total size of the allocated entries\&.
159
+ .PP
160
+ Right now, all the sections are counted in if their flags match, it might be better to limit to allocated sections all over the place\&.
161
+ .PP
162
+ The size of the columns is fixed to 8 digits, it might not be enough to fill in enough space for some big ELF files\&.
163
+ .PP
164
+ Parsing of files to provide further arguments (\fB@\fR\fIfile\fR) is not entirely comforming to other tools handling of the same syntax\&. No options are parsed from the file, and filenames are expected to be separated by newlines rather than whitespace\&.
165
+ .PP
166
+ Symbolic links are only followed when they are passed directly to the command line, or through @\-lists; symbolic links are
167
+ \fInot\fR
168
+ followed when using the
169
+ \fB\-\-recursive\fR
170
+ option, to avoid loops\&.
171
+ .SH "SEE ALSO"
172
+ .PP
173
+
174
+ \m[blue]\fBFlameeyes\*(Aqs Weblog\fR\m[]
175
+ http://blog\&.flameeyes\&.eu/
176
+ .PP
177
+ Related tools:
178
+ \fBcowstats\fR(1),
179
+ \fBsize\fR(1),
180
+ \fBprelink\fR(8)\&.
181
+ .SH "AUTHOR"
182
+ .PP
183
+ \fBDiego E. Pettenò\fR <\&flameeyes@gmail.com\&>
184
+ .RS 4
185
+ Author and main contributor.
186
+ .RE
@@ -0,0 +1,95 @@
1
+ '\" t
2
+ .\" Title: verify-lfs
3
+ .\" Author:
4
+ .\" Generator: DocBook XSL-NS Stylesheets v1.76.0 <http://docbook.sf.net/>
5
+ .\" Date: December 2010
6
+ .\" Manual: Reference
7
+ .\" Source: ruby-elf
8
+ .\" Language: English
9
+ .\"
10
+ .TH "VERIFY\-LFS" "1" "December 2010" "ruby-elf" "Reference"
11
+ .\" -----------------------------------------------------------------
12
+ .\" * Define some portability stuff
13
+ .\" -----------------------------------------------------------------
14
+ .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15
+ .\" http://bugs.debian.org/507673
16
+ .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17
+ .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18
+ .ie \n(.g .ds Aq \(aq
19
+ .el .ds Aq '
20
+ .\" -----------------------------------------------------------------
21
+ .\" * set default formatting
22
+ .\" -----------------------------------------------------------------
23
+ .\" disable hyphenation
24
+ .nh
25
+ .\" disable justification (adjust text to left margin only)
26
+ .ad l
27
+ .\" -----------------------------------------------------------------
28
+ .\" * MAIN CONTENT STARTS HERE *
29
+ .\" -----------------------------------------------------------------
30
+ .SH "NAME"
31
+ verify-lfs \- ELF analyzer to identify software not using solely LFS interfaces
32
+ .SH "SYNOPSIS"
33
+ .HP \w'\fBverify\-lfs\fR\ 'u
34
+ \fBverify\-lfs\fR [\fB\-\-objects\fR] [\fB\-\-quiet\fR] [\fB\-\-recursive\fR] [\fB@\fR\fIfile\fR | \fIfile\fR...]
35
+ .SH "DESCRIPTION"
36
+ .PP
37
+
38
+ \fBverify\-lfs\fR
39
+ is a script that analyses the symbols required by ELF executables and libraries, listing the objects that rely entirely or partially on the pre\-largefile interface functions of glibc\&.
40
+ .SH "OPTIONS"
41
+ .PP
42
+ \fB\-o\fR, \fB\-\-objects\fR
43
+ .RS 4
44
+ Scan for relocatable object files (ET_REL) rather than executables or dynamic libraries\&. This mode is designed to help identify which object might be miscompiled to not use LFS functions as it was instead intended\&.
45
+ .RE
46
+ .PP
47
+ \fB\-q\fR, \fB\-\-quiet\fR
48
+ .RS 4
49
+ Do not output warnings and errors to the standard error\&. Designed to increase the signal\-to\-noise ratio when analysing eterogeneous trees recursively, or when producing output to redirect to automated systems\&.
50
+ .RE
51
+ .PP
52
+ \fB\-R\fR, \fB\-\-recursive\fR
53
+ .RS 4
54
+ Recursively descend into directories to search for files to scan\&. This affects both the paths passed from the command line and those found in argument files\&.
55
+ .RE
56
+ .PP
57
+ \fB@\fR\fIpath\fR
58
+ .RS 4
59
+ Read the list of files to analyse from the given file (or standard input if
60
+ \fIpath\fR
61
+ is
62
+ \-)\&. Useful to pass a long list of files\&. When used with stdin or named pipes, this also allows asynchronous analysis\&.
63
+ .RE
64
+ .SH "BUGS AND MISSING FEATURES"
65
+ .PP
66
+
67
+ \fBverify\-lfs\fR
68
+ uses a manually\-tweaked regular expression to identify which interface is being used; this expressions might be incomplete or lead to false positive, please double\-check the results, and report back if you have hit false positives, or false negatives\&.
69
+ .PP
70
+ Parsing of files to provide further arguments (\fB@\fR\fIfile\fR) is not entirely comforming to other tools handling of the same syntax\&. No options are parsed from the file, and filenames are expected to be separated by newlines rather than whitespace\&.
71
+ .PP
72
+ Symbolic links are only followed when they are passed directly to the command line, or through @\-lists; symbolic links are
73
+ \fInot\fR
74
+ followed when using the
75
+ \fB\-\-recursive\fR
76
+ option, to avoid loops\&.
77
+ .SH "CREDITS"
78
+ .PP
79
+ The original idea for this script comes from the
80
+ summarise\-stat64
81
+ Perl script written by Greg Banks of SGI\&. A huge thanks to Greg for the idea and the script\&.
82
+ .SH "SEE ALSO"
83
+ .PP
84
+
85
+ \m[blue]\fBFlameeyes\*(Aqs Weblog\fR\m[]
86
+ http://blog\&.flameeyes\&.eu/
87
+ .PP
88
+ Related tools:
89
+ \fBnm\fR(1)\&.
90
+ .SH "AUTHOR"
91
+ .PP
92
+ \fBDiego E. Pettenò\fR <\&flameeyes@gmail.com\&>
93
+ .RS 4
94
+ Author and main contributor.
95
+ .RE