<div dir="ltr">Are you suggesting other linker jobs such as creating _end symbols to the linker script?<div><br></div><div>The linker script support was implemented after we wrote the current Writer class, so it is somewhat "plugged in" to the Writer. It might not be the best design, and not many other options have been explored. So there might be room to improve code by moving work loads from the Writer to the LinkerScript. But we need to careful not to hurt performance by doing that.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Apr 5, 2017 at 4:14 PM, Rafael EspĂ­ndola via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.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="">> Proposed implementation for range extension thunks<br>
> At a high-level we need to solve the following problems:<br>
> - Assign addresses more than once<br>
> - Maintain state between successive calls of createThunks()<br>
> - Synchronization of the linker script and the OutputSection after adding thunks<br>
<br>
</span>This last past seems to be the messier. The issue is not with the<br>
patch, is with the existing infrastructure that uses a completely<br>
different representation for linker scripts and non linker scripts.<br>
<br>
What I think is needed is for the writer to create a dummy "script"<br>
and use what is now LinkerScript::assignAddresses. That "script" would<br>
<br>
* Contain only OutputSectionCommand.<br>
* All string manipulations would have been moved before assignAddress.<br>
* All the orphan handling would have been made explicit before assignAddress.<br>
* Each OutputSectionCommand would contain just a InputSectionDescription.<br>
<br>
With this the thunk creation should be able to add thunk to a single location.<br>
<br>
Cheers,<br>
Rafael<br>
<div class="HOEnZb"><div class="h5">______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
</div></div></blockquote></div><br></div>