- To: "'bug-gnu-utils@gnu.org'" <bug-gnu-utils@gnu.org>
- Subject: srec.c bug in BFD library of binutils 2.9.1
- From: "Schantz, Joel" <Joel.Schantz@ARGOSYS.Boeing.com>
- Date: Mon, 26 Oct 1998 19:12:47 -0700
- Return-Receipt-To: "Schantz, Joel" <Joel.Schantz@ARGOSYS.Boeing.com>
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