1 .\" Copyright (c) 1999 Global Technology Associates, Inc.
2 .\" All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
13 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS``AS IS'' AND
14 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
17 .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
18 .\" OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
19 .\" OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
20 .\" BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
21 .\" WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
22 .\" OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
23 .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 .\" $FreeBSD: src/usr.sbin/kgzip/kgzip.8,v 1.3.2.3 2001/08/16 15:56:02 ru Exp $
43 utility compresses a kernel or some other bootable binary. Operation
44 is in two phases as follows:
47 A load image of the executable file is built which omits all but
52 segments. This image is compressed using
54 and output as data in relocatable object format.
56 The object file is linked with a special self-hosting loader, producing
57 an executable suitable for booting with either the second- or
58 third-level bootstraps.
61 Supported object formats are 32-bit ELF and a.out ZMAGIC.
67 suffix, input is assumed to be for the link phase, and the first phase
75 Display object file information.
79 as the output format, where
85 The default format is ELF.
93 The default is to use the input name with the suffix
100 Global variables equivalent to the following are defined in the output:
103 char ident[4]; /* identification: "KGZ" */
104 uint32_t dload; /* decoded image load address */
105 uint32_t dsize; /* decoded image size */
106 uint32_t isize; /* image size in memory */
107 uint32_t entry; /* entry point */
108 uint32_t nsize; /* encoded image size */
111 uint8_t kgz_ndata[]; /* encoded data */
114 The encoded data is simply
116 output: a header (with no optional fields); compressed data; and 32-bit
119 .Bl -tag -width /usr/lib/kgzldr.o -compact
120 .It Pa /usr/lib/kgzldr.o
133 .An Robert Nordier Aq Mt rnordier@FreeBSD.org .
135 As symbols are lost, the usefulness of this utility for compressing
136 kernels is limited to situations where
138 cannot be used; otherwise the preferred method of compressing a kernel