<br><br><div class="gmail_quote">On Wed, Aug 3, 2011 at 10:03 AM, Danil Malyshev <span dir="ltr"><<a href="mailto:dmalyshev@accesssoftek.com">dmalyshev@accesssoftek.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">










<div lang="RU" link="blue" vlink="purple">

<div>

<p class="MsoNormal"><font size="2" face="Arial"><span lang="EN-US" style="font-size:10.0pt;font-family:Arial">Hello everyone,<u></u><u></u></span></font></p>

<p class="MsoNormal"><font size="2" face="Arial"><span lang="EN-US" style="font-size:10.0pt;font-family:Arial"><u></u> <u></u></span></font></p>

<p class="MsoNormal"><font size="2" face="Arial"><span lang="EN-US" style="font-size:10.0pt;font-family:Arial"><u></u> <u></u></span></font></p>

<p class="MsoNormal"><font size="2" face="Arial"><span lang="EN-US" style="font-size:10.0pt;font-family:Arial">Please review the new class: ELFObject - ELF object
file wrapper.<u></u><u></u></span></font></p>

<p class="MsoNormal"><font size="2" face="Arial"><span lang="EN-US" style="font-size:10.0pt;font-family:Arial">It's will be use in MCJIT dynamic linker.<u></u><u></u></span></font></p>

<p class="MsoNormal"><font size="2" face="Arial"><span lang="EN-US" style="font-size:10.0pt;font-family:Arial">Patch attached<u></u><u></u></span></font></p>

<p class="MsoNormal"><font size="2" face="Arial"><span lang="EN-US" style="font-size:10.0pt;font-family:Arial"><u></u> </span></font></p></div></div></blockquote><div><br></div><div>Hi, after a cursory glance, I have a few questions - </div>

<div><ol><li>What is the plan for this class? i.e. Is there a doc somewhere that describes ...</li><ol><li>Which architecture is to be supported first? </li><li>How will you split off architecture specific details, such as ..</li>

<li>Relocations during JIT?</li></ol><li>Is it intended to ever support 64 bit elf files directly? If so, you'll have to do something about the 32bit offset helpers below (for starters) and/or the class name (for clarity) If not, then should this class be called ELF32Object? </li>

</ol></div><div><br></div><div>Thanks!</div><div><br></div><div><br></div><div><div><font class="Apple-style-span" face="'courier new', monospace">+</font></div><div><font class="Apple-style-span" face="'courier new', monospace">+  /// \brief Get the pointer to a byte with offset in the ELF object.</font></div>

<div><font class="Apple-style-span" face="'courier new', monospace">+  /// \param Offset - offset from a first byte in the ELF object.</font></div><div><font class="Apple-style-span" face="'courier new', monospace">+  const uint8_t *getOffset(unsigned Offset) const {</font></div>

<div><font class="Apple-style-span" face="'courier new', monospace">+    assert((Offset < Buffer->getBufferSize()) &&</font></div><div><font class="Apple-style-span" face="'courier new', monospace">+           "Offset out of range!");</font></div>

<div><font class="Apple-style-span" face="'courier new', monospace">+    return (const uint8_t*)Buffer->getBufferStart() + Offset;</font></div><div><font class="Apple-style-span" face="'courier new', monospace">+  }</font></div>

<div><font class="Apple-style-span" face="'courier new', monospace">+</font></div><div><font class="Apple-style-span" face="'courier new', monospace">+  /// \brief Get the pointer to a string from the string section.</font></div>

<div><font class="Apple-style-span" face="'courier new', monospace">+  /// \param Offset - offset from a first byte in the string section.</font></div><div><font class="Apple-style-span" face="'courier new', monospace">+  /// \param SectionIndex - index of section in the section headers table.</font></div>

<div><font class="Apple-style-span" face="'courier new', monospace">+  const char *getStringAtOffset(unsigned Offset, unsigned SectionIndex) const {</font></div><div><font class="Apple-style-span" face="'courier new', monospace">+    return (const char*)getOffset(getSectionHeader(SectionIndex)->sh_offset) +</font></div>

<div><font class="Apple-style-span" face="'courier new', monospace">+                        Offset;</font></div><div><font class="Apple-style-span" face="'courier new', monospace">+  }</font></div></div>
<div>
<font class="Apple-style-span" face="'courier new', monospace"><br></font></div><div><font class="Apple-style-span" face="arial, helvetica, sans-serif">Thanks</font></div><div><font class="Apple-style-span" face="arial, helvetica, sans-serif"><br>

</font></div><div><font class="Apple-style-span" face="arial, helvetica, sans-serif">-jason</font></div><div><font class="Apple-style-span" face="arial, helvetica, sans-serif"><br></font></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div lang="RU" link="blue" vlink="purple"><div><p class="MsoNormal"><font size="2" face="arial, helvetica, sans-serif"><span lang="EN-US" style="font-size: 10pt; "><u></u></span></font></p>

<p class="MsoNormal"><font size="2" face="Arial"><span lang="EN-US" style="font-size:10.0pt;font-family:Arial"><u></u> <u></u></span></font></p>

<p class="MsoNormal"><font size="2" face="Arial"><span lang="EN-US" style="font-size:10.0pt;font-family:Arial">Regards,<u></u><u></u></span></font></p>

<p class="MsoNormal"><font size="2" face="Arial"><span lang="EN-US" style="font-size:10.0pt;font-family:Arial">Danil<u></u><u></u></span></font></p>

</div>

</div>


<br>_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
<br></blockquote></div><br>