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