xref: /freebsd/usr.bin/elfctl/elfctl.1 (revision 0e2816f50ada7d863e26a630cdda327de449b1da)
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 March 1, 2020
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 l
39.Op Fl e Ar featurelist
40.Ar
41.Sh DESCRIPTION
42The
43.Nm
44utility modifies feature flags in the feature control note in an ELF binary.
45.Pp
46The options are as follows:
47.Bl -tag -width indent
48.It Fl h | Fl -help
49Print a usage message and exit.
50.It Fl l
51List known ELF feature flags.
52.It Fl e Ar featurelist
53Edit features from the given comma separated list
54.Ar featurelist .
55.Ar featurelist
56starts with one of the three operations:
57.Dq Li +
58to turn on the features,
59.Dq Li -
60to turn off the features,
61.Dq Li =
62to only turn on the given features.
63A comma separated list of feature names follows the operation.
64.El
65.Pp
66If
67.Fl e
68is not specified
69.Nm
70displays the status of each feature in the ELF note in each
71.Ar .
72.Sh EXIT STATUS
73Exit status is 0 on success, and 1 if the command
74fails if a file does not exist, is too short,
75or fails to find or edit features note.
76.Sh EXAMPLES
77The following is an example of a typical usage
78of the
79.Nm
80command:
81.Bd -literal -offset indent
82elfctl file
83elfctl -e +aslr file
84.Ed
85.Sh HISTORY
86.Nm
87first appeared in
88.Fx 13.0 .
89.Sh AUTHORS
90.Nm
91was written by
92.An Bora Ozarslan Mt borako.ozarslan@gmail.com
93under sponsorship from the
94.Fx Foundation.
95