[llvm] r188855 - lli/RecordingMemoryManager.cpp: Make it complain if _GLOBAL_OFFSET_TABLE_ were not provided.

NAKAMURA Takumi geek4civic at gmail.com
Thu Aug 22 19:18:36 PDT 2013


Andy, I don't think my tweak were *the right thing*, and should be
removed in future.
I'd like to make sure for MCJIT to crash whenever GOT is referenced.

In fact, tests were crashing *in generated code* with GOT.

I am sorry if I didn't explain my background to you. Ask me again
then, thank you.

...Takumi


2013/8/22 Kaylor, Andrew <andrew.kaylor at intel.com>:
> Are you sure this was necessary?
>
> I haven't started looking at PIC for 32-bit x86 targets in MCJIT, but for x86-64 targets I ended up ignoring the _GLOBAL_OFFSET_TABLE_ symbol.  It was generated as an undefined/external symbol in the ELF headers, but since RuntimeDyld is doing all of its own relocation handling I didn't bother defining that symbol and nothing tried to reference it.
>
> -Andy
>
> -----Original Message-----
> From: llvm-commits-bounces at cs.uiuc.edu [mailto:llvm-commits-bounces at cs.uiuc.edu] On Behalf Of NAKAMURA Takumi
> Sent: Tuesday, August 20, 2013 7:37 PM
> To: llvm-commits at cs.uiuc.edu
> Subject: [llvm] r188855 - lli/RecordingMemoryManager.cpp: Make it complain if _GLOBAL_OFFSET_TABLE_ were not provided.
>
> Author: chapuni
> Date: Tue Aug 20 21:37:14 2013
> New Revision: 188855
>
> URL: http://llvm.org/viewvc/llvm-project?rev=188855&view=rev
> Log:
> lli/RecordingMemoryManager.cpp: Make it complain if _GLOBAL_OFFSET_TABLE_ were not provided.
>
> FIXME: Would it be responsible to provide GOT?
>
> Modified:
>     llvm/trunk/tools/lli/RecordingMemoryManager.cpp
>
> Modified: llvm/trunk/tools/lli/RecordingMemoryManager.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lli/RecordingMemoryManager.cpp?rev=188855&r1=188854&r2=188855&view=diff
> ==============================================================================
> --- llvm/trunk/tools/lli/RecordingMemoryManager.cpp (original)
> +++ llvm/trunk/tools/lli/RecordingMemoryManager.cpp Tue Aug 20 21:37:14
> +++ 2013
> @@ -113,5 +113,12 @@ void *RecordingMemoryManager::getPointer
>    // is called before ExecutionEngine::runFunctionAsMain() is called.
>    if (Name == "__main") return (void*)(intptr_t)&jit_noop;
>
> +  // FIXME: Would it be responsible to provide GOT?
> +  if (AbortOnFailure) {
> +    if (Name == "_GLOBAL_OFFSET_TABLE_")
> +      report_fatal_error("Program used external function '" + Name +
> +                         "' which could not be resolved!");  }
> +
>    return NULL;
>  }
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list