This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [Q] linking only some functions in an object file


> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]