I'll try to answer the questions below.

Peter.


> Date: Mon, 12 Dec 2005 14:25:16 -0800 (PST)
> From: Glen Kriekenbeck <glen.kriekenbeck at sun.com>
> Subject: [tools-linking] Re:  new relocation types with Studio 11, and 
> further 
clarification?
> To: tools-linking at opensolaris.org
> 
> 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?

I believe the H34 relocation is used for code like this:

        sethi   %hi34(sym), %l0         ! R_SPARC_H34
        sllx    %l0, 2, %l0
        or      %l0, %lo12(sym), %l0    ! R_SPARC_13 ??? or R_SPARC_LO10 ??

It seems like there is a missing relocation for the low 12-bits.
Anyway, the intention, I think, is to form a 34-bit address
into a 64-bit register by using the partial overlap
of the sethi and the imm-operand of the "or" (or add) instructions.

        
> [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.

Yes, those are arithmetic right-shifts for the sign bit.

And again, I think it should be 32, not just 31,
but 31 will work.


> 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]

Sorry, there would be no relocations left after static link.


> [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]

Sorry, my mistake,
the sethi sets the low 10 bits to zero, not the low 12 bits.

Peter.

> Thanks!
> glen
> This message posted from opensolaris.org
> _______________________________________________
> tools-linking mailing list
> tools-linking at opensolaris.org


Reply via email to