History

[ARM] 5421/1: ftrace: fix crash due to tracing of __naked functions

This is a fix for the following crash observed in 2.6.29-rc3: http://lkml.org/lkml/2009/1/29/150 On ARM it doesn't make sense to trace a naked function because then mcount is called without stack and frame pointer being set up and there is no chance to restore the lr register to the value before mcount was called. Reported-by: Matthias Kaehlcke <matthias@kaehlcke.net> Tested-by: Matthias Kaehlcke <matthias@kaehlcke.net>

Uwe Kleine-König committed 17 years ago

Commit 446c92b1 parent 9311c599 files · +18 −10Browse files

Showing the changes to include (1 of 9 files). Show all

Unified · Split

include/linux/compiler-gcc.h+9−1
@@ -52,7 +52,15 @@ · 51 unmodified lines
52#define __deprecated __attribute__((deprecated))52#define __deprecated __attribute__((deprecated))
53#define __packed __attribute__((packed))53#define __packed __attribute__((packed))
54#define __weak __attribute__((weak))54#define __weak __attribute__((weak))
55#define __naked __attribute__((naked))55
56/*
57 * it doesn't make sense on ARM (currently the only user of __naked) to trace
58 * naked functions because then mcount is called without stack and frame pointer
59 * being set up and there is no chance to restore the lr register to the value
60 * before mcount was called.
61 */
62#define __naked __attribute__((naked)) notrace
63
56#define __noreturn __attribute__((noreturn))64#define __noreturn __attribute__((noreturn))
57 65
58/*66/*