22DWARF module versioning
33=======================
44
5- 1. Introduction
6- ===============
5+ Introduction
6+ ============
77
88When CONFIG_MODVERSIONS is enabled, symbol versions for modules
99are typically calculated from preprocessed source code using the
@@ -14,8 +14,8 @@ selected, **gendwarfksyms** is used instead to calculate symbol versions
1414from the DWARF debugging information, which contains the necessary
1515details about the final module ABI.
1616
17- 1.1. Usage
18- ==========
17+ Usage
18+ -----
1919
2020gendwarfksyms accepts a list of object files on the command line, and a
2121list of symbol names (one per line) in standard input::
@@ -33,8 +33,8 @@ list of symbol names (one per line) in standard input::
3333 -h, --help Print this message
3434
3535
36- 2. Type information availability
37- ================================
36+ Type information availability
37+ =============================
3838
3939While symbols are typically exported in the same translation unit (TU)
4040where they're defined, it's also perfectly fine for a TU to export
@@ -56,8 +56,8 @@ type for calculating symbol versions even if the symbol is defined
5656elsewhere. The name of the symbol pointer is expected to start with
5757`__gendwarfksyms_ptr_ `, followed by the name of the exported symbol.
5858
59- 3. Symtypes output format
60- =========================
59+ Symtypes output format
60+ ======================
6161
6262Similarly to genksyms, gendwarfksyms supports writing a symtypes
6363file for each processed object that contain types for exported
@@ -85,8 +85,8 @@ produces C-style type strings, gendwarfksyms uses the same simple parsed
8585DWARF format produced by **--dump-dies **, but with type references
8686instead of fully expanded strings.
8787
88- 4. Maintaining a stable kABI
89- ============================
88+ Maintaining a stable kABI
89+ =========================
9090
9191Distribution maintainers often need the ability to make ABI compatible
9292changes to kernel data structures due to LTS updates or backports. Using
@@ -104,8 +104,8 @@ for source code annotation. Note that as these features are only used to
104104transform the inputs for symbol versioning, the user is responsible for
105105ensuring that their changes actually won't break the ABI.
106106
107- 4.1. kABI rules
108- ===============
107+ kABI rules
108+ ----------
109109
110110kABI rules allow distributions to fine-tune certain parts
111111of gendwarfksyms output and thus control how symbol
@@ -139,8 +139,8 @@ Currently, only the rules discussed in this section are supported, but
139139the format is extensible enough to allow further rules to be added as
140140need arises.
141141
142- 4.1.1. Managing definition visibility
143- =====================================
142+ Managing definition visibility
143+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
144144
145145A declaration can change into a full definition when additional includes
146146are pulled into the translation unit. This changes the versions of any
@@ -168,8 +168,8 @@ Example usage::
168168
169169 KABI_DECLONLY(s);
170170
171- 4.1.2. Adding enumerators
172- =========================
171+ Adding enumerators
172+ ~~~~~~~~~~~~~~~~~~
173173
174174For enums, all enumerators and their values are included in calculating
175175symbol versions, which becomes a problem if we later need to add more
@@ -223,8 +223,8 @@ Example usage::
223223 KABI_ENUMERATOR_IGNORE(e, C);
224224 KABI_ENUMERATOR_VALUE(e, LAST, 2);
225225
226- 4.3. Adding structure members
227- =============================
226+ Adding structure members
227+ ------------------------
228228
229229Perhaps the most common ABI compatible change is adding a member to a
230230kernel data structure. When changes to a structure are anticipated,
@@ -237,8 +237,8 @@ natural method. This section describes gendwarfksyms support for using
237237reserved space in data structures and hiding members that don't change
238238the ABI when calculating symbol versions.
239239
240- 4.3.1. Reserving space and replacing members
241- ============================================
240+ Reserving space and replacing members
241+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
242242
243243Space is typically reserved for later use by appending integer types, or
244244arrays, to the end of the data structure, but any type can be used. Each
@@ -276,8 +276,8 @@ The examples include `KABI_(RESERVE|USE|REPLACE)*` macros that help
276276simplify the process and also ensure the replacement member is correctly
277277aligned and its size won't exceed the reserved space.
278278
279- 4.3.2. Hiding members
280- =====================
279+ Hiding members
280+ ~~~~~~~~~~~~~~
281281
282282Predicting which structures will require changes during the support
283283timeframe isn't always possible, in which case one might have to resort
0 commit comments