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>] [day] [month] [year] [list]
Date:	Fri, 18 Apr 2008 03:48:56 -0400
From:	Kyle McMartin <kyle@...artin.ca>
To:	linux-arch@...r.kernel.org
Cc:	linux-kernel@...r.kernel.org, rusty@...tcorp.com.au,
	akpm@...ux-foundation.org
Subject: [PATCH 1/2] kallsyms: restructure print_fn_descriptor_symbol

Factor out the function descriptor access from the print_symbol
call.

Signed-off-by: Kyle McMartin <kyle@...artin.ca>
---
 include/linux/kallsyms.h |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h
index 82de2fb..6734a3f 100644
--- a/include/linux/kallsyms.h
+++ b/include/linux/kallsyms.h
@@ -83,17 +83,21 @@ __attribute__((format(printf,1,2)));
 static inline void __check_printsym_format(const char *fmt, ...)
 {
 }
+
 /* ia64 and ppc64 use function descriptors, which contain the real address */
 #if defined(CONFIG_IA64) || defined(CONFIG_PPC64)
-#define print_fn_descriptor_symbol(fmt, addr)		\
-do {						\
-	unsigned long *__faddr = (unsigned long*) addr;		\
-	print_symbol(fmt, __faddr[0]);		\
-} while (0)
+#define get_func_addr(x)	({				\
+					unsigned long *addr =	\
+						(unsigned long *)x;	\
+					addr[0];		\
+				})
 #else
-#define print_fn_descriptor_symbol(fmt, addr) print_symbol(fmt, addr)
+#define get_func_addr(x)	x
 #endif
 
+#define print_fn_descriptor_symbol(fmt, addr)	\
+		print_symbol(fmt, get_func_addr(addr))
+
 static inline void print_symbol(const char *fmt, unsigned long addr)
 {
 	__check_printsym_format(fmt, "");
-- 
1.5.4.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ