[llvm-commits] PATCH: lld ReaderELF.cpp update

Sid Manning sidneym at codeaurora.org
Wed Jul 18 10:56:49 PDT 2012


On 07/14/12 00:28, Sid Manning wrote:
>
> On 07/13/12 18:16, Michael Spencer wrote:
>> On Fri, Jul 13, 2012 at 11:44 AM, Sid
>> Manning<sidneym at codeaurora.org> wrote:
>
>>
>> I realize you were following the example of getDyn here. However,
>> all of these should take a
>> {section,symbol,dynasymbol,relocation}_iterator instead as COFF
>> does. DataRefImpl should never be used by clients of LLVMObject.
>> There's no need for you to change getDyn over if it's not trivial.
> So I would add new methods to ELF.h similar to
> getCOFFSection/Symbol. I will give this a try.
>
Added new API's to ELF.h: getElfSection/Symbol that take iterators.
Made getSymbolName public and added getSectionName.

This patch is in the attachment: add-new-interfaces-to-ELF.h.diff

>>
>> For this and all the below code, why are you using the generic
>> interface instead of the ELF specific interface? Quite a bit of
>> this would be a lot cleaner with the ELF interface.
>>
> The generic interface seemed to work, si->getName returns the symbol
> name. If methods similar to getCOFFSection/Symbol taking the iterator
> are available and getSymbolName (const Elf_Shdr *,const Elf_sym *,
> StringRef) is made public then I think the generic interface calls
> can be done away with. I will try to work this out.
>
I made the changes using the API's added to ELF.h.  At this point I 
think ReaderELF.cpp mirrors ReaderCOFF.cpp.  All the symbols are sorted 
and defined atoms' sizes are calculated using the same method.

This patch is in the attachment: add-ElfReader-and-tests-update2.diff

To keep everything together I've also include the test inputs submitted 
last Friday here as well.
- testInputs.tgz:
This tarball has 2 files that will expand to:
       test/elf/Inputs/object-test.elf-hexagon
       test/elf/Inputs/object-test.elf-i386

Thanks,

-- 
Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum
-------------- next part --------------
A non-text attachment was scrubbed...
Name: add-new-interfaces-to-ELF.h.diff
Type: text/x-patch
Size: 4517 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120718/3739d2bd/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: add-ElfReader-and-tests-update2.diff
Type: text/x-patch
Size: 27137 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120718/3739d2bd/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: testInputs.tgz
Type: application/x-compressed-tar
Size: 1169 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120718/3739d2bd/attachment-0002.bin>


More information about the llvm-commits mailing list