<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    I strongly suspect that this use case wasn't considered.  :)  The
    honest answer is that an interested party could probably spec
    whatever they wanted as long as a) it was reasonable and b) it
    didn't break existing uses.  <br>
    <br>
    I could see possible reasons why we might want a non-relocatable
    trampoline (i.e. smaller code on a fast path), but I don't know if
    we exploit that today.  <br>
    <br>
    Without giving it too much thought, is there any reason that
    trampoline generation shouldn't follow the global "-fPIC" setting? 
    This would seem like a reasonable way to support both relocatable
    and non-relocatable trampolines.<br>
    <br>
    Taking a step back, let me ask a more fundamental question.  Why
    does the *code* need to move?  I can understand that the data
    needing to move - which clearly isn't supported today for
    trampolines - but why the code?  I would expect the code to be
    shared between many instances of an "add int parameter at position 2
    with value X" object (for example).  <br>
    <br>
    On a tangent, I'm not sure that the trampoline mechanism is the
    right one for procedure objects as you call them.  I would expect a
    lowering closer to a standard struct with a member function.  The
    member function does the parameter manipulation, with the data being
    stored in the struct.  This has the advantage of being 'normal data'
    and thus handled by the existing statepoint support.  <br>
    <br>
    Philip<br>
      <br>
    <br>
    <div class="moz-cite-prefix">On 12/25/2014 11:42 AM, Jonathan S.
      Shapiro wrote:<br>
    </div>
    <blockquote
cite="mid:CAAP=3QNwbauN42LprURsS3+aZs-jESZ+Onxcjg6+UHc1KR7TDA@mail.gmail.com"
      type="cite">
      <div dir="ltr">The specification of llvm.init.trampoline does not
        say whether the trampoline can safely be moved after code has
        been generated. Is there any contract about this?
        <div><br>
        </div>
        <div>My question is motivated by copying collectors, which may
          want to relocate procedure objects (in llvm-speak:
          trampolines). If the generated trampoline code uses a
          PC-relative call instruction, then either:</div>
        <div>
          <ol>
            <li>The trampoline needs to be updated during relocation (in
              which case I need a way to recover the target procedure's
              address), or<br>
            </li>
            <li>Trampolines cannot be relocated</li>
          </ol>
          I know that I can look at the LLVM implementation to see what
          it actually does, but if this question is not resolved by the
          specification of llvm.init.trampoline then the implementation
          is free to change in future.</div>
        <div><br>
        </div>
        <div>Thank you.</div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div>Jonathan</div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a class="moz-txt-link-freetext" href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a>
<a class="moz-txt-link-freetext" href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>