]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - usr.bin/genassym/genassym.8
This commit was generated by cvs2svn to compensate for changes in r56889,
[FreeBSD/FreeBSD.git] / usr.bin / genassym / genassym.8
1 .\"
2 .\" $FreeBSD$
3 .\"
4 .Dd December 20, 1999
5 .Dt GENASSYM 8
6 .Os
7 .Sh NAME
8 .Nm genassym
9 .Nd generate assembler symbols from C
10 .Sh SYNOPSIS
11 .Nm genassym
12 .Op Fl o Ar outfile
13 .Ar objfile
14 .Sh DESCRIPTION
15 The
16 .Nm
17 command is a special-purpose program to generate assembler
18 symbols from C code and is used to interface the low-level
19 assembly code with the C code. This, for example, is used
20 to build a FreeBSD kernel or module.
21 Its
22 .Ar objfile
23 argument is the name of an ELF object file that holds the
24 symbol definitions. These definitions are extracted from
25 the object file and written to standard output or to the
26 file specified with
27 .Ar outfile ,
28 suitable for inclusion in assembler source files.
29 .Pp
30 The
31 .Nm
32 command only extracts symbols from the object file if they
33 are prefixed by
34 .Nm assym_
35 and are global data types, whose value is the value given
36 to the symbol. The following C declaration
37 .Bd -literal -offset indent -compact
38 int assym_MY_SYMBOL = 3;
39 .Ed
40 is used to create the following assembler symbol.
41 .Bd -literal -offset indent -compact
42 #define MY_SYMBOL 0x3
43 .Ed
44 Note that the size of the symbol is extracted from the
45 object file, which means that the symbol may have any type
46 that is wide enough to hold the value.
47 .Sh SEE ALSO
48 .Xr config 8
49 .Xr gensetdefs 8
50 .Sh AUTHORS
51 The
52 .Nm
53 command was written by
54 .An Marcel Moolenaar Aq marcel@FreeBSD.org
55 and was based on the
56 .Dv gensetdefs
57 command.
58 .Sh BUGS
59 Not all linkers store the size of the symbol in the ELF
60 object file. The GNU linker for Alpha has this bug for
61 example (binutils 2.9.1). In those cases the size of the
62 symbol is assumed to be equal to the word size of the ELF
63 object file. For Alpha this is 64 bits and for i386 this
64 is 32 bits.
65 .Sh HISTORY
66 The
67 .Nm
68 command first appeared in FreeBSD 4.0.