aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64/kernel
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-01-14 19:38:02 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2016-01-14 19:38:02 -0500
commit0f0836b7eb1b9d14862ee40c7856227a3ead70db (patch)
treec85b530eec7098a1230709ab43a05447e0cd3c89 /arch/ia64/kernel
parentc2848f2eef4dd08b0fd2a8eba1694fd8e77ddb67 (diff)
parentb56b36ee6751abe7fb3890681e86fc8de2122953 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/livepatching
Pull livepatching updates from Jiri Kosina: - RO/NX attribute fixes for patch module relocations from Josh Poimboeuf. As part of this effort, module.c has been cleaned up as well and livepatching is piggy-backing on this cleanup. Rusty is OK with this whole lot going through livepatching tree. - symbol disambiguation support from Chris J Arges. That series is also Reviewed-by: Miroslav Benes <mbenes@suse.cz> but this came in only after I've alredy pushed out. Didn't want to rebase because of that, hence I am mentioning it here. - symbol lookup fix from Miroslav Benes * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/livepatching: livepatch: Cleanup module page permission changes module: keep percpu symbols in module's symtab module: clean up RO/NX handling. module: use a structure to encapsulate layout. gcov: use within_module() helper. module: Use the same logic for setting and unsetting RO/NX livepatch: function,sympos scheme in livepatch sysfs directory livepatch: add sympos as disambiguator field to klp_reloc livepatch: add old_sympos as disambiguator field to klp_func
Diffstat (limited to 'arch/ia64/kernel')
-rw-r--r--arch/ia64/kernel/module.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/arch/ia64/kernel/module.c b/arch/ia64/kernel/module.c
index b15933c31b2f..6ab0ae7d6535 100644
--- a/arch/ia64/kernel/module.c
+++ b/arch/ia64/kernel/module.c
@@ -486,13 +486,13 @@ module_frob_arch_sections (Elf_Ehdr *ehdr, Elf_Shdr *sechdrs, char *secstrings,
486static inline int 486static inline int
487in_init (const struct module *mod, uint64_t addr) 487in_init (const struct module *mod, uint64_t addr)
488{ 488{
489 return addr - (uint64_t) mod->module_init < mod->init_size; 489 return addr - (uint64_t) mod->init_layout.base < mod->init_layout.size;
490} 490}
491 491
492static inline int 492static inline int
493in_core (const struct module *mod, uint64_t addr) 493in_core (const struct module *mod, uint64_t addr)
494{ 494{
495 return addr - (uint64_t) mod->module_core < mod->core_size; 495 return addr - (uint64_t) mod->core_layout.base < mod->core_layout.size;
496} 496}
497 497
498static inline int 498static inline int
@@ -675,7 +675,7 @@ do_reloc (struct module *mod, uint8_t r_type, Elf64_Sym *sym, uint64_t addend,
675 break; 675 break;
676 676
677 case RV_BDREL: 677 case RV_BDREL:
678 val -= (uint64_t) (in_init(mod, val) ? mod->module_init : mod->module_core); 678 val -= (uint64_t) (in_init(mod, val) ? mod->init_layout.base : mod->core_layout.base);
679 break; 679 break;
680 680
681 case RV_LTV: 681 case RV_LTV:
@@ -810,15 +810,15 @@ apply_relocate_add (Elf64_Shdr *sechdrs, const char *strtab, unsigned int symind
810 * addresses have been selected... 810 * addresses have been selected...
811 */ 811 */
812 uint64_t gp; 812 uint64_t gp;
813 if (mod->core_size > MAX_LTOFF) 813 if (mod->core_layout.size > MAX_LTOFF)
814 /* 814 /*
815 * This takes advantage of fact that SHF_ARCH_SMALL gets allocated 815 * This takes advantage of fact that SHF_ARCH_SMALL gets allocated
816 * at the end of the module. 816 * at the end of the module.
817 */ 817 */
818 gp = mod->core_size - MAX_LTOFF / 2; 818 gp = mod->core_layout.size - MAX_LTOFF / 2;
819 else 819 else
820 gp = mod->core_size / 2; 820 gp = mod->core_layout.size / 2;
821 gp = (uint64_t) mod->module_core + ((gp + 7) & -8); 821 gp = (uint64_t) mod->core_layout.base + ((gp + 7) & -8);
822 mod->arch.gp = gp; 822 mod->arch.gp = gp;
823 DEBUGP("%s: placing gp at 0x%lx\n", __func__, gp); 823 DEBUGP("%s: placing gp at 0x%lx\n", __func__, gp);
824 } 824 }