[LLVMdev] ELF section load address
colinl at codeaurora.org
Thu Oct 30 08:41:02 PDT 2014
We had a need for calculating an ELF section load address, essentially the
LMA address printed out from GNU objdump with the h option:
Idx Name Size VMA LMA File off Algn
0 .start 00003dc0 00000000 00000000 00001000 2**6
It looks like GNU binutils calculates this by applying the delta between the
vaddr and paddr of the section's enclosing segment.
I implemented this inside llvm-readobj:
Name: .strtab (9)
Type: SHT_STRTAB (0x3)
Flags [ (0x0)
Load Address: 0x0
Is there interest in this being upstreamed? It's a small patch.
Is this the best place to put this information inside of llvm-readobj and
underneath the 'Address:' line. If there's a better place let me know.
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
More information about the llvm-dev