@@ -19,6 +19,7 @@
#include <asm/alternative.h>
#include <asm/insn.h>
#include <asm/sections.h>
+#include <asm-generic/orc_lookup.h>
void *module_alloc(unsigned long size)
{
@@ -524,10 +525,20 @@ int module_finalize(const Elf_Ehdr *hdr,
const Elf_Shdr *sechdrs,
struct module *me)
{
- const Elf_Shdr *s;
+ const Elf_Shdr *s, *orc, *orc_ip;
+
s = find_section(hdr, sechdrs, ".altinstructions");
if (s)
apply_alternatives_module((void *)s->sh_addr, s->sh_size);
+ orc = find_section(hdr, sechdrs, ".orc_unwind");
+ orc_ip = find_section(hdr, sechdrs, ".orc_unwind_ip");
+
+ if (orc && orc_ip) {
+ orc_lookup_module_init(me,
+ (void *)orc_ip->sh_addr, orc_ip->sh_size,
+ (void *)orc->sh_addr, orc->sh_size);
+ }
+
return module_init_ftrace_plt(hdr, sechdrs, me);
}
@@ -51,6 +51,7 @@
#include <asm/efi.h>
#include <asm/xen/hypervisor.h>
#include <asm/mmu_context.h>
+#include <asm-generic/orc_lookup.h>
static int num_standard_resources;
static struct resource *standard_resources;
@@ -389,6 +390,7 @@ void __init __no_sanitize_address setup_arch(char **cmdline_p)
"This indicates a broken bootloader or old kernel\n",
boot_args[1], boot_args[2], boot_args[3]);
}
+ orc_lookup_init();
}
static inline bool cpu_can_disable(unsigned int cpu)