1
linux/arch/arm/kernel
Uwe Kleine-König d4cc510c61 [ARM] 5418/1: restore lr before leaving mcount
gcc seems to expect that lr isn't clobbered by mcount, because for a
function starting with:

	static int func(void)
	{
		void *ra = __builtin_return_address(0);

		printk(KERN_EMERG "__builtin_return_address(0) = %pS\n", ra)

		...

the following assembler is generated by gcc 4.3.2:

	   0:   e1a0c00d        mov     ip, sp
	   4:   e92dd810        push    {r4, fp, ip, lr, pc}
	   8:   e24cb004        sub     fp, ip, #4      ; 0x4
	   c:   ebfffffe        bl      0 <mcount>
	  10:   e59f0034        ldr     r0, [pc, #52]
	  14:   e1a0100e        mov     r1, lr
	  18:   ebfffffe        bl      0 <printk>

Without this patch obviously __builtin_return_address(0) yields
func+0x10 instead of the return address of the caller.

Note this patch fixes a similar issue for the routines used with dynamic
ftrace even though this isn't currently selectable for ARM.

Cc: Abhishek Sagar <sagar.abhishek@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-03-05 13:47:15 +00:00
..
.gitignore
armksyms.c
arthur.c
asm-offsets.c
atags.c
atags.h
bios32.c PCI: arm: use generic INTx swizzle from PCI core 2009-01-07 11:13:13 -08:00
calls.S [CVE-2009-0029] Rename old_readdir to sys_old_readdir 2009-01-14 14:15:15 +01:00
compat.c
compat.h
crunch-bits.S
crunch.c
debug.S
dma-isa.c
dma.c
ecard.c arm: struct device - replace bus_id with dev_name(), dev_set_name() 2009-01-06 10:44:43 -08:00
ecard.h
elf.c [ARM] 5404/1: Fix condition in arm_elf_read_implies_exec() to set READ_IMPLIES_EXEC 2009-02-19 14:45:27 +00:00
entry-armv.S [ARM] call undefined instruction exception handler with irqs enabled 2009-01-28 10:19:53 +00:00
entry-common.S [ARM] 5418/1: restore lr before leaving mcount 2009-03-05 13:47:15 +00:00
entry-header.S
fiq.c [ARM] Convert asm/uaccess.h to linux/uaccess.h 2008-09-06 11:35:55 +01:00
ftrace.c
head-common.S
head-nommu.S
head.S
init_task.c take init_fs to saner place 2008-12-31 18:07:42 -05:00
io.c
irq.c Use __SPIN_LOCK_UNLOCKED to initialize bad_irq_desc.lock 2009-01-31 01:21:55 +01:00
isa.c [ARM] arch/arm/kernel/isa.c: missing definition of register_isa_ports 2009-01-08 15:53:08 +00:00
iwmmxt.S
kgdb.c
kprobes-decode.c
kprobes.c kprobes: add kprobe_insn_mutex and cleanup arch_remove_kprobe() 2009-01-06 15:59:20 -08:00
machine_kexec.c [ARM] Storage class should be before const qualifier 2009-02-10 09:59:19 +00:00
Makefile
module.c
process.c
ptrace.c
ptrace.h
relocate_kernel.S
setup.c [ARM] 5417/1: Set the correct cacheid for ARMv6 CPUs with ARMv7 style MMU 2009-03-03 12:11:26 +00:00
signal.c
signal.h
smp.c Merge branch 'cpus4096-for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2009-01-02 11:44:09 -08:00
stacktrace.c
stacktrace.h
sys_arm.c
sys_oabi-compat.c
thumbee.c
time.c
traps.c
vmlinux.lds.S
xscale-cp0.c