From 9cee88c61bb334e0aeb3f1d26525ecae519ba71b Mon Sep 17 00:00:00 2001 From: Dave Martin Date: Thu, 16 Jun 2011 12:09:37 +0100 Subject: [PATCH] --- yaml --- r: 254059 b: refs/heads/master c: 9a00318eadbb43db4e9c163c262a22a3c8b5a672 h: refs/heads/master i: 254057: 3ffe41580dbcac201d39c106f93240a617e44a16 254055: 5e0706aef23e41bb2b458058533ce72026f9cc69 v: v3 --- [refs] | 2 +- trunk/arch/arm/kernel/module.c | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index dfb5dd7fa1c8..39cc2f3337a2 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 343fda59823ca20f48578f816ec12e741214f509 +refs/heads/master: 9a00318eadbb43db4e9c163c262a22a3c8b5a672 diff --git a/trunk/arch/arm/kernel/module.c b/trunk/arch/arm/kernel/module.c index fee7c36349eb..016d6a0830a3 100644 --- a/trunk/arch/arm/kernel/module.c +++ b/trunk/arch/arm/kernel/module.c @@ -193,8 +193,17 @@ apply_relocate(Elf32_Shdr *sechdrs, const char *strtab, unsigned int symindex, offset -= 0x02000000; offset += sym->st_value - loc; - /* only Thumb addresses allowed (no interworking) */ - if (!(offset & 1) || + /* + * For function symbols, only Thumb addresses are + * allowed (no interworking). + * + * For non-function symbols, the destination + * has no specific ARM/Thumb disposition, so + * the branch is resolved under the assumption + * that interworking is not required. + */ + if ((ELF32_ST_TYPE(sym->st_info) == STT_FUNC && + !(offset & 1)) || offset <= (s32)0xff000000 || offset >= (s32)0x01000000) { pr_err("%s: section %u reloc %u sym '%s': relocation %u out of range (%#lx -> %#x)\n",