1
1
===========================
2
- Livepatch module Elf format
2
+ Livepatch module ELF format
3
3
===========================
4
4
5
- This document outlines the Elf format requirements that livepatch modules must follow.
5
+ This document outlines the ELF format requirements that livepatch modules must follow.
6
6
7
7
8
8
.. Table of Contents
@@ -20,17 +20,17 @@ code. So, instead of duplicating code and re-implementing what the module
20
20
loader can already do, livepatch leverages existing code in the module
21
21
loader to perform the all the arch-specific relocation work. Specifically,
22
22
livepatch reuses the apply_relocate_add() function in the module loader to
23
- write relocations. The patch module Elf format described in this document
23
+ write relocations. The patch module ELF format described in this document
24
24
enables livepatch to be able to do this. The hope is that this will make
25
25
livepatch more easily portable to other architectures and reduce the amount
26
26
of arch-specific code required to port livepatch to a particular
27
27
architecture.
28
28
29
29
Since apply_relocate_add() requires access to a module's section header
30
- table, symbol table, and relocation section indices, Elf information is
30
+ table, symbol table, and relocation section indices, ELF information is
31
31
preserved for livepatch modules (see section 5). Livepatch manages its own
32
32
relocation sections and symbols, which are described in this document. The
33
- Elf constants used to mark livepatch symbols and relocation sections were
33
+ ELF constants used to mark livepatch symbols and relocation sections were
34
34
selected from OS-specific ranges according to the definitions from glibc.
35
35
36
36
Why does livepatch need to write its own relocations?
@@ -43,7 +43,7 @@ reject the livepatch module. Furthermore, we cannot apply relocations that
43
43
affect modules not yet loaded at patch module load time (e.g. a patch to a
44
44
driver that is not loaded). Formerly, livepatch solved this problem by
45
45
embedding special "dynrela" (dynamic rela) sections in the resulting patch
46
- module Elf output. Using these dynrela sections, livepatch could resolve
46
+ module ELF output. Using these dynrela sections, livepatch could resolve
47
47
symbols while taking into account its scope and what module the symbol
48
48
belongs to, and then manually apply the dynamic relocations. However this
49
49
approach required livepatch to supply arch-specific code in order to write
@@ -80,7 +80,7 @@ Example:
80
80
3. Livepatch relocation sections
81
81
================================
82
82
83
- A livepatch module manages its own Elf relocation sections to apply
83
+ A livepatch module manages its own ELF relocation sections to apply
84
84
relocations to modules as well as to the kernel (vmlinux) at the
85
85
appropriate time. For example, if a patch module patches a driver that is
86
86
not currently loaded, livepatch will apply the corresponding livepatch
@@ -95,7 +95,7 @@ also possible for a livepatch module to have no livepatch relocation
95
95
sections, as in the case of the sample livepatch module (see
96
96
samples/livepatch).
97
97
98
- Since Elf information is preserved for livepatch modules (see Section 5), a
98
+ Since ELF information is preserved for livepatch modules (see Section 5), a
99
99
livepatch relocation section can be applied simply by passing in the
100
100
appropriate section index to apply_relocate_add(), which then uses it to
101
101
access the relocation section and apply the relocations.
@@ -291,12 +291,12 @@ Examples:
291
291
Note that the 'Ndx' (Section index) for these symbols is SHN_LIVEPATCH (0xff20).
292
292
"OS" means OS-specific.
293
293
294
- 5. Symbol table and Elf section access
294
+ 5. Symbol table and ELF section access
295
295
======================================
296
296
A livepatch module's symbol table is accessible through module->symtab.
297
297
298
298
Since apply_relocate_add() requires access to a module's section headers,
299
- symbol table, and relocation section indices, Elf information is preserved for
299
+ symbol table, and relocation section indices, ELF information is preserved for
300
300
livepatch modules and is made accessible by the module loader through
301
301
module->klp_info, which is a :c:type: `klp_modinfo ` struct. When a livepatch module
302
302
loads, this struct is filled in by the module loader.
0 commit comments