2019-09-27 16:27:52 +00:00
|
|
|
.\" Copyright 2019 The FreeBSD Foundation.
|
|
|
|
.\"
|
|
|
|
.\" This software was developed by Bora Ozarslan under sponsorship from
|
|
|
|
.\" the FreeBSD Foundation.
|
|
|
|
.\"
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS''
|
|
|
|
.\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
|
|
|
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
.\" SUCH DAMAGE.
|
|
|
|
.\"
|
|
|
|
.\" $FreeBSD$
|
|
|
|
.\"
|
2020-03-02 02:36:41 +00:00
|
|
|
.Dd March 1, 2020
|
|
|
|
.Dt ELFCTL 1
|
2019-09-27 16:27:52 +00:00
|
|
|
.Os
|
|
|
|
.Sh NAME
|
2020-03-02 02:36:41 +00:00
|
|
|
.Nm elfctl
|
2019-09-27 19:26:52 +00:00
|
|
|
.Nd change an ELF binary's feature control note
|
2019-09-27 16:27:52 +00:00
|
|
|
.Sh SYNOPSIS
|
|
|
|
.Nm
|
|
|
|
.Op Fl h | Fl -help
|
|
|
|
.Op Fl l
|
|
|
|
.Op Fl e Ar featurelist
|
|
|
|
.Ar
|
|
|
|
.Sh DESCRIPTION
|
|
|
|
The
|
|
|
|
.Nm
|
2019-09-27 19:26:52 +00:00
|
|
|
utility modifies feature flags in the feature control note in an ELF binary.
|
2019-09-27 16:27:52 +00:00
|
|
|
.Pp
|
|
|
|
The options are as follows:
|
|
|
|
.Bl -tag -width indent
|
|
|
|
.It Fl h | Fl -help
|
|
|
|
Print a usage message and exit.
|
|
|
|
.It Fl l
|
2019-09-27 19:26:52 +00:00
|
|
|
List known ELF feature flags.
|
2019-09-27 16:27:52 +00:00
|
|
|
.It Fl e Ar featurelist
|
|
|
|
Edit features from the given comma separated list
|
|
|
|
.Ar featurelist .
|
|
|
|
.Ar featurelist
|
2019-09-27 19:26:52 +00:00
|
|
|
starts with one of the three operations:
|
2019-09-27 16:27:52 +00:00
|
|
|
.Dq Li +
|
|
|
|
to turn on the features,
|
|
|
|
.Dq Li -
|
|
|
|
to turn off the features,
|
|
|
|
.Dq Li =
|
|
|
|
to only turn on the given features.
|
2019-09-27 19:26:52 +00:00
|
|
|
A comma separated list of feature names follows the operation.
|
2019-09-27 16:27:52 +00:00
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
If
|
2019-09-27 19:26:52 +00:00
|
|
|
.Fl e
|
|
|
|
is not specified
|
2019-09-27 16:27:52 +00:00
|
|
|
.Nm
|
2019-09-27 19:26:52 +00:00
|
|
|
displays the status of each feature in the ELF note in each
|
2019-09-27 16:27:52 +00:00
|
|
|
.Ar .
|
|
|
|
.Sh EXIT STATUS
|
|
|
|
Exit status is 0 on success, and 1 if the command
|
|
|
|
fails if a file does not exist, is too short,
|
|
|
|
or fails to find or edit features note.
|
|
|
|
.Sh EXAMPLES
|
|
|
|
The following is an example of a typical usage
|
|
|
|
of the
|
|
|
|
.Nm
|
|
|
|
command:
|
|
|
|
.Bd -literal -offset indent
|
2020-03-02 02:36:41 +00:00
|
|
|
elfctl file
|
|
|
|
elfctl -e +aslr file
|
2019-09-27 16:27:52 +00:00
|
|
|
.Ed
|
|
|
|
.Sh HISTORY
|
|
|
|
.Nm
|
2019-09-27 19:26:52 +00:00
|
|
|
first appeared in
|
2020-05-05 21:50:52 +00:00
|
|
|
.Fx 12.2 .
|
2019-09-27 16:27:52 +00:00
|
|
|
.Sh AUTHORS
|
2019-09-27 19:26:52 +00:00
|
|
|
.Nm
|
|
|
|
was written by
|
|
|
|
.An Bora Ozarslan Mt borako.ozarslan@gmail.com
|
|
|
|
under sponsorship from the
|
|
|
|
.Fx Foundation.
|