[PATCH] sectiongroup support

Shankar Easwaran shankare at codeaurora.org
Mon Mar 17 16:34:51 PDT 2014

On 3/17/2014 6:24 PM, Nick Kledzik wrote:
> On Mar 17, 2014, at 3:48 PM, Shankar Easwaran <shankare at codeaurora.org 
> <mailto:shankare at codeaurora.org>> wrote:
>>> I think the solution:
>>> 1) keep the existing canonical form for an atom graph that Passes 
>>> process
>>> 2) make the ELF Writer smart that when it writes relocatable object 
>>> files, to synthesize undefined symbols for references into group 
>>> children
>>> 3) Have the YAML Reader be dumb and not synthesize any undefines. 
>>>  Test cases for groups that want undefines will need to explicitly 
>>> have them in the yaml.  This also enables you to write test cases 
>>> that test the error case where an indirection though an undefine is 
>>> not used.
>> The below steps as in the command line would not work though.
>> lld -flavor gnu -target x86_64 group.o --output-filetype=yaml 
>> --noinhibit-exec
>> (Input file is processed by the ELF reader, convert the read files to 
>> YAML files, re-read the files from YAML back into atoms)
>> As the YAML reader wouldnt synthesize undefined atoms ? Its like a 
>> chicken-egg problem.
> Think of the YAML Reader and Writer as dumb.  They just convert 
> in-memory-objects <-> yaml.    Undefined are never synthesized (point 
> 3 above).  If you want to write test cases for groups in yaml, you’ll 
> need to explicitly add the UndefineAtom in the yaml file.

You are right that if the YAML reader and writer is used for testing, as 
well as the Native reader/writer. The problem will appear when the 
linker emittted YAML/Native file (after the resolver is complete) is 
used in a separate link, isnt it ?

Is this a usecase that we would not be supporting ?


Shankar Easwaran

Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by the Linux Foundation

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140317/549af38a/attachment.html>

More information about the llvm-commits mailing list