Sure, more information that way is useful. Sending a patch is always appreciated.<div><br></div><div>-eric<br><br><div class="gmail_quote">On Thu Oct 30 2014 at 8:46:52 AM Colin LeMahieu <<a href="mailto:colinl@codeaurora.org" target="_blank">colinl@codeaurora.org</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">We had a need for calculating an ELF section load address, essentially the<br>
LMA address printed out from GNU objdump with the –h option:<br>
<br>
Sections:<br>
Idx Name          Size      VMA       LMA       File off  Algn<br>
  0 .start        00003dc0  00000000  00000000  00001000  2**6<br>
<br>
It looks like GNU binutils calculates this by applying the delta between the<br>
vaddr and paddr of the section's enclosing segment.<br>
<br>
I implemented this inside llvm-readobj:<br>
<br>
  Section {<br>
    Index: 30<br>
    Name: .strtab (9)<br>
    Type: SHT_STRTAB (0x3)<br>
    Flags [ (0x0)<br>
    ]<br>
    Address: 0x0<br>
    Load Address: 0x0<br>
    Offset: 0x64FF88<br>
    Size: 2689979<br>
    Link: 0<br>
    Info: 0<br>
    AddressAlignment: 1<br>
    EntrySize: 0<br>
  }<br>
<br>
Is there interest in this being upstreamed?  It's a small patch.<br>
<br>
Is this the best place to put this information inside of llvm-readobj and<br>
underneath the 'Address:' line.  If there's a better place let me know.<br>
<br>
Qualcomm Innovation Center, Inc.<br>
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, <br>
a Linux Foundation Collaborative Project<br>
<br>
<br>
<br>
______________________________<u></u><u></u>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailm<u></u>an/listinfo/llvmdev</a><br>
</blockquote></div></div>