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