lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20161216105634.235457-11-arnd@arndb.de>
Date:   Fri, 16 Dec 2016 11:56:31 +0100
From:   Arnd Bergmann <arnd@...db.de>
To:     linux-arch@...r.kernel.org
Cc:     linux-kbuild@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-arm-kernel@...r.kernel.org,
        Russell King <rmk+kernel@...linux.org.uk>,
        Andrew Morton <akpm@...ux-foundation.org>,
        kernel-build-reports@...ts.linaro.org,
        kvmarm@...ts.cs.columbia.edu, Arnd Bergmann <arnd@...db.de>
Subject: [PATCH 10/13] asm-generic: mark cmpxchg as __always_inline for gcc-4.3

With CONFIG_OPTIMIZE_INLINING and older compilers, we can get
a link error such as

kernel/task_work.o: In function `__cmpxchg_local_generic':
task_work.c:(.text+0x14c): undefined reference to `wrong_size_cmpxchg'
kernel/locking/rtmutex.o: In function `__cmpxchg_local_generic':
rtmutex.c:(.text+0x5ec): undefined reference to `wrong_size_cmpxchg'
kernel/trace/ring_buffer.o: In function `__cmpxchg_local_generic':

Marking the functions in question as __always_inline avoids that
possibility.

Signed-off-by: Arnd Bergmann <arnd@...db.de>
---
 include/asm-generic/cmpxchg-local.h | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/include/asm-generic/cmpxchg-local.h b/include/asm-generic/cmpxchg-local.h
index 70bef78912b7..e82d7032b1b8 100644
--- a/include/asm-generic/cmpxchg-local.h
+++ b/include/asm-generic/cmpxchg-local.h
@@ -11,7 +11,8 @@ extern unsigned long wrong_size_cmpxchg(volatile void *ptr)
  * Generic version of __cmpxchg_local (disables interrupts). Takes an unsigned
  * long parameter, supporting various types of architectures.
  */
-static inline unsigned long __cmpxchg_local_generic(volatile void *ptr,
+static __always_inline unsigned long
+__cmpxchg_local_generic(volatile void *ptr,
 		unsigned long old, unsigned long new, int size)
 {
 	unsigned long flags, prev;
@@ -50,8 +51,8 @@ static inline unsigned long __cmpxchg_local_generic(volatile void *ptr,
 /*
  * Generic version of __cmpxchg64_local. Takes an u64 parameter.
  */
-static inline u64 __cmpxchg64_local_generic(volatile void *ptr,
-		u64 old, u64 new)
+static __always_inline u64
+__cmpxchg64_local_generic(volatile void *ptr, u64 old, u64 new)
 {
 	u64 prev;
 	unsigned long flags;
-- 
2.9.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ