From 4b9cb9b5b4419207aca40040bd57a60d6e3734e1 Mon Sep 17 00:00:00 2001 From: Linus Nielsen Feltzing Date: Sat, 24 Jul 2004 17:53:56 +0000 Subject: [PATCH] Don't copy the data section if src and dest are the same git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4935 a1c6a512-1295-4272-9138-f99709370657 --- firmware/crt0.S | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/firmware/crt0.S b/firmware/crt0.S index 088ea0aff4..e33faa66e5 100644 --- a/firmware/crt0.S +++ b/firmware/crt0.S @@ -116,6 +116,9 @@ copy_l: mov.l datacopy_k,r0 mov.l data_k,r1 mov.l dataend_k,r2 + /* Don't copy if src and dest are equal */ + cmp/eq r0,r1 + bt nodatacopy copy_l2: mov.l @r0,r3 mov.l r3,@r1 @@ -124,7 +127,7 @@ copy_l2: cmp/ge r2,r1 bf copy_l2 nop - +nodatacopy: /* Munge the main thread stack */ mov.l stack_k,r2 mov.l deadbeef_k,r0