http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45375



Leo Yuriev <leo at yuriev dot ru> changed:



           What    |Removed                     |Added

----------------------------------------------------------------------------

                 CC|                            |leo at yuriev dot ru



--- Comment #164 from Leo Yuriev <leo at yuriev dot ru> 2013-01-06 00:31:55 UTC 
---

Some trouble while building LLVM with -flto.



../x86_64-linux-gnu/bin/ld.gold: error: /tmp/cc60XH2F.ltrans0.ltrans.o:

requires dynamic R_X86_64_PC32 reloc against 'X86CompilationCallback2' which

may overflow at runtime; recompile with -fPIC



Code:



extern "C" {

  void X86CompilationCallback(void);

  asm(

    ".text\n"

    ".align 8\n"

    ".globl " ASMPREFIX "X86CompilationCallback\n"

    TYPE_FUNCTION(X86CompilationCallback)

  ASMPREFIX "X86CompilationCallback:\n"

...

    "movq    8(%rbp), %rdx\n"

    "call    " ASMPREFIX "X86CompilationCallback2\n"

    "addq    $32, %rsp\n"

...

  );

}



void __attribute__((used))

X86CompilationCallback2(intptr_t *StackPtr, intptr_t RetAddr) {

  intptr_t *RetAddrLoc = &StackPtr[1];

...

}



}

Reply via email to