[LLVMdev] high bit of function address set incorrectly?

Maurice Gittens mainmanmauricio at gmail.com
Sun Jul 31 05:42:09 PDT 2011


I recently updated to current llvm svn and fixed-up the minor compiler
errors I encountered.
However, at run-time even my Hello world programs crash with a
segmentation fault.

A concrete program that crashes on my Linux x86_64 Fedora box is:

declare void @__ot_runtime_print_int(i8*, i32)

define void @main() {
  call void @__ot_runtime_print_int(i8* null, i32 12)
  br label %return

return:                                           ; preds = %entry
  ret void

LLVM magic turns this into the assember shown in the attached image.

I am no expert but is seems to me that the address generated
(0x8000012c1eea) for the __ot_runtime_print_int function is incorrect.
As both  nm and the debugger (kdbg) suggest that the address of the
function in question is: 0x12c1eea.

So why is the high bit of the function address set? Anybody willing to
shed some light on what is happening here?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: disassemble.png
Type: image/png
Size: 9049 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110731/621fca5b/attachment.png>

More information about the llvm-dev mailing list