Commit d127326d authored by Rusty Russell's avatar Rusty Russell Committed by Linus Torvalds

[PATCH] Modules: fix plt sections

Use ".init.plt" section consistently, and mark plt sections executable.
parent e59e439b
...@@ -108,15 +108,15 @@ int module_frob_arch_sections(Elf32_Ehdr *hdr, ...@@ -108,15 +108,15 @@ int module_frob_arch_sections(Elf32_Ehdr *hdr,
{ {
unsigned int i; unsigned int i;
/* Find .plt and .pltinit sections */ /* Find .plt and .init.plt sections */
for (i = 0; i < hdr->e_shnum; i++) { for (i = 0; i < hdr->e_shnum; i++) {
if (strcmp(secstrings + sechdrs[i].sh_name, ".plt.init") == 0) if (strcmp(secstrings + sechdrs[i].sh_name, ".init.plt") == 0)
me->arch.init_plt_section = i; me->arch.init_plt_section = i;
else if (strcmp(secstrings + sechdrs[i].sh_name, ".plt") == 0) else if (strcmp(secstrings + sechdrs[i].sh_name, ".plt") == 0)
me->arch.core_plt_section = i; me->arch.core_plt_section = i;
} }
if (!me->arch.core_plt_section || !me->arch.init_plt_section) { if (!me->arch.core_plt_section || !me->arch.init_plt_section) {
printk("Module doesn't contain .plt or .plt.init sections.\n"); printk("Module doesn't contain .plt or .init.plt sections.\n");
return -ENOEXEC; return -ENOEXEC;
} }
......
...@@ -28,7 +28,7 @@ struct mod_arch_specific ...@@ -28,7 +28,7 @@ struct mod_arch_specific
/* Make empty sections for module_frob_arch_sections to expand. */ /* Make empty sections for module_frob_arch_sections to expand. */
#ifdef MODULE #ifdef MODULE
asm(".section .plt,\"aws\",@nobits; .align 3; .previous"); asm(".section .plt,\"ax\",@nobits; .align 3; .previous");
asm(".section .plt.init,\"aws\",@nobits; .align 3; .previous"); asm(".section .init.plt,\"ax\",@nobits; .align 3; .previous");
#endif #endif
#endif /* _ASM_PPC_MODULE_H */ #endif /* _ASM_PPC_MODULE_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment