This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: __attribute aligned and objcopy


What irked me about this one was that I had the feeling that
surely someone had done this before me, and that it was just
a matter of finding the right incatation to arm-elf-objcopy. :-)



>What I've done in the past is use GCC to get the magic right.  Try 
>looking at packages/hal/arm/edb7xxx/current/misc/long*.h
>These are binary data files which I then pass through GCC.

When I got your e-mail I had started work on a Frankenmake.
Modified rom/support/file2c.tcl attached. 


# some singing and dancing to get an 4 bytes aligned data. 
# raw data
$(OUTPUT)/%.o: %.alignedraw
	echo -- Raw data file $*.alignedraw
	../scripts/myfile2c.tcl $*.alignedraw $(OUTPUT)/$*.txt
	echo >$(OUTPUT)/$*.xxxx "const __attribute__((aligned(4))) char
"
	echo $(OUTPUT)/$* | sed -e 's/\//_/g'  | sed -e 's/\./_/g'
>>$(OUTPUT)/$*.xxxx
	echo []= >>$(OUTPUT)/$*.xxxx
	cat $(OUTPUT)/$*.txt >>$(OUTPUT)/$*.xxxx
	$(XCC) -o $(OUTPUT)/$*.o $(CFLAGS) -c -x c $(OUTPUT)/$*.xxxx

Øyvind

Attachment: myfile2c.tcl
Description: Binary data

-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]