[llvm-commits] PATCH: ARM_TARGET1 relocation for C++ global constructors

James Molloy james.molloy at arm.com
Wed Dec 21 07:12:18 PST 2011


Hi,

 

Attached is a patch to cause the relocations for C++ global/static
constructor thunks to be outputted properly on ARM. The ABI states that
these thunks should have an R_ARM_TARGET1 relocation type applied to them
for portability reasons. Currently they're emitted as normal global
variables so get an R_ARM_ABS32.

 

I've implemented this by creating a new overridable hook,
"EmitXXStructor()", in the AsmPrinter. For all targets this defaults to
EmitGlobalConstant as usual, but ARM overrides it to emit a constant with
this specific relocation type.

 

Am I OK to commit?

 

Cheers,

 

James
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20111221/e5e8c230/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: reloc_arm_target1.patch
Type: application/octet-stream
Size: 3557 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20111221/e5e8c230/attachment.obj>


More information about the llvm-commits mailing list