[llvm-commits] [patch] Add TLS hook to MCTargetExpr (AArch64 generic change)

Tim Northover Tim.Northover at arm.com
Wed Jan 9 06:13:46 PST 2013


Hi all,

ELF ABIs require that TLS symbols should have type STT_TLS. This is 
implemented via the function MCELFStreamer::fixSymbolsInTLSFixups. However, 
this function cannot delve into an MCTargetExpr at the moment.

In practice this means that existing targets put their TLS operand variants 
into the global namespace (VK_ARM_TLSGD, VK_Mips_DTPREL_HI, ...). However, the 
AArch64 target has more of these modifiers than all other targets combined and 
I felt it was inappropriate to pollute the global space for them.

This patch adds a virtual callback to MCTargetExpr so that analysis doesn't 
stop at this barrier and the work can be delegated to the target.

I believe this can be improved further; the implementatoin of 
MCTargetExpr::fixELFSymbolsInTLSFixups involves more duplication than I'd 
like. However, I would prefer to delay this further refactoring until AArch64 
is committed since it would provide an example use to reason from more easily.

Can I commit it?

Cheers.

Tim.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: target-tls-hook.diff
Type: text/x-patch
Size: 1854 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130109/0c8b656f/attachment.bin>


More information about the llvm-commits mailing list