Lines Matching +full:- +full:section
16 Formerly, livepatch required separate architecture-specific code to write
17 relocations. However, arch-specific code to write relocations already
19 code. So, instead of duplicating code and re-implementing what the module
21 loader to perform the all the arch-specific relocation work. Specifically,
26 of arch-specific code required to port livepatch to a particular
29 Since apply_relocate_add() requires access to a module's section header
30 table, symbol table, and relocation section indices, ELF information is
31 preserved for livepatch modules (see section 5). Livepatch manages its own
34 selected from OS-specific ranges according to the definitions from glibc.
37 -----------------------------------------------------
39 reference non-exported global symbols and non-included local symbols.
40 Relocations referencing these types of symbols cannot be left in as-is
49 approach required livepatch to supply arch-specific code in order to write
52 relas reference are special livepatch symbols (see section 2 and 3). The
53 arch-specific livepatch relocation code is replaced by a call to
67 --------
73 % modinfo livepatch-meminfo.ko
74 filename: livepatch-meminfo.ko
87 relocation section(s) to the driver once it loads.
91 multiple functions within the same object). There is a 1-1 correspondence
92 between a livepatch relocation section and the target section (usually the
93 text section of a function) to which the relocation(s) apply. It is
98 Since ELF information is preserved for livepatch modules (see Section 5), a
99 livepatch relocation section can be applied simply by passing in the
100 appropriate section index to apply_relocate_add(), which then uses it to
101 access the relocation section and apply the relocations.
103 Every symbol referenced by a rela in a livepatch relocation section is a
105 apply_relocate_add(). See Section 3 for more information.
107 3.1 Livepatch relocation section format
111 section flag. See include/uapi/linux/elf.h for the definition. The module
117 The name of a livepatch relocation section must conform to the following
126 The relocation section name is prefixed with the string ".klp.rela."
130 which the relocation section belongs follows immediately after the prefix.
133 The actual name of the section to which this relocation section applies.
136 ---------
138 **Livepatch relocation section names:**
145 **`readelf --sections` output for a patch
150 Section Headers:
168 SHF_RELA_LIVEPATCH flag ("o" - for OS-specific).
170 **`readelf --relocs` output for a patch module:**
174 …Relocation section '.klp.rela.btrfs.text.btrfs_feature_attr_show' at offset 0x2ba0 contains 4 entr…
176 …0000000001f 0000005e00000002 R_X86_64_PC32 0000000000000000 .klp.sym.vmlinux.printk,0 - 4
178 …003b00000002 R_X86_64_PC32 0000000000000000 .klp.sym.btrfs.can_modify_feature.isra.3,0 - 4
179 …00000004c 0000004900000002 R_X86_64_PC32 0000000000000000 .klp.sym.vmlinux.snprintf,0 - 4
200 any livepatch relocation section, all livepatch symbols referenced by that
201 section must be resolved before livepatch can call apply_relocate_add() for
202 that reloc section.
207 module->symtab.
212 "core" symbols) is made available through module->symtab (See layout_symtab()
216 livepatch relocation section refer to their respective symbols with their symbol
222 …Relocation section '.klp.rela.btrfs.text.btrfs_feature_attr_show' at offset 0x2ba0 contains 4 entr…
224 …0000000001f 0000005e00000002 R_X86_64_PC32 0000000000000000 .klp.sym.vmlinux.printk,0 - 4
237 Livepatch symbols must have their section index marked as SHN_LIVEPATCH, so
265 ---------
275 **`readelf --symbols` output for a patch module:**
291 Note that the 'Ndx' (Section index) for these symbols is SHN_LIVEPATCH (0xff20).
292 "OS" means OS-specific.
294 5. Symbol table and ELF section access
296 A livepatch module's symbol table is accessible through module->symtab.
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
301 module->klp_info, which is a :c:type:`klp_modinfo` struct. When a livepatch module