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!

AR# 17152

3.1/3.2 EDK - The code size reported with the debug option "Off" is larger than the one with debugging turned "On"

Description

Keywords: GNU, compiler, debug, debugging, -g, code, size

Urgency: Standard

General Description:
The code size reported with the debug option "Off" is larger than the one with debugging
("-g") turned "On."

Below is the log file I get from the XPS log window when I run "compile program" with debug option Off:

"powerpc-eabi-gcc -O0 code/xrom_glenn/xromtests.c code/xrom_glenn/xromabort.c code/xrom_glenn/xromcache.c code/xrom_glenn/xrominput.c code/xrom_glenn/xromlog.c code/xrom_glenn/xromtestram.c code/xrom_glenn/xrom.c -o ppc405_i/code/xrom_glenn.elf \
-Wl,-defsym -Wl,_HEAP_SIZE=0 -Wl,-T -Wl,code/linker_script -I./ppc405_i/include/ -I./ppc405_i/include/ -L./ppc405_i/lib/ -L./ppc405_i/lib/ \

powerpc-eabi-size ppc405_i/code/xrom_glenn.elf
text data bss dec hex filename
16836 3476 1100 21412 53a4 ppc405_i/code/xrom_glenn.elf
Done"

Below is the log file I get from the XPS log window when I run "compile program" with debug option On:

"powerpc-eabi-gcc -O0 code/xrom_glenn/xromtests.c code/xrom_glenn/xromabort.c code/xrom_glenn/xromcache.c code/xrom_glenn/xrominput.c code/xrom_glenn/xromlog.c code/xrom_glenn/xromtestram.c code/xrom_glenn/xrom.c -o ppc405_i/code/xrom_glenn.elf \
-Wl,-defsym -Wl,_HEAP_SIZE=0 -Wl,-T -Wl,code/linker_script -g -I./ppc405_i/include/ -I./ppc405_i/include/ -L./ppc405_i/lib/ -L./ppc405_i/lib/ \

powerpc-eabi-size ppc405_i/code/xrom_glenn.elf
text data bss dec hex filename
16804 3476 1100 21380 5384 ppc405_i/code/xrom_glenn.elf
Done"

Solution

This code increase is due to the introduction of some "nops" by the GCC compiler (version 2.95.2) when compiled without the "-g" option. These nops are added to a location where the stabs (debug information) would have been added if the "-g" option had been used.

This will be resolved when Xilinx supports the GCC compiler version 3.2.
AR# 17152
Date Created 04/25/2003
Last Updated 04/28/2006
Status Archive
Type General Article