[llvm-commits] Absolute symbols with local binding

Nick Kledzik kledzik at apple.com
Fri Nov 2 14:47:35 PDT 2012


Hemant,

The code changes are all good.   

The test case can be folded into one file there is no need for separate .yaml files.  Just put all the yaml documents in the .objtxt file and have the top line look like:
  # RUN: lld-core %s  | FileCheck %s

With that change, you can commit.

-Nick

On Nov 2, 2012, at 1:02 PM, Hemant Kulkarni wrote:
> Attached is the patch. I tried doing same with global symbols and they did collide as expected.
>  
> --
> Hemant Kulkarni
> khemant at codeaurora.org
> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by the Linux Foundation
>  
> From: Nick Kledzik [mailto:kledzik at apple.com] 
> Sent: Thursday, November 01, 2012 6:50 PM
> To: Hemant Kulkarni
> Cc: 'Michael Spencer'; mariog at codeaurora.org; 'Sid Manning'; 'LLVM Commits'; 'Shankar Easwaran'
> Subject: Re: Absolute symbols with local binding
>  
>  
> On Nov 1, 2012, at 4:41 PM, Hemant Kulkarni wrote:
> 
> 
> Hi Nick,
>  
> I am linking a code that has an absolute symbol with local scope binding type in ELF. This is valid as per ABI, but when the lld-core calls resolver, it fails since the SymbolTable::addByName reaches a condition of NCR_Error in collide(). It seems like the absolute symbols are always treated like global symbols and in Resolver::doAbsoluteAtom never checks for scope. I remember Sidney adding scope() to AbsoluteAtom class sometime back. I think it is only used in reader/writer and not wired into the lld/Core.
> I suggest checking scope of absolute atoms as well and add to SymbolTable only if their scope is not scopeTranslationUnit. What do you think?
> Yes.  That is correct.  Please add that fix and a yaml based test case that exercises it.
>  
>  
> -Nick
>  
> <abs-scope.patch>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20121102/42069fea/attachment.html>


More information about the llvm-commits mailing list