public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: fix BE8 module loading
Date: Mon, 18 May 2015 14:36:06 +0200	[thread overview]
Message-ID: <2205892.6d8Sa1bONm@wuerfel> (raw)

The new veneer support for loadable modules on ARM uses the
__opcode_to_mem_thumb32() function to count R_ARM_THM_CALL
and R_ARM_THM_JUMP24 relocations.

However, this function is not defined for big-endian kernels
on ARMv5 or before, causing a compile-time error:

arch/arm/kernel/module-plts.c: In function 'count_plts':
arch/arm/kernel/module-plts.c:124:9: error: implicit declaration of function '__opcode_to_mem_thumb32' [-Werror=implicit-function-declaration]
         __opcode_to_mem_thumb32(0x07ff2fff)))
         ^

As we know that this part of the function is only needed for
Thumb2 kernels, and that those can never happen with BE8,
we can avoid the error by enclosing the code in an #ifdef.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 7d485f647c1 ("ARM: 8220/1: allow modules outside of bl range")
---
Found with the randconfig builder on linux-next.

diff --git a/arch/arm/kernel/module-plts.c b/arch/arm/kernel/module-plts.c
index 71a65c49871d..097e2e201b9f 100644
--- a/arch/arm/kernel/module-plts.c
+++ b/arch/arm/kernel/module-plts.c
@@ -118,11 +118,13 @@ static unsigned int count_plts(Elf32_Addr base, const Elf32_Rel *rel, int num)
 					   __opcode_to_mem_arm(0x00ffffff)))
 				ret++;
 			break;
+#ifdef CONFIG_THUMB2_KERNEL
 		case R_ARM_THM_CALL:
 		case R_ARM_THM_JUMP24:
 			if (!duplicate_rel(base, rel, i,
 					   __opcode_to_mem_thumb32(0x07ff2fff)))
 				ret++;
+#endif
 		}
 	return ret;
 }

             reply	other threads:[~2015-05-18 12:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-18 12:36 Arnd Bergmann [this message]
2015-05-18 13:01 ` [PATCH] ARM: fix BE8 module loading Ard Biesheuvel
2015-05-18 14:22 ` Robin Murphy
2015-05-18 14:24   ` Arnd Bergmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2205892.6d8Sa1bONm@wuerfel \
    --to=arnd@arndb.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox