<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1170" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=046243507-28072003><FONT face=Arial size=2>I am trying to
convert elf to coff using 'avr-objcopy' with the usual standard makefiles that
comes with the en-nut OS. But the sections it produces are not sequential. In
particular, the .data section does not come immediately after the .text section
and this causes havoc in debugging with JTAG-ICE as the data section is not
correctly copied to memory. The following is a log of
events:</FONT></SPAN></DIV><SPAN class=046243507-28072003>
<DIV><BR><FONT face=Arial size=2>F:\scanv\nut-3.2.1-sn\app\timers>make
clean<BR>rm -f timers.o<BR>rm -f *.aps *.elf *.cof<BR>rm -f timers.hex<BR>rm -f
timers.eep<BR>rm -f timers.obj<BR>rm -f timers.map<BR>rm -f timers.lst<BR>rm -f
timers.bak</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>F:\scanv\nut-3.2.1-sn\app\timers>make<BR>avr-gcc
-c -g -mmcu=atmega128 -O0 -Wall -Wstrict-prototypes
-Wa,-ahlms=timers.ls<BR>t -I../../mod/include -I../../include timers.c -o
timers.o<BR>timers.c:316:2: warning: no newline at end of file<BR>avr-gcc
timers.o -g -mmcu=atmega128 -Wl,--defsym=main=0,-Map=timers.map,--cref
-<BR>L../../lib/gcc/atmega128 ../../lib/gcc/atmega128/nutinit.o -lnutos -lnutdev
-lnu<BR>tcrt -o timers.elf<BR>avr-objcopy -O ihex timers.elf
timers.hex</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>F:\scanv\nut-3.2.1-sn\app\timers>make
coff<BR>avr-objcopy --debugging --change-section-address .data-0x800000
--change-section<BR>-address .bss-0x800000 --change-section-address
.noinit-0x800000 --change-sectio<BR>n-address .eeprom-0x810000 -O coff-avr
timers.elf timers.cof<BR>Discarding local symbol outside any compilation unit:
.__do_copy_data_start<BR>Discarding local symbol outside any compilation unit:
.__do_copy_data_loop</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>F:\scanv\nut-3.2.1-sn\app\timers>avr-objdump -h
timers.elf</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>timers.elf: file format
elf32-avr</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Sections:<BR>Idx
Name
Size VMA
LMA File off Algn<BR> 0
.data 000001ec
00800100 00004c0c 00004ca0
2**0<BR>
CONTENTS, ALLOC, LOAD, DATA<BR> 1
.text 00004c0c
00000000 00000000 00000094
2**0<BR>
CONTENTS, ALLOC, LOAD, READONLY, CODE<BR> 2
.bss 0000026a
008002ec 008002ec 00004e8c
2**0<BR>
ALLOC<BR> 3 .noinit 00000000
00800556 00800556 00004e8c
2**0<BR>
CONTENTS<BR> 4 .eeprom 00000000
00810000 00810000 00004e8c
2**0<BR>
CONTENTS<BR> 5 .stab
0000963c 00000000 00000000 00004e8c
2**2<BR>
CONTENTS, READONLY, DEBUGGING<BR> 6 .stabstr
000037c1 00000000 00000000 0000e4c8
2**0<BR>
CONTENTS, READONLY, DEBUGGING</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>F:\scanv\nut-3.2.1-sn\app\timers>avr-objdump -h
timers.cof</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>timers.cof: file format
coff-avr</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Sections:<BR>Idx
Name
Size VMA
LMA File off Algn<BR> 0
.data 000001ec
00000100 00000100 000000dc
2**2<BR>
CONTENTS, ALLOC, LOAD, DATA<BR> 1
.text 00004c0c
00000000 00000000 000002c8
2**2<BR>
CONTENTS, ALLOC, LOAD, CODE<BR> 2
.bss 0000026a
000002ec 000002ec 00000000
2**2<BR>
ALLOC<BR> 3 .noinit 00000000
00000556 00000556 00000000
2**2<BR>
ALLOC, LOAD<BR> 4 .eeprom
00000000 00000000 00000000 00000000
2**2<BR>
ALLOC, LOAD</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>F:\scanv\nut-3.2.1-sn\app\timers></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial><FONT size=2>H<SPAN class=046243507-28072003>ere the data
section starts at LMA 00000100 instead of 00004c0c</SPAN></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT size=2><SPAN
class=046243507-28072003></SPAN></FONT></FONT> </DIV>
<DIV><FONT face=Arial><FONT size=2><SPAN class=046243507-28072003>Can anyone
help me out here?</SPAN></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT size=2><SPAN
class=046243507-28072003></SPAN></FONT></FONT> </DIV>
<DIV><FONT face=Arial><FONT size=2><SPAN
class=046243507-28072003>Thanks,</SPAN></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT size=2><SPAN
class=046243507-28072003></SPAN></FONT></FONT> </DIV>
<DIV><FONT face=Arial><FONT size=2><SPAN
class=046243507-28072003></SPAN></FONT></FONT></SPAN> </DIV>
<P><FONT size=2>=========================================<BR>Michael
Hallak-Stamler, MSEE<BR>General Manager, MHS
Engineering<BR>email: <<A
href="mailto:michael@mhseng.com">mailto:michael@mhseng.com</A>><BR>web
site: <<A href="http://www.mhseng.com/"
target=_blank>http://www.mhseng.com</A>><BR>tel:
+972-67-662-394<BR> </FONT> </P>
<DIV> </DIV></BODY></HTML>