[PATCH] D27075: Object: Add SF_Text symbol flag.

Peter Collingbourne via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 29 21:53:18 PST 2016


On Tue, Nov 29, 2016 at 9:44 PM, Rafael Avila de Espindola <
rafael.espindola at gmail.com> wrote:

> Peter Collingbourne <peter at pcc.me.uk> writes:
>
> > pcc added inline comments.
> >
> >
> > ================
> > Comment at: llvm/lib/Object/ModuleSymbolTable.cpp:166
> > +    if (isa<Function>(GO) && !GO->hasSection())
> > +      Res |= BasicSymbolRef::SF_Text;
> >    if (GV->hasPrivateLinkage())
> > ----------------
> > mehdi_amini wrote:
> >> Why the test on the presence of a section? Do we have a test that
> exercise this?
> > It's a rough approximation for "is this function in the .text section or
> not". I don't think there's a test, I'll add one.
>
> But at least for nm we want to print 't' for a function in another
> section, no?
>

Yes, I was basing this logic on the nm man page which says "The symbol is
in the text (code) section.", but it looks like that is wrong and nm is
testing the executable bit on the section instead. I'll remove the
hasSection part.

Maybe the flag should be named SF_Executable then?

Thanks,
-- 
-- 
Peter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161129/167791cd/attachment.html>


More information about the llvm-commits mailing list