On Mon, 12 Dec 2005 14:25:16 -0800 (PST)
Glen Kriekenbeck <Glen.Kriekenbeck at Sun.COM> wrote:

> Hi Peter and everyone,
> 
> Thanks for the details on these relocations.  My correspondent has several 
> related questions.
> 
> [i]> 1. Nothing has been said about the relocation type R_SPARC_H34.[/i]
> This question got buried under the ...GOTDATA... question; earlier, he asked 
> about "...codes 80 to 85 (we can probably figure out the first four but not 
> the last two)."  Do you have any info on code 85?

R_SPARC_H34 (together with R_SPARC_L34) is used for 34-bit absolute 
addressing model for 64-bit apps. Formulas in the manual are correct:

  Name        Value   Field     Calculation
  ---------------------------------------------
  R_SPARC_H34   85    V-imm22   (S+A) >> 12
  R_SPARC_L34   52    T-imm13   (S+A) & 0xfff

R_SPARC_L34 is an alias for R_SPARC_L44 and thus does not require
new definition.

Example of abs34 code:

    sethi   %h34(addr), %r1             ! Load bits 12-33
    sllx    %r1, 2, %r2
    ld      [%r2 + %l34(addr)], %r3     ! Add bits 0-11

Currently this code model is only generated by compiler internal option.

Regards,
Maksim

> 
> [i]> 2. In the corrected expressions for the relocated values right shift by 
> 31 bits
> should be construed as arithmetical, not logical shift, but this is not
> stated clearly.[/i]
> Is this a correct assumption?  If so, it probably should be stated directly.
> 
> Finally, two followup questions from Peter's earlier note:
> [i]> 3. In Peter's example of modification of code by linker, the modified 
> version should
> probably have relocations without "OP" (I wonder though, in what case
> linker needs to output unresolved relocations).[/i]
> 
> [i]> 4. In Peter's explanations for the case of negative offset it is assumed 
> that the low
> 12 bits will be zeros after sethi, which should mean that the low 2 bits of
> the relocated operand of sethi should be zeroed by the relocation; if this is
> not done, what would happen to the bits 12 and 11 in the resulting value?[/i]
> 
> Thanks!
> glen
> This message posted from opensolaris.org
> _______________________________________________
> tools-linking mailing list
> tools-linking at opensolaris.org

Reply via email to