[LLVMdev] misc unused symbols: '_write' and '_abort'

Chris Lattner sabre at nondot.org
Wed Jul 6 09:17:53 PDT 2005


On Wed, 6 Jul 2005, Aaron Gray wrote:

> I am working on the MASM backend.
>
> I do not know what to do about '_write' and '_abort'. They seem to be 
> added to a modules functions as externals even when they are not being 
> used.

Why is that a problem?

> They cannot just be remove just in case they are being used. What are 
> they there for ?

They are part of the exception handling support.

> The only options I have are to scan the whole module for uses of them, 
> or to provide library implementations for them. OR to work out where 
> they are being added in the first place and remove them if they are not 
> being used.

Is this actually a problem?  Have you actually tried linking the program 
and received unresolved symbol errors?  Having unused dangling labels like 
that can often occur for many reasons.  For example, a similar thing would 
happen to this program for many compilers:


void abort(void);
int main() { return 0; }


OTOH, I'll note that you're hitting this because you're walking the list 
of functions in the module, not building a list of external symbols like 
the PPC backend is doing.  It specifically keeps track of external symbols 
(as the references to them are being emitted) and does basically what you 
need to do.  I would take a look at it if write/abort are really causing a 
problem.

-Chris

-- 
http://nondot.org/sabre/
http://llvm.cs.uiuc.edu/




More information about the llvm-dev mailing list