<div dir="ltr">Hi,<div><br></div><div>To my understanding, lwgp/swgp might need linker relaxation because linker can resolve the symbol address and determine whether the gp-offset fit in to the instructions.</div><div>There are linker relaxation patches on lld but didn't land yet.</div><div><a href="https://reviews.llvm.org/D77694">https://reviews.llvm.org/D77694</a><br></div><div><a href="https://reviews.llvm.org/D100835">https://reviews.llvm.org/D100835</a><br></div><div><br></div><div>Hope this helps,</div><div>Shiva</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">liao <<a href="mailto:liaochunyu126@126.com">liaochunyu126@126.com</a>> 於 2021年10月18日 週一 上午10:08寫道:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="line-height:1.7;color:rgb(0,0,0);font-size:14px;font-family:Arial"><p style="margin:0px">CC</p><p style="margin:0px"><br></p><div style="zoom:1"></div><div id="gmail-m_7128751027375315769divNeteaseMailCard"></div><p style="margin:0px"><br></p><p>At 2021-10-15 15:01:30, "liao" <<a href="mailto:liaochunyu126@126.com" target="_blank">liaochunyu126@126.com</a>> wrote:</p><blockquote id="gmail-m_7128751027375315769isReplyContent" style="padding-left:1ex;margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204)"><div style="line-height:1.7;color:rgb(0,0,0);font-size:14px;font-family:Arial"><div>Maybe the LLD doesn't support linker relaxtion (It is difficult to implement). </div><div>(Correct me if I'm wrong)</div><div><br></div><p style="margin:0px">I want to implement lwgp, 17-bit/128KB gp-offset. (<a href="https://github.com/riscv/riscv-code-size-reduction/blob/after_v0.50.1_dev/ISA%20proposals/Huawei/Zce_spec.adoc#lwgp_semantics" target="_blank">https://github.com/riscv/riscv-code-size-reduction/blob/after_v0.50.1_dev/ISA%20proposals/Huawei/Zce_spec.adoc#lwgp_semantics</a>)</p><p style="margin:0px">Eg:  lui a0, %hi(sym); load/store a1, %lo(sym)(a0) -> lwgp/swgp a1, gp_offset(gp)</p><p style="margin:0px"><br></p><p style="margin:0px">question: </p><p style="margin:0px">1. Do I have to support linker relaxtion if I want to implement lwgp?   </p><p style="margin:0px">2. Is there any other way to solve the problem? assmembler? </p><div><br></div></div><br><br><span title="neteasefooter"><p> </p></span></blockquote></div><br><br><span title="neteasefooter"><p> </p></span></blockquote></div>