[llvm-commits] [llvm] r78937 - in /llvm/trunk: include/llvm/MC/MCSectionELF.h lib/MC/MCSectionELF.cpp

Chris Lattner clattner at apple.com
Thu Aug 13 17:09:07 PDT 2009


On Aug 13, 2009, at 2:08 PM, Bruno Cardoso Lopes wrote:

> Author: bruno
> Date: Thu Aug 13 16:08:56 2009
> New Revision: 78937
>
> URL: http://llvm.org/viewvc/llvm-project?rev=78937&view=rev
> Log:
> Add a method to return if the ELF section contains only common  
> symbols!

Nice, but aren't weak symbols put in gnu.linkonce also?

-Chris

>
> Modified:
>    llvm/trunk/include/llvm/MC/MCSectionELF.h
>    llvm/trunk/lib/MC/MCSectionELF.cpp
>
> Modified: llvm/trunk/include/llvm/MC/MCSectionELF.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCSectionELF.h?rev=78937&r1=78936&r2=78937&view=diff
>
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- llvm/trunk/include/llvm/MC/MCSectionELF.h (original)
> +++ llvm/trunk/include/llvm/MC/MCSectionELF.h Thu Aug 13 16:08:56 2009
> @@ -55,6 +55,9 @@
>
>   /// ShouldPrintSectionType - Only prints the section type if  
> supported
>   bool ShouldPrintSectionType(unsigned Ty) const;
> +
> +  /// IsCommon - True if this section contains only common symbols
> +  bool IsCommon() const;
>
>   /// These are the section type and flags fields.  An ELF section  
> can have
>   /// only one Type, but can have more than one of the flags  
> specified.
>
> Modified: llvm/trunk/lib/MC/MCSectionELF.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCSectionELF.cpp?rev=78937&r1=78936&r2=78937&view=diff
>
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- llvm/trunk/lib/MC/MCSectionELF.cpp (original)
> +++ llvm/trunk/lib/MC/MCSectionELF.cpp Thu Aug 13 16:08:56 2009
> @@ -121,3 +121,13 @@
>   OS << '\n';
> }
>
> +// IsCommon - True if this section contains only common symbols
> +bool MCSectionELF::IsCommon() const {
> +
> +  if (strncmp(SectionName.c_str(), ".gnu.linkonce.", 14) == 0)
> +    return true;
> +
> +  return false;
> +}
> +
> +
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list