Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
12748 Discussions

Removing unused code fror NIOS target

Altera_Forum
Honored Contributor II
1,180 Views

Hi All, 

 

I am using nios-elf tools to compile and build a binary for NIOS target. There are many  

unused functions in the code which I want to remove during linking. 

I have used -ffunction-sections as a compile option and -gc-sections as linker option. Though I am able to put the functions in their own sections , I am not able to run the resulting binary. 

I have often read that not all targets support this. Does any one know if NIOS target supports this? 

 

Cheers, 

Ajay
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
493 Views

 

--- Quote Start ---  

originally posted by ajay@Jan 19 2006, 08:11 AM 

  i am using nios-elf tools to compile and build a binary for nios target. there are many   

unused functions in the code which i want to remove during linking. 

<div align='right'><{post_snapback}> (index.php?act=findpost&pid=12280) 

--- quote end ---  

 

--- Quote End ---  

 

 

Did you try putting each function in a separate file, creating a library out of them, and linking the library to the main file? the linker should be able to do the job automatically for you! 

 

bye 

 

Paolo
0 Kudos
Reply