[PATCH] D21794: [ELF] - Added support for --unresolved-symbols option.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 29 03:51:38 PDT 2016


grimar added inline comments.

================
Comment at: ELF/Config.h:40
@@ +39,3 @@
+  IgnoreInObjectFiles,
+  IgnoreInSharedLibs
+};
----------------
grimar wrote:
> ruiu wrote:
> > We always ignore undefined symbols in DSOs, so this enum shouldn't have IgnoreInSharedLibs. This also overlaps with NoinhibitExec, so it needs reorganization.
> > 
> > I think you want to define this in Config.
> > 
> >   enum { Error, Warn, Ignore };
> > 
> > and
> > 
> >  - set to Error by default or if --unresolved-symbols=IgnoreAll
> >  - set to Warn if --noinhibit-exec
> >  - set to Ignore if --unresolved-symbols={IgnoreAll,IgnoreInObjectFiles,IgnoreInSharedLibs}
> This enum was for describing possible options for unresolved-symbols initially,
> but if you want to remove reportUndefinedFromSharedLibs() that of cource
> needs reorganization.
> 
> I would also add --no-undefined here then.
> 
> So can be:
> 
> Error by default or if --no-undefined or --unresolved-symbols={ReportAll, IgnoreInSharedLibs}
> Warn if --noinhibit-exec
> Ignore if --unresolved-symbols={IgnoreAll,IgnoreInObjectFiles}
I had to add NoUndef enum value to handle --no-undefined.
When --no-undefined is set we produce error even when -shared and symbol visibility STV_DEFAULT,
otherwise it is ignored. That was original logic worked before this patch.


http://reviews.llvm.org/D21794





More information about the llvm-commits mailing list