[LLVMdev] [PATCH] TLS support for Windows 32+64bit

Kai kai at redstar.de
Thu Jan 26 09:00:40 PST 2012


On 25.01.2012 22:38, Eli Friedman wrote:
> On Thu, Jan 19, 2012 at 9:24 AM, Kai<kai at redstar.de>  wrote:
>> Hi!
>>
>> I added 2 more tests and also refined an assert statement. Applies cleanly
>> to r148473 now. Are there more comments on the code? Thank you!!
> +  assert(Inst.getOperand(0).isReg()&&
> +	     (Inst.getOperand(ImmOp).isImm() ||
> +		 (Inst.getOperand(ImmOp).isExpr()&&
> +		  Inst.getOperand(ImmOp).getExpr()->getKind() == MCExpr::SymbolRef)&&
> +		  static_cast<const
> MCSymbolRefExpr*>(Inst.getOperand(ImmOp).getExpr())->getKind() ==
> MCSymbolRefExpr::VK_SECREL)&&
>
> Just asserting "Inst.getOperand(ImmOp).isImm() ||
> (Inst.getOperand(ImmOp).isExpr()" should be sufficient here; in
> theory, a wide variety of relocatable expressions are legal here, even
> if we don't actually generate code like that at the moment.
I changed the assert as you proposed.
> I would prefer if someone more familiar with COFF MC stuff could take
> a look to make sure there isn't anything obviously wrong; otherwise,
> the patch looks good.
I think the "big change" is that I changed the relocation type from 
IMAGE_REL_AMD64_SREL32 to IMAGE_REL_AMD64_SECREL for 64bit systems. I 
believe that there are currently no uses of this relocation type, but I 
may be wrong here.
> -Eli
>

Regards
Kai
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: tls-20120126.diff
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120126/ba4dcac8/attachment.ksh>


More information about the llvm-dev mailing list