[lld] r189718 - [lld][LinkingContext] Atoms created from command line options should be available in YAML

Shankar Easwaran shankare at codeaurora.org
Mon Sep 2 19:14:29 PDT 2013


Hi Ruiu,

The code to add the entry symbol to the undefined symbol is already 
called when createInternalFiles gets called.

Look at, PECOFFLinkingContext::createEntrySymbolFile().

and the code in WinLinkDriver.cpp, is also present, which makes the 
entry symbol set to be deadstripped.

     448   if (ctx.deadStrip()) {
     449     ctx.addDeadStripRoot(ctx.entrySymbolName());
     450     for (const StringRef symbolName : 
ctx.initialUndefinedSymbols())
     451       ctx.addDeadStripRoot(symbolName);
     452   }

If you want a new variant of setEntrySymbolName, you should make it 
virtual and make the definition suite Windows Link.

Can you please revert 189776 of adding to the list of undefined symbols 
at link line as soon as you see an entry symbol.

Thanks

Shankar Easwaran

On 9/2/2013 4:34 PM, Rui Ueyama wrote:
>> @@ -184,9 +184,7 @@ public:
>>     // Set the entry symbol name. You may also need to call
>> addDeadStripRoot() for
>>     // the symbol if your platform supports dead-stripping, so that the
>> symbol
>>     // will not be removed from the output.
>> -  void setEntrySymbolName(StringRef name) {
>> -    // Entry function have to be resolved as an undefined symbol.
>> -    addInitialUndefinedSymbol(name);
>> +  virtual void setEntrySymbolName(StringRef name) {
>>       _entrySymbolName = name;
>>     }
>>
> You just removed addInitialUndefinedSymbol() and did not add the equivalent
> code to anywhere, so entry symbol is not added to dead stripping root. As a
> result the linker is now producing an incorrect output at least in -flavor
> link mode. I'll resurrect this code as well as adding a test to find this
> kind of breakage.
>


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




More information about the llvm-commits mailing list