UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Visitor mahirztrk
Visitor
5,371 Views
Registered: ‎11-19-2009

Removing Unused functions from Assembly Code

Jump to solution

   I wrote an extremely  simple program in SDK  11.1.  I've expected a small sized program that would be fit in a 4K block RAM, but it didn't. When I  looked

the assembly code (with mb-objdump -S). I realized something strange that compiler added some functions to assembly code even i didnt use them directly

or indirectly like XIntc_Disconnect, XIntc_Stop (Actually, all the functions in the intc driver were added). How can i remove these? Any idea?

 

(I tried to build the project with area optimization enabled, but it didnt work.)

 

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
Xilinx Employee
Xilinx Employee
6,766 Views
Registered: ‎04-23-2008

Re: Removing Unused functions from Assembly Code

Jump to solution

4k is very tiny. Using "-Os" won't be enough (as you have discovered).

Look at the "-ffunction-sections" GCC option. This will help with the "unused" stuff noted below (compile the BSP itself with this, not merely your application). With only 4K you can pretty much forget about using standard library functions though.

 

-Brian

 

0 Kudos
3 Replies
Xilinx Employee
Xilinx Employee
6,767 Views
Registered: ‎04-23-2008

Re: Removing Unused functions from Assembly Code

Jump to solution

4k is very tiny. Using "-Os" won't be enough (as you have discovered).

Look at the "-ffunction-sections" GCC option. This will help with the "unused" stuff noted below (compile the BSP itself with this, not merely your application). With only 4K you can pretty much forget about using standard library functions though.

 

-Brian

 

0 Kudos
Xilinx Employee
Xilinx Employee
5,341 Views
Registered: ‎04-23-2008

Re: Removing Unused functions from Assembly Code

Jump to solution

You'll also need 

-Wl,-gc-sections

for the linker to take advantage of my previous note.

 

0 Kudos
Visitor mahirztrk
Visitor
5,306 Views
Registered: ‎11-19-2009

Re: Removing Unused functions from Assembly Code

Jump to solution

Thanks brianhill, it worked perfectly.

0 Kudos