arm-elf-gcc - disappearing module header

Nicole Cook cook@maya.com
Wed May 31 13:29:00 GMT 2000


I'm trying to compitle a rommable image for the aeb1C.  The aeb1c has a
bootloader that requires each rommable program to have a module header -
which I have placed in a file called module.c.  This module header is
simply a struct containing static information about the location of the
code, name of module, etc. & is not referenced anywhere else in the
program.  The problem is that this variable disappears when the program
is compiled.  Maybe it gets eliminated because it's never referenced?  I
don't think I have any optimizations turned on - will arm-elf-gcc simply
do this on it's own?  Is there a way to turn it off?

Nicole Cook
PKG_INSTALL_DIR = /home/cook/ecos-work/install

# You must also set XCC to the name of your cross-compiler, including any
# options it needs.

# Uncomment one of the below, or invoke make with the name of the compiler
# you want, e.g.:
#   make XCC="sparclite-elf-gcc -mcpu=sparclite -msoft-float"
# You can also set XCC in your environment

XCC = arm-elf-gcc -mcpu=arm7di                        # AEB

###### VARIABLES
# Any of these can be overriden on the command-line or in your environment

ifeq ($(XCC),sh-elf-gcc)
CFLAGS        = -ggdb
else
CFLAGS        = 
endif

CXXFLAGS      = $(CFLAGS)

EXTRACFLAGS   = -Wall -I$(PKG_INSTALL_DIR)/include -ffunction-sections -fdata-sections

EXTRACXXFLAGS = $(EXTRACFLAGS) -fno-exceptions -fno-rtti -fvtable-gc -finit-priority

LDFLAGS       = -nostartfiles -L$(PKG_INSTALL_DIR)/lib -Wl,--gc-sections
LIBS          = -Ttarget.ld -nostdlib

LD            = $(XCC)
XCXX          = $(XCC)

###### RULES

.PHONY: all clean CCCHECK

all: master

clean:
	-rm -f master *.o core

CCCHECK:
ifeq ($(XCC),)
	@echo You must set XCC to the name of your cross-compiler
	@false
endif


%.o: %.c
	$(XCC) -c -o  $*.o $(CFLAGS) $(EXTRACFLAGS) $<


master:	CCCHECK module.o master.o mascom.o masparser.o 
	$(LD) $(LDFLAGS) -o master module.o master.o mascom.o masparser.o  $(LIBS)







More information about the crossgcc mailing list