From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeroen Hofstee Date: Tue, 13 Aug 2013 21:36:56 +0200 Subject: [U-Boot] [PATCH 0/3] ARM: use r9 for gd instead of r8 In-Reply-To: <1569164175.875060.1376258939828.JavaMail.zimbra@advansee.com> References: <1376254719-15594-1-git-send-email-jeroen@myspectrum.nl> <1569164175.875060.1376258939828.JavaMail.zimbra@advansee.com> Message-ID: <520A8AD8.50402@myspectrum.nl> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello Beno?t, On 08/12/2013 12:08 AM, Beno?t Th?baudeau wrote: > On Sunday, August 11, 2013 10:58:36 PM, Jeroen Hofstee wrote: >> To be EABI compliant (r9 is a platform specific register) and as >> a prepration for building u-boot with clang/llvm (with does / will >> support r9 as reserved register), store the pointer to gd in r9. > If r9 is reserved, I understand that its current usage may conflict with clang's > but why would gd have to be stored in r9 for clang? Moreover, if r9 is reserved > for clang (reserved for what?), why can it be used for gd? I know Albert already responded to this, but for completeness: The reserved is from a compiler point of view, which is perhaps a bit llvm nomenclature, Reserved means the compiler should _not_ use it as a general purpose register; it is reserved for the platform, U-boot in this case. > I'm also wondering if r9 as initialized by relocate.S is not sometimes used by > GCC to handle position-independent code within generated code, i.e. like the > static base feature described for r9 as a possible usage in the ARM EABI AAPCS > document (5.1.1). If this is the case, changing r9 to gd would break GCC code at > runtime. This is not needed / supported on U-boot arm. U-boot will actually error at compile time if there are any symbols which are not pc relative. Regards, Jeroen