[PATCH] D31901: LTO: Pass SF_Executable flag through to InputFile::Symbol

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 10 16:39:27 PDT 2017


pcc added a comment.

This ld.bfd behaviour [0,1] is very strange. It appears to be loading archive members to resolve common symbols, but will only do so if the archive member's definition is neither a common symbol itself (which is reasonable enough I suppose) nor of function type (which doesn't really seem necessary to check). I have no strong objections to extending the API to allow clients to implement compatible behaviour, but I don't think we should implement it in lld for example.

Agreed with @davide that this needs a test case. I am working on a change to llvm-lto2 that adds a feature for dumping the LTO symbol table, which should allow you to test this. @tobiasvk would you be fine with waiting until that change lands?

[0] https://github.com/bminor/binutils-gdb/blob/8170f7693bc0a9442c0aa280197925db92d48ca6/bfd/elflink.c#L5372
[1] https://github.com/bminor/binutils-gdb/blob/8170f7693bc0a9442c0aa280197925db92d48ca6/bfd/elflink.c#L3124



================
Comment at: lib/Object/IRSymtab.cpp:129
+  if (Flags & object::BasicSymbolRef::SF_Executable)
+        Sym.Flags |= 1 << storage::Symbol::FB_executable;
 
----------------
clang-format


https://reviews.llvm.org/D31901





More information about the llvm-commits mailing list