]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - usr.bin/genassym/genassym.8
This commit was generated by cvs2svn to compensate for changes in r58653,
[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.
20 This, for example, is used
21 to build a FreeBSD kernel or module.
22 Its
23 .Ar objfile
24 argument is the name of an ELF object file that holds the
25 symbol definitions.
26 These definitions are extracted from
27 the object file and written to standard output or to the
28 file specified with
29 .Ar outfile ,
30 suitable for inclusion in assembler source files.
31 .Pp
32 The
33 .Nm
34 command only extracts symbols from the object file if they
35 are prefixed by
36 .Nm assym_
37 and are global data types, whose value is the value given
38 to the symbol.
39 The following C declaration
40 .Bd -literal -offset indent -compact
41 int assym_MY_SYMBOL = 3;
42 .Ed
43 is used to create the following assembler symbol.
44 .Bd -literal -offset indent -compact
45 #define MY_SYMBOL 0x3
46 .Ed
47 Note that the size of the symbol is extracted from the
48 object file, which means that the symbol may have any type
49 that is wide enough to hold the value.
50 .Sh SEE ALSO
51 .Xr config 8
52 .Xr gensetdefs 8
53 .Sh AUTHORS
54 The
55 .Nm
56 command was written by
57 .An Marcel Moolenaar Aq marcel@FreeBSD.org
58 and was based on the
59 .Dv gensetdefs
60 command.
61 .Sh BUGS
62 Not all linkers store the size of the symbol in the ELF
63 object file.
64 The GNU linker for Alpha has this bug for
65 example (binutils 2.9.1). In those cases the size of the
66 symbol is assumed to be equal to the word size of the ELF
67 object file.
68 For Alpha this is 64 bits and for i386 this
69 is 32 bits.
70 .Sh HISTORY
71 The
72 .Nm
73 command first appeared in FreeBSD 4.0.