]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - usr.sbin/kldxref/fileformat
libarchive: merge security fix from vendor branch
[FreeBSD/FreeBSD.git] / usr.sbin / kldxref / fileformat
1
2 linker.hints file consists from the one or more records,
3 and is processed by sys/kern/kern_linker.c::linker_hints_lookup()
4
5 First record of file is special and determines its version:
6
7 int     version;
8
9     All subsequent records have following format:
10     
11 struct 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
19 struct data {
20         int     type;           /* type of data. currently MDT_* values */
21 };
22
23     The rest of record depends on the type.
24
25 struct string {
26         uint8_t length;         /* length of string */
27         char    val[];          /* string itself (no terminating zero) */
28 };
29
30 struct 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
39 struct data_mdt_module {
40         int     type = MDT_MODULE;
41         struct string   modname;
42         struct string   kldname;
43         /* padding */
44 };