This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Inconsistent GOT base pointer register usage in x86-64 psABI

Register Usage table in x86-64 psABI has

%rbx  callee-saved register; optionally used as base pointer

However, everywhere it uses %r15 to store the GOT address,
including PLT for large model.

It is a typo to mark RBX as GOT base register in Register Usage table.
GCC large model Linux implementation isn't tested nor verified.  The
only real usage is


which is correct.

We should fix Register Usage table in x86-64 psABI with the enclosed patch.

 Any comments?

diff --git a/low-level-sys-info.tex b/low-level-sys-info.tex
index ef901d2..95a3f6f 100644
--- a/low-level-sys-info.tex
+++ b/low-level-sys-info.tex
@@ -572,7 +572,7 @@ bit.}.
 \RAX & temporary register; with variable arguments passes
 information about the number of vector registers used; 1$^{\rm st}$
 return register & No \\
-\RBX & callee-saved register; optionally used as base pointer & Yes \\
+\RBX & callee-saved register & Yes \\
 \RCX & used to pass 4$^{\rm th}$ integer argument to functions & No \\
 \RDX & used to pass 3$^{\rm rd}$ argument to functions; 2$^{\rm nd}$
return register & No \\
 \RSP & stack pointer & Yes \\
@@ -584,7 +584,8 @@ return register & No \\
 \reg{r10} & temporary register, used for passing a function's static
 chain pointer & No \\
 \reg{r11} & temporary register & No\\
-\reg{r12--r15} & callee-saved registers & Yes \\
+\reg{r12--r14} & callee-saved registers & Yes \\
+\reg{r15} & callee-saved register; optionally used as GOT base pointer & Yes \\
 \reg{xmm0}--\reg{xmm1} & used to pass and return floating point
 arguments & No\\
 \reg{xmm2}--\reg{xmm7} & used to pass floating point arguments & No\\

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]