[PATCH] [lld][ELF] Fix debug info handling.

Nick Kledzik kledzik at apple.com
Fri Sep 13 15:49:28 PDT 2013


On Sep 13, 2013, at 3:39 PM, Shankar Easwaran <shankare at codeaurora.org> wrote:

> The comparison would need to be done in the DefinedAtom though, if _contentType == typeCode and _sectionName == ".text" return sectionBasedOnContent.
No.  

What I am saying is that on the ELF Reader side, if the atom is in a section named “.text”, the atom being constructed would have its sectionChoice set to sectionBasedOnContentnot and it would not be given a section name.  On the ELF Writer side, if an atom has a section choice of sectionBasedOnContent, then the contentType is checked and typeCode implies it should go into the .text section.  And the same for other standard sections like .data and .bss. 

> Do you see any other advantage with sectionBasedOnContent ?
The YAML will be much smaller (no section attributes for most atoms).  The native format will be a little smaller because names like .text and .data won’t need to be encoded.

-Nick

> 
> On 9/13/2013 5:24 PM, Nick Kledzik wrote:
>> 
>> On Sep 13, 2013, at 2:48 PM, Shankar Kalpathi Easwaran <shankarke at gmail.com> wrote:
>>>  On ELF a typeCode section can be associated with any set of sections, there is no one to one relationship with typeCode and ".text”.
>> Yes, but if the compiler puts functions into .text by default, then the linker can similar say any function in .text has sectionChoice() of sectionBasedOnContent and the ELF writer can put sectionBasedOnContent of typeCode into ".text”.
>> 
>> In other words, the lld model is that for most atoms the section can be inferred from the content.  But, that inference can be overridden and a certain section can be forced onto an atom.  The ELF reader is currently always forcing the section.
>> 
>> -Nick
>> 
>> 
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>> 
>> 
> 
> 
> -- 
> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by the Linux Foundation





More information about the llvm-commits mailing list