This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [Q] linking only some functions in an object file
- To: info2choijo at yahoo dot com (jw c)
- Subject: Re: [Q] linking only some functions in an object file
- From: Toshi Morita <tm2 at best dot com>
- Date: Wed, 18 Apr 2001 22:14:04 -0700 (PDT)
- Cc: binutils at sources dot redhat dot com
> Hello, all.
> I have a question.
>
> For example, when I link test.o test2.o and make
> test.elf, all of functions in test.o test2.o gets in
> test.elf.
>
> But I don't want not-used-functions to get in
> test.elf. How can I do this?
>
> Thank you.
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Auctions - buy the things you want at great prices
> http://auctions.yahoo.com/
>
1) Put each function in a separate file
2) Compile each file separately
3) Build an "ar" archive of the object files
4) Run ranlib on the archie to convert to library
Toshi