aboutsummaryrefslogtreecommitdiff
path: root/arch/ia64/kernel/module.c
diff options
context:
space:
mode:
authorLinus Torvalds <[email protected]>2005-06-08 16:06:15 -0700
committerLinus Torvalds <[email protected]>2005-06-08 16:06:15 -0700
commita38133298fc678335a0229e97b6161a7ac6fec84 (patch)
tree2500f23fd230e67a8eba96b380245ecb43c3fd4c /arch/ia64/kernel/module.c
parent97d26b8042a6f14cc4a19e84e911a953363e3d69 (diff)
parent70aa488cff83c965c9e1850f48d82b000d0d6c1c (diff)
Merge rsync://rsync.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6
Diffstat (limited to 'arch/ia64/kernel/module.c')
-rw-r--r--arch/ia64/kernel/module.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/arch/ia64/kernel/module.c b/arch/ia64/kernel/module.c
index febc091c2f02..f1aca7cffd12 100644
--- a/arch/ia64/kernel/module.c
+++ b/arch/ia64/kernel/module.c
@@ -825,14 +825,16 @@ apply_relocate_add (Elf64_Shdr *sechdrs, const char *strtab, unsigned int symind
* XXX Should have an arch-hook for running this after final section
* addresses have been selected...
*/
- /* See if gp can cover the entire core module: */
- uint64_t gp = (uint64_t) mod->module_core + MAX_LTOFF / 2;
- if (mod->core_size >= MAX_LTOFF)
+ uint64_t gp;
+ if (mod->core_size > MAX_LTOFF)
/*
* This takes advantage of fact that SHF_ARCH_SMALL gets allocated
* at the end of the module.
*/
- gp = (uint64_t) mod->module_core + mod->core_size - MAX_LTOFF / 2;
+ gp = mod->core_size - MAX_LTOFF / 2;
+ else
+ gp = mod->core_size / 2;
+ gp = (uint64_t) mod->module_core + ((gp + 7) & -8);
mod->arch.gp = gp;
DEBUGP("%s: placing gp at 0x%lx\n", __FUNCTION__, gp);
}