public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@novell.com>
To: "H.J. Lu" <hjl.tools@gmail.com>
Cc: "GCC Development" <gcc@gcc.gnu.org>,<x32-abi@googlegroups.com>,
	 "Binutils" <binutils@sourceware.org>
Subject: Re: [x32] Allow R_X86_64_64
Date: Fri, 12 Aug 2011 07:30:00 -0000	[thread overview]
Message-ID: <4E44F2CF0200007800050EDE@nat28.tlf.novell.com> (raw)
In-Reply-To: <CAMe9rOoC0ys6reTjRm6-qtdtxH9RO8BhfNVkb0FJEd+d=KBTig@mail.gmail.com>

>>> On 12.08.11 at 06:37, "H.J. Lu" <hjl.tools@gmail.com> wrote:
> On Mon, Aug 1, 2011 at 3:15 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>> Hi,
>>
>> It turns out that x32 needs R_X86_64_64.  One major reason is
>> the displacement range of x32 is -2G to +2G.  It isn't a problem
>> for compiler since only small model is required for x32.
>>
>> However, to address 0 to 4G directly in assembly code, we have
>> to use R_X86_64_64 with movabs.  I am checking the follow patch
>> into x32 psABI to allow R_X86_64_64.
>>
>>
> 
> X32  Linker should treats R_X86_64_64 as R_X86_64_32
> zero-extended to 64bit for output.  I will update x32 psABI with

I'm sorry to say that, but the situation about x32 seems to be
getting worse with each change you do, every time again
revolving around mixing up ABI specification and a particular
implementation thereof.

Here, if you need something zero-extended (though I can't see
why you would), then you should use a new relocation type. As
pointed out before, there are valid possible uses of R_X86_64_64
that would require the semantics of x86-64.

Jan

> ---
> diff --git a/object-files.tex b/object-files.tex
> index 7f0fd14..d1543b5 100644
> --- a/object-files.tex
> +++ b/object-files.tex
> @@ -451,7 +451,7 @@ or \texttt{Elf32_Rel} relocation.
>        \multicolumn{1}{c}{Calculation} \\
>        \hline
>        \texttt{R_X86_64_NONE}  & 0 & none & none \\
> -      \texttt{R_X86_64_64} & 1 & \textit{word64} & \texttt{S + A} \\
> +      \texttt{R_X86_64_64} $^{\dagger\dagger}$ & 1 & \textit{word64}
> & \texttt{S + A} \\
>        \texttt{R_X86_64_PC32}  & 2 & \textit{word32} & \texttt{S + A - P} \\
>        \texttt{R_X86_64_GOT32} & 3 & \textit{word32} & \texttt{G + A} \\
>        \texttt{R_X86_64_PLT32} & 4 & \textit{word32} & \texttt{L + A - P} \\
> @@ -487,6 +487,8 @@ or \texttt{Elf32_Rel} relocation.
>  %      \texttt{R_X86_64_PLT64} & 17 & \textit{word64} & \texttt{L + A - P} \\
>       \cline{1-4}
>      \multicolumn{3}{l}{\small $^\dagger$ This relocation is used only
> for LP64.}\\
> +    \multicolumn{3}{l}{\small $^{\dagger\dagger}$ This relocation only
> +    appears in relocatable files for X32.}\\
>      \end{tabular}
>    \end{center}
>  \Hrule
> ----
> 
> I opened:
> 
> http://sourceware.org/bugzilla/show_bug.cgi?id=13082 
> 
> and will fix it.
> 




  reply	other threads:[~2011-08-12  7:30 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-01 22:16 H.J. Lu
2011-08-12  4:37 ` H.J. Lu
2011-08-12  7:30   ` Jan Beulich [this message]
2011-08-12 12:10     ` H.J. Lu
2011-08-12 13:16       ` Jan Beulich
2011-08-12 13:22         ` H.J. Lu
2011-08-12 13:58           ` Jan Beulich
2011-08-12 14:03             ` H.J. Lu
     [not found]               ` <4E4557DB0200007800051054@nat28.tlf.novell.com>
     [not found]                 ` <CAMe9rOrTw_R2U+9HeNY6iGhd6RD6ADG1Z9tjP8GyXGevnqSsQg@mail.gmail.com>
     [not found]                   ` <4E4560370200007800051095@nat28.tlf.novell.com>
2011-08-12 15:52                     ` H.J. Lu
2011-08-12 17:53                       ` H.J. Lu
2011-08-12 19:59                         ` H.J. Lu
2011-08-15  6:29                         ` Jan Beulich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E44F2CF0200007800050EDE@nat28.tlf.novell.com \
    --to=jbeulich@novell.com \
    --cc=binutils@sourceware.org \
    --cc=gcc@gcc.gnu.org \
    --cc=hjl.tools@gmail.com \
    --cc=x32-abi@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).