<div dir="ltr">As Davide guessed, that means interposable or preemptible. I'll update the comment to use preemptible, as the term is used throughout this file.</div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Mar 25, 2017 at 11:16 PM, Davide Italiano <span dir="ltr"><<a href="mailto:davide@freebsd.org" target="_blank">davide@freebsd.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Sat, Mar 25, 2017 at 10:21 PM, Sean Silva via llvm-commits<br>
<<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br>
> what does "non-interruptable" mean in this context? in the same segment?<br>
><br>
<br>
</span>Unless I'm reading the context incorrectly, it's a synonym for not<br>
preemptible at runtime.<br>
In case my guess is right, I really dislike the word `interruptible`<br>
because is such an overloaded word in systems.<br>
I'd rather use `interposable` or `preemptible` (to the best of my<br>
knowledge they're all synonyms in ELF, but please double<br>
check/confirm).<br>
<div class="HOEnZb"><div class="h5"><br>
> On Mar 25, 2017 9:32 PM, "Rui Ueyama via llvm-commits"<br>
> <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br>
>><br>
>> Author: ruiu<br>
>> Date: Sat Mar 25 22:20:30 2017<br>
>> New Revision: 298792<br>
>><br>
>> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=298792&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project?rev=298792&view=rev</a><br>
>> Log:<br>
>> Add comments and return early.<br>
>><br>
>> Modified:<br>
>>     lld/trunk/ELF/Relocations.cpp<br>
>><br>
>> Modified: lld/trunk/ELF/Relocations.cpp<br>
>> URL:<br>
>> <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Relocations.cpp?rev=298792&r1=298791&r2=298792&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/lld/trunk/ELF/<wbr>Relocations.cpp?rev=298792&r1=<wbr>298791&r2=298792&view=diff</a><br>
>><br>
>> ==============================<wbr>==============================<wbr>==================<br>
>> --- lld/trunk/ELF/Relocations.cpp (original)<br>
>> +++ lld/trunk/ELF/Relocations.cpp Sat Mar 25 22:20:30 2017<br>
>> @@ -312,6 +312,15 @@ static bool isRelExpr(RelExpr Expr) {<br>
>>                          R_PAGE_PC, R_RELAX_GOT_PC>(Expr);<br>
>>  }<br>
>><br>
>> +// Returns true if a given relocation can be computed at link-time.<br>
>> +//<br>
>> +// For instance, we know the offset from a relocation to its target at<br>
>> +// link-time if the relocation is PC-relative and refers a<br>
>> +// (non-interruptible) function in the same executable. This function<br>
>> +// will return true for such relocation.<br>
>> +//<br>
>> +// If this function returns false, that means we need to emit a<br>
>> +// dynamic relocation so that the relocation will be fixed at load-time.<br>
>>  template <class ELFT><br>
>>  static bool<br>
>>  isStaticLinkTimeConstant(<wbr>RelExpr E, uint32_t Type, const SymbolBody<br>
>> &Body,<br>
>> @@ -331,16 +340,19 @@ isStaticLinkTimeConstant(<wbr>RelExpr E, uint<br>
>><br>
>>    if (isPreemptible(Body, Type))<br>
>>      return false;<br>
>> -<br>
>>    if (!Config->Pic)<br>
>>      return true;<br>
>><br>
>> +  // For the target and the relocation, we want to know if they are<br>
>> +  // absolute or relative.<br>
>>    bool AbsVal = isAbsoluteValue<ELFT>(Body);<br>
>>    bool RelE = isRelExpr(E);<br>
>>    if (AbsVal && !RelE)<br>
>>      return true;<br>
>>    if (!AbsVal && RelE)<br>
>>      return true;<br>
>> +  if (!AbsVal && !RelE)<br>
>> +    return Target->usesOnlyLowPageBits(<wbr>Type);<br>
>><br>
>>    // Relative relocation to an absolute value. This is normally<br>
>> unrepresentable,<br>
>>    // but if the relocation refers to a weak undefined symbol, we allow it<br>
>> to<br>
>> @@ -350,16 +362,14 @@ isStaticLinkTimeConstant(<wbr>RelExpr E, uint<br>
>>    // Another special case is MIPS _gp_disp symbol which represents offset<br>
>>    // between start of a function and '_gp' value and defined as absolute<br>
>> just<br>
>>    // to simplify the code.<br>
>> -  if (AbsVal && RelE) {<br>
>> -    if (Body.isUndefined() && !Body.isLocal() && Body.symbol()->isWeak())<br>
>> -      return true;<br>
>> -    error(S.getLocation<ELFT>(<wbr>RelOff) + ": relocation " + toString(Type)<br>
>> +<br>
>> -          " cannot refer to absolute symbol '" + toString(Body) +<br>
>> -          "' defined in " + toString(Body.File));<br>
>> +  assert(AbsVal && RelE);<br>
>> +  if (Body.isUndefined() && !Body.isLocal() && Body.symbol()->isWeak())<br>
>>      return true;<br>
>> -  }<br>
>><br>
>> -  return Target->usesOnlyLowPageBits(<wbr>Type);<br>
>> +  error(S.getLocation<ELFT>(<wbr>RelOff) + ": relocation " + toString(Type) +<br>
>> +        " cannot refer to absolute symbol '" + toString(Body) +<br>
>> +        "' defined in " + toString(Body.File));<br>
>> +  return true;<br>
>>  }<br>
>><br>
>>  static RelExpr toPlt(RelExpr Expr) {<br>
>><br>
>><br>
>> ______________________________<wbr>_________________<br>
>> llvm-commits mailing list<br>
>> <a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
>> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-commits</a><br>
><br>
><br>
> ______________________________<wbr>_________________<br>
> llvm-commits mailing list<br>
> <a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-commits</a><br>
><br>
<br>
</div></div><span class="HOEnZb"><font color="#888888">--<br>
Davide<br>
<br>
"There are no solved problems; there are only problems that are more<br>
or less solved" -- Henri Poincare<br>
</font></span></blockquote></div><br></div>