This is the mail archive of the crossgcc@cygnus.com mailing list for the crossgcc project.


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

RE: S-Record Format


Some time back I had the same problem.
I found a bug that was in (binutils2.9.1) that gave me problems getting S2
records even though my memory map was < 0xFFFFFF

I think this fix was put in for the next release of binutils (I think I saw
it in the developers source)

see attached copy of my patch

 <<srec.c bug in BFD library of binutils 2.9.1>> 


Hope this helps

> 		Hi,
> 
> 		Is it possible to force a particular type of S-Record type
> with gcc? My system-board monitor only seems to recognize S2 type data
> records.
> 
> 		Cheers
> 
> 		Mick Rothermel
> 		Edinburgh University
> 		mgr@ee.ed.ac.uk
> 
> 


I believe I've discovered a bug in the BFD lib routine srec.c during the
generation of SRecords using objcopy
The code incorrectly generates S3 type records for 24 bit addressed code
This will to occur when there is more than one section of memory with a 24
bit address

The problem was observed using 
objcopy -I coff-m68k -O srec file.exe file.out

==========================================================================
--version	=	GNU objcopy 2.9.1  (binutils2.9.1)
MACHTYPE	=	i686-pc-cygwin32
OSTYPE	=	cygwin32

the diffs for My fix in 
function:	srec_set_section_contents 
file:		bfd/srec.c
==========================================================================
diff -c srec.c srec.c.new
*** srec.c      Fri May 01 09:48:15 1998
--- srec.c.new  Mon Oct 26 17:40:21 1998
***************
*** 865,871 ****

        }
        else if ((section->lma + offset + bytes_to_do - 1) <= 0xffffff
!              && tdata->type < 2)
        {
          tdata->type = 2;
        }
--- 865,871 ----

        }
        else if ((section->lma + offset + bytes_to_do - 1) <= 0xffffff
!              && tdata->type <= 2)
        {
          tdata->type = 2;
        }

==========================================================================

#	link command file used to build file.exe
#
 STARTUP(pmp_powerup.obj)
 ENTRY(PMP_POWERUP)

 MEMORY 
 { 
 low_ram (RW)	: ORIGIN = 0x000800, LENGTH = 64K-0x800 
 high_ram (RW)	: ORIGIN = 0x010800, LENGTH = 64K-0x800 
 prom (R)	: ORIGIN = 0xE00000, LENGTH = 256K	
 sm_ram (RW)	: ORIGIN = 0xE40000, LENGTH = 1M-256K-64K 
 eeprom (RW)	: ORIGIN = 0xEF0000, LENGTH = 64K	
 } 
 
 SECTIONS 
 {
 .dma_ram	(NOLOAD):	{ *("11") } 	> low_ram
 .lowmem_code 	0x2000	:  	{ *("9" .text)}	> low_ram
 .highmem_code 		:	{ *("7" "2") }	> high_ram 
 .highmem_constants 	:  	{ *("8") }	> high_ram 
 .strings 		:	{ *("14" .data)}> sm_ram 
 .variables 	(NOLOAD): 	{*("13" "12" )}	> sm_ram 
 .bss BLOCK(0x4) 	: 	{*(.bss COMMON)}> sm_ram
 .stab 		(NOLOAD): 	{ *(.stab .stabstr) }	> sm_ram 
 .eeprom 	(NOLOAD): 	{ *("15") }	> eeprom
 }



Joel C. Schantz
ArgoSystems, Inc.
Po Box 3452
Sunnyvale, Ca. 94088
Ph 408-737-1000 x 5216



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