1
2linker.hints file consists from the one or more records,
3and is processed by sys/kern/kern_linker.c::linker_hints_lookup()
4
5First record of file is special and determines its version:
6
7int	version;
8
9    All subsequent records have following format:
10    
11struct record {
12	int	length;		/* length of following data */
13	char	data[length];
14};
15
16    Each record is aligned on sizeof(int) boundary. First integer of the field
17'data' determines its type:
18
19struct data {
20	int	type;		/* type of data. currently MDT_* values */
21};
22
23    The rest of record depends on the type.
24
25struct string {
26	uint8_t	length;		/* length of string */
27	char	val[];		/* string itself (no terminating zero) */
28};
29
30struct data_mdt_version {
31	int	type = MDT_VERSION;
32	struct string	modname;
33	/* padding */
34	int	version;
35	struct string	kldname;
36	/* padding */
37};
38
39struct data_mdt_module {
40	int	type = MDT_MODULE;
41	struct string	modname;
42	struct string	kldname;
43	/* padding */
44};
45