Linking un-referenced function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I looked through the documents and couldn't find an
option to not link an un-referenced function into the
final image.  Does GCC support it?  Could someone
please help?

For example, I have two functions in a file.  

example.c

void dummy_1 (void)
{
    printf("dummy 1\n");
}

void dummy_2 (void)
{
    printf("dummy 2\n");
}

dummy_1() is referenced by others in a different file
but not dummy_2().  However, dummy_2 is also got
linked to the final image.  It looks like the compiler
links functions by the entire object file but not by
each function.  Is there a way to exclude linking
dummy_2() to the final image?

Thank you very much for your help.

Regards,

Jason

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux