From mboxrd@z Thu Jan 1 00:00:00 1970 From: Albert ARIBAUD Date: Tue, 20 Jan 2015 10:37:38 +0100 Subject: [U-Boot] printf and R9 in ARM architecture In-Reply-To: References: Message-ID: <20150120103738.20a03f89@lilith> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello Dashi Cao, On Tue, 20 Jan 2015 14:12:35 +0800, Da Shi Cao wrote: > In standalone applications, it seems that the execution of printf > function in U-Boot is dependent on the value of register R9, which is > setup in app_startup. But r9 can be used by your program at the > decision of gcc compilation which is not aware of this dependence. > This is especially the case if +O2 is used! U-Boot follows the ARM EABI, in which ""The role of register r9 is platform specific". In U-Boot r9 is specifically used for the global data structure, and the standalone programs must follow this EABI. If your standalone program is built with the same options as U-Boot example standalone programs are (see hellow_world), then it should have gcc option -ffixed-r9 which will prevent the compiler from ever touching r9. How exactly do you build your standalone application? > My version is U-Boot 2014.10 > > Regards, > Dashi Cao Amicalement, -- Albert.