[llvm-commits] [PATCH, RFC] Medium code model support for 64-bit PowerPC
Bill Schmidt
wschmidt at linux.vnet.ibm.com
Mon Nov 26 12:22:43 PST 2012
Thanks, Uli, that makes good sense. Much simpler your way.
Attached is a revised version of the patch along the lines you suggest.
Thanks,
Bill
On Mon, 2012-11-26 at 16:09 +0100, Ulrich Weigand wrote:
> Bill Schmidt <wschmidt at linux.vnet.ibm.com> wrote:
>
> > Here's a new revision of the patch. The changes are:
> >
> > (1) Add support for direct object file writing:
> > - New relocation types in ELF.h.
> > - New fixup kinds in PPCFixupKinds.h
> > - Handle new fixups in PPCMCCodeEmitter.cpp, PPCAsmBackend.cpp, and
> > PPCELFObjectWriter.cpp.
>
> I think this may be a bit overkill; I don't think you need new fixups
> (I see you followed the existing precedent of fixup_ppc_toc16 and
> fixup_ppc_toc16_ds, but I think those are already unnecessary).
>
> The *fixup* type describes *how* a value is to be inserted into an
> instruction; this is the same for the TOC variants. The difference
> is only which *value* is to be inserted, and that is (supposed to
> be) already encoded in the symbol kind.
>
> PPCELFObjectWriter::getRelocTypeInner is then supposed to consult
> the pair of fixup type and symbol kind to choose the appropriate
> relocation type. So instead of adding something like:
>
> + case PPC::fixup_ppc_toc16_lo:
> + Type = ELF::R_PPC64_TOC16_LO;
> + break;
>
> I think you should rather add a check of symbol kind under the
> existing PPC::fixup_ppc_lo16 case. (Similar to what I did for
> TPREL16_LO.)
>
> Bye,
> Ulrich
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mcm-2012-11-26b.patch
Type: text/x-patch
Size: 32054 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20121126/32c96e89/attachment.bin>
More information about the llvm-commits
mailing list