<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=koi8-r">
<style type="text/css" style="display:none"><!-- p { margin-top: 0px; margin-bottom: 0px; }--></style>
</head>
<body dir="ltr" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p><span style="color: rgb(33, 33, 33); font-size: 12pt;">>Sure. But if PLTs for all targets have the PLT header for lazy symbol resolution (I believe that's the case), </span></p>
<p><span style="color: rgb(33, 33, 33); font-size: 12pt;">>and IPLT doesn't have one (I believe that's true too), then we can use `bool is Iplt() { return HeaderSize == 0; }` </span></p>
<p><span style="color: rgb(33, 33, 33); font-size: 12pt;">>instead of adding a new boolean flag to the ctor.</span><br>
</p>
<p><span style="color: rgb(33, 33, 33); font-size: 12pt;"><br>
</span></p>
<p><span style="color: rgb(33, 33, 33); font-size: 12pt;">Such approach does not always works good. I tried to do that and</span></p>
<p><span style="color: rgb(33, 33, 33); font-size: 12pt;">for example for safety I tried to check that we always set <span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; background-color: rgb(255, 255, 255);">PltHeaderSize when
 creating PltSections</span>:</span></p>
<p><span style="color: rgb(33, 33, 33); font-size: 12pt;"><br>
</span></p>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
  assert(Target->PltHeaderSize);</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
  InX::Plt = make<PltSection>(Target->PltHeaderSize);</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
  Add(InX::Plt);</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
  InX::Iplt = make<PltSection>(0);</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">
  Add(InX::Iplt);​<br>
</div>
<p style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;"><span style="color: rgb(33, 33, 33); font-size: 12pt;"><br>
</span></p>
<p style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;"><span style="color: rgb(33, 33, 33); font-size: 12pt;">And found that AMDGPU does not set it either, though according to its spec (https://llvm.org/docs/AMDGPUUsage.html)</span></p>
<p style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;"><span style="color: rgb(33, 33, 33); font-size: 12pt;">and LLD code it does not have PLT relocations. There is no much sence to set dummy value for <span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; background-color: rgb(255, 255, 255);">PltHeaderSize</span>
 for</span></p>
<p style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;"><span style="color: rgb(33, 33, 33); font-size: 12pt;"><span style="color: rgb(33, 33, 33); font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; background-color: rgb(255, 255, 255);">AMDGPU</span>,
 it looks just like a hacky workaround.<br>
</span></p>
<p><span style="color: rgb(33, 33, 33); font-size: 12pt;"><br>
</span></p>
<p><span style="color: rgb(33, 33, 33); font-size: 12pt;">And at the same time for PPC and PPC64 I had to add:</span></p>
<p><span style="color: rgb(33, 33, 33); font-size: 12pt;"><br>
</span></p>
<div>  // Our implementation assumes that target's PltHeaderSize is</div>
<div>  // never a zero. Use dummy value.</div>
<div>  PltHeaderSize = 8;<br>
</div>
<p><span style="color: rgb(33, 33, 33); font-size: 12pt;"><br>
</span></p>
<p><span style="color: rgb(33, 33, 33); font-size: 12pt;">What is actually completely useless IMO. I see nothing wrong that some target does not implement lazy binding. It might never</span></p>
<p><span style="color: rgb(33, 33, 33); font-size: 12pt;">implement it probably. So why we should assume it must do it and </span><span style="color: rgb(33, 33, 33); font-size: 12pt;">create larger output for it then </span><span style="color: rgb(33, 33, 33); font-size: 12pt;">?</span></p>
<p><span style="color: rgb(33, 33, 33); font-size: 12pt;">It looks like because of bad design of PLT sections we are trying to create larger output to workaround it.</span></p>
<p><span style="color: rgb(33, 33, 33); font-size: 12pt;"><br>
</span></p>
<p><span style="color: rgb(33, 33, 33); font-size: 12pt;">George.</span></p>
</body>
</html>