On 22 May 2013 09:37, David Chisnall <David.Chisnall at cl.cam.ac.uk> wrote:> On 22 May 2013, at 14:28, Rafael Espíndola <rafael.espindola at gmail.com> wrote: > >> I wouldn't be surprised if >> these relocations are not implemented yet, but that should be all that >> is needed to get tls working. > > That was, indeed, where this discussion started. Andrew's suggestion was to use the small code model, in the hope that this would fix some things. The lack of support for these relocations is what is stopping my code from working with MCJIT, and your removal of EH is stopping it working with the legacy JIT.Well, these relocations are there because of the general dynamic tls model, so they would be present on all code models. Cheers, Rafael
To clarify, MCJIT currently has no GOT support whatsoever for ELF with x86-64 and ARM (and probably others). My experimental patch was meant as an attempt to get TLS working with static relocation model and small code model. It's the combination of these two that requires memory in the lower 2GB. MCJIT works with static and large, but the MC code generator has a problem with TLS and large code model. Obviously we just need to get PIC support in place for MCJIT. -Andy -----Original Message----- From: Rafael Espíndola [mailto:rafael.espindola at gmail.com] Sent: Wednesday, May 22, 2013 6:42 AM To: David Chisnall Cc: Kaylor, Andrew; LLVM Developers Mailing List Subject: Re: [LLVMdev] TLS with MCJIT (an experimental patch) On 22 May 2013 09:37, David Chisnall <David.Chisnall at cl.cam.ac.uk> wrote:> On 22 May 2013, at 14:28, Rafael Espíndola <rafael.espindola at gmail.com> wrote: > >> I wouldn't be surprised if >> these relocations are not implemented yet, but that should be all >> that is needed to get tls working. > > That was, indeed, where this discussion started. Andrew's suggestion was to use the small code model, in the hope that this would fix some things. The lack of support for these relocations is what is stopping my code from working with MCJIT, and your removal of EH is stopping it working with the legacy JIT.Well, these relocations are there because of the general dynamic tls model, so they would be present on all code models. Cheers, Rafael
On 22 May 2013 12:30, Kaylor, Andrew <andrew.kaylor at intel.com> wrote:> To clarify, MCJIT currently has no GOT support whatsoever for ELF with x86-64 and ARM (and probably others).No, I added a bare minimal to get EH working...> My experimental patch was meant as an attempt to get TLS working with static relocation model and small code model. It's the combination of these two that requires memory in the lower 2GB. MCJIT works with static and large, but the MC code generator has a problem with TLS and large code model.I see. Yes, on that model codegen would produce local exec TLS model and we would only need R_X86_64_TPOFF32 (and making sure the code was close to the tls block).> Obviously we just need to get PIC support in place for MCJIT.Agreed. Thanks, Rafael