[LLVMdev] [PATCH] ARM MC relocations

Renato Golin renato.golin at arm.com
Wed Jun 2 05:18:01 PDT 2010



Is there any interest in this patch? Is there any better way of doing this
(that will be accepted mainstream)?


I noticed my cast check was wrong (LLVM cast asserts, rather than return a
null pointer). Also, including ARMMCRelocation.h, that defines the
relocation types (missing from last patch, sorry).






From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On
Behalf Of Renato Golin
Sent: 28 May 2010 16:06
To: llvmdev at cs.uiuc.edu
Subject: [LLVMdev] Patch proposal: ARM MC relocations


Hi all,


I did some changes to the AsmPrinter in order to print relocation
information in GAS format compatible with ARM ELF. It doesn't look like the
best solution, but there were some problems and the fact that this is my
first attempt to change LLVM.


My original assumption was that, changing MCExpr to accept relocation
information, we could propagate that down later to whatever gets written
from it. To change that, one needs to overwrite the LowerConstant function
in AsmPrinter, but that's a static function that rely on other static
functions in the same file. Also, ARMMCInstLower (my first guess) seems to
have not being used to generate anything.


I know that MC is radically changing the area as we speak, so I also didn't
want to spend too much time on something that will disappear in a few
months. I'm happy to conform to the new specifications if there is one and
it works for ARM.


In the end, the change I had to do was simpler, less generic and a bit
hacky, so I'm sending this patch to the list (instead of the patch list
directly) to request for comments. The patch applies to the trunk (a few
minutes ago).




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100602/7046bfce/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: arm-relocations.patch
Type: application/octet-stream
Size: 3321 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100602/7046bfce/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ARMMCRelocation.h
Type: application/octet-stream
Size: 1983 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100602/7046bfce/attachment-0001.obj>

More information about the llvm-dev mailing list