large bss size for sample applications

Jeff Webb jeff.webb at
Tue Sep 22 22:27:51 UTC 2015

I am new to RTEMS, and I am interested in getting a an ARM-based development system up an running.  Ultimately, I would like to use RTEMS on a Zynq-based board with no external RAM.  Is it possible to do anything useful in a few hundred kilobytes of RAM on the Zynq platform?  The sample applications I have generated have very large bss sizes that do not seem to be in line with the reported values for other platforms that I have found in web searches.

I found an excellent tutorial [1] (thanks!) for getting started with RTEMS on the Raspberry Pi.  I followed the instructions and successfully built and ran the ticker.exe sample application on the Pi.  I was curious about the memory usage, so I attempted to determine how much memory this application required.

   $ arm-rtems4.11-size  ticker.exe
    text	   data	    bss	    dec	    hex	filename
   94196	   1692	134077844	134173732	7ff5424	ticker.exe

The executable size is 3.1M, which is reduced to 95K after running arm-rtems4.11-strip on it.

When I used objcopy to create an image for copying to the raspberry pi SD card, the resulting image was 999K:

   $ arm-rtems4.11-objcopy -Obinary ticker.exe ticker.img

Since I had success with the Pi, I decided to try the Zedboard.  I successfully got the ticker application built using this configure command:

../rtems-git/configure --target=arm-rtems4.11 \
--enable-rtemsbsp=xilinx_zynq_zedboard \
--enable-tests=samples \
--enable-networking \
--enable-posix \
--prefix=/opt/rtems/bsps/4.11 BSP_ARM_A9MPCORE_PERIPHCLK=333333333U

The bss size of the resulting executable was also large:

   $ arm-rtems4.11-size  ticker_zed.exe
    text	   data	    bss	    dec	    hex	filename
   72588	   1780	535731528	535805896	1fefbfc8	ticker_zed.exe

   $ ls -lh ticker_zed*
   3.2M Sep 22 17:16 ticker_zed.exe
   74K Sep 22 17:18 ticker_zed_stripped.exe

I tried shrinking the memory map for the zedboard using various techniques, but it looks like I'm running out of memory.  One technique I attempted was to add something like "BSP_ZYNQ_RAM_LENGTH=1536K BSP_ZYNQ_NOCACHE_LENGTH=128K" to the configure command, which would yield an error message like this:

arm-rtems4.11-gcc -B../../../../../xilinx_zynq_zedboard/lib/ -specs bsp_specs -qrtems -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard -mtune=cortex-a9 -O2 -g -Wall -Wmissing-prototypes -Wimplicit-function-declaration -Wstrict-prototypes -Wnested-externs    -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard -mtune=cortex-a9   -o hello.exe init.o
linkcmds.base:383 cannot move location counter backwards (from 0000000000203c34 to 0000000000160000)

Can anyone point me in the right direction?




More information about the users mailing list