]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - usr.bin/elfctl/elfctl.1
elfctl: allow features to be specified by value
[FreeBSD/FreeBSD.git] / usr.bin / elfctl / elfctl.1
1 .\" Copyright 2019 The FreeBSD Foundation.
2 .\"
3 .\" This software was developed by Bora Ozarslan under sponsorship from
4 .\" the FreeBSD Foundation.
5 .\"
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
8 .\" are met:
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\"    notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\"    notice, this list of conditions and the following disclaimer in the
13 .\"    documentation and/or other materials provided with the distribution.
14 .\"
15 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS''
16 .\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 .\" SUCH DAMAGE.
26 .\"
27 .\" $FreeBSD$
28 .\"
29 .Dd January 22, 2021
30 .Dt ELFCTL 1
31 .Os
32 .Sh NAME
33 .Nm elfctl
34 .Nd change an ELF binary's feature control note
35 .Sh SYNOPSIS
36 .Nm
37 .Op Fl h | Fl -help
38 .Op Fl i
39 .Op Fl l
40 .Op Fl e Ar featurelist
41 .Ar
42 .Sh DESCRIPTION
43 The
44 .Nm
45 utility modifies feature flags in the feature control note in an ELF binary.
46 .Pp
47 The options are as follows:
48 .Bl -tag -width indent
49 .It Fl h | Fl -help
50 Print a usage message and exit.
51 .It Fl i
52 Ignore unknown feature flags in
53 .Ar featurelist .
54 .It Fl l
55 List known ELF feature flags.
56 .It Fl e Ar featurelist
57 Edit features from the given comma separated list
58 .Ar featurelist .
59 .Ar featurelist
60 starts with one of the three operations:
61 .Dq Li +
62 to turn on the features,
63 .Dq Li -
64 to turn off the features,
65 .Dq Li =
66 to only turn on the given features.
67 A comma separated list of feature names or numeric values follows the
68 operation.
69 .El
70 .Pp
71 If
72 .Fl e
73 is not specified
74 .Nm
75 displays the status of each feature in the ELF note in each
76 .Ar .
77 .Sh EXIT STATUS
78 Exit status is 0 on success, and 1 if the command
79 fails if a file does not exist, is too short,
80 or fails to find or edit features note.
81 .Sh EXAMPLES
82 The following is an example of a typical usage
83 of the
84 .Nm
85 command:
86 .Bd -literal -offset indent
87 elfctl file
88 elfctl -e +aslr file
89 .Ed
90 .Pp
91 Features may be specified as numerical values:
92 .Bd -literal -offset -indent
93 elfctl -e =0x0001,0x0004 file
94 .Ed
95 .Pp
96 Features may also be specified as a single combined value:
97 .Bd -literal -offset -indent
98 elfctl -e =0x5 file
99 .Ed
100 .Sh HISTORY
101 .Nm
102 first appeared in
103 .Fx 12.2 .
104 .Sh AUTHORS
105 .Nm
106 was written by
107 .An Bora Ozarslan Mt borako.ozarslan@gmail.com
108 under sponsorship from the
109 .Fx Foundation.