@@ -1198,6 +1198,43 @@ void kpatch_update_ex_table_addend(struct kpatch_elf *kelf,
}
}
+#define inc_printf(fmt, ...) \
+ log_debug("%*s" fmt, recurselevel, "", ##__VA_ARGS__);
+
+static void kpatch_include_symbol(struct symbol *sym, int recurselevel)
+{
+ struct rela *rela;
+ struct section *sec;
+
+ inc_printf("start include_symbol(%s)\n", sym->name);
+ sym->include = 1;
+ inc_printf("symbol %s is included\n", sym->name);
+ /*
+ * Check if sym is a non-local symbol (sym->sec is NULL) or
+ * if an unchanged local symbol. This a base case for the
+ * inclusion recursion.
+ */
+ if (!sym->sec || sym->sec->include ||
+ (sym->type != STT_SECTION && sym->status == SAME))
+ goto out;
+ sec = sym->sec;
+ sec->include = 1;
+ inc_printf("section %s is included\n", sec->name);
+ if (sec->secsym && sec->secsym != sym) {
+ sec->secsym->include = 1;
+ inc_printf("section symbol %s is included\n", sec->secsym->name);
+ }
+ if (!sec->rela)
+ goto out;
+ sec->rela->include = 1;
+ inc_printf("section %s is included\n", sec->rela->name);
+ list_for_each_entry(rela, &sec->rela->relas, list)
+ kpatch_include_symbol(rela->sym, recurselevel+1);
+out:
+ inc_printf("end include_symbol(%s)\n", sym->name);
+ return;
+}
+
static void kpatch_regenerate_special_section(struct kpatch_elf *kelf,
struct special_section *special,
struct section *sec)
@@ -1455,43 +1492,6 @@ static void kpatch_include_standard_string_elements(struct kpatch_elf *kelf)
}
}
-#define inc_printf(fmt, ...) \
- log_debug("%*s" fmt, recurselevel, "", ##__VA_ARGS__);
-
-static void kpatch_include_symbol(struct symbol *sym, int recurselevel)
-{
- struct rela *rela;
- struct section *sec;
-
- inc_printf("start include_symbol(%s)\n", sym->name);
- sym->include = 1;
- inc_printf("symbol %s is included\n", sym->name);
- /*
- * Check if sym is a non-local symbol (sym->sec is NULL) or
- * if an unchanged local symbol. This a base case for the
- * inclusion recursion.
- */
- if (!sym->sec || sym->sec->include ||
- (sym->type != STT_SECTION && sym->status == SAME))
- goto out;
- sec = sym->sec;
- sec->include = 1;
- inc_printf("section %s is included\n", sec->name);
- if (sec->secsym && sec->secsym != sym) {
- sec->secsym->include = 1;
- inc_printf("section symbol %s is included\n", sec->secsym->name);
- }
- if (!sec->rela)
- goto out;
- sec->rela->include = 1;
- inc_printf("section %s is included\n", sec->rela->name);
- list_for_each_entry(rela, &sec->rela->relas, list)
- kpatch_include_symbol(rela->sym, recurselevel+1);
-out:
- inc_printf("end include_symbol(%s)\n", sym->name);
- return;
-}
-
static int kpatch_include_changed_functions(struct kpatch_elf *kelf)
{
struct symbol *sym;
So it can be used by kpatch_process_special_sections() in further changes. Non functional change. Signed-off-by: Roger Pau Monné <roger.pau@citrix.com> --- create-diff-object.c | 74 ++++++++++++++++++++++---------------------- 1 file changed, 37 insertions(+), 37 deletions(-)