projects
/
deliverable
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
(_bfd_elf_slurp_version_tables): Correct reading of version
[deliverable/binutils-gdb.git]
/
bfd
/
srec.c
diff --git
a/bfd/srec.c
b/bfd/srec.c
index 3b1e0e73d2aac15d1eb0ccd8fce0616546fad556..31f69b04cf0cc303f766724e4d7668730be840c5 100644
(file)
--- a/
bfd/srec.c
+++ b/
bfd/srec.c
@@
-1,5
+1,5
@@
/* BFD back-end for s-record objects.
/* BFD back-end for s-record objects.
- Copyright 1990, 91, 92, 93, 94, 95, 96, 97,
1998
+ Copyright 1990, 91, 92, 93, 94, 95, 96, 97,
98, 1999
Free Software Foundation, Inc.
Written by Steve Chamberlain of Cygnus Support <sac@cygnus.com>.
Free Software Foundation, Inc.
Written by Steve Chamberlain of Cygnus Support <sac@cygnus.com>.
@@
-171,7
+171,7
@@
srec_init ()
/* The maximum number of bytes on a line is FF */
#define MAXCHUNK 0xff
/* The number of bytes we fit onto a line on output */
/* The maximum number of bytes on a line is FF */
#define MAXCHUNK 0xff
/* The number of bytes we fit onto a line on output */
-#define CHUNK
21
+#define CHUNK
16
/* When writing an S-record file, the S-records can not be output as
they are seen. This structure is used to hold them in memory. */
/* When writing an S-record file, the S-records can not be output as
they are seen. This structure is used to hold them in memory. */
@@
-387,7
+387,7
@@
srec_scan (abfd)
&& (c == ' ' || c == '\t'))
;
&& (c == ' ' || c == '\t'))
;
- if (c == '\n')
+ if (c == '\n'
|| c == '\r'
)
break;
if (c == EOF)
break;
if (c == EOF)
@@
-469,14
+469,14
@@
srec_scan (abfd)
}
while (c == ' ' || c == '\t');
}
while (c == ' ' || c == '\t');
- if (c != '\n')
+ if (c == '\n')
+ ++lineno;
+ else if (c != '\r')
{
srec_bad_byte (abfd, lineno, c, error);
goto error_return;
}
{
srec_bad_byte (abfd, lineno, c, error);
goto error_return;
}
- ++lineno;
-
break;
case 'S':
break;
case 'S':
@@
-643,6
+643,9
@@
srec_object_p (abfd)
|| ! srec_scan (abfd))
return NULL;
|| ! srec_scan (abfd))
return NULL;
+ if (abfd->symcount > 0)
+ abfd->flags |= HAS_SYMS;
+
return abfd->xvec;
}
return abfd->xvec;
}
@@
-670,6
+673,9
@@
symbolsrec_object_p (abfd)
|| ! srec_scan (abfd))
return NULL;
|| ! srec_scan (abfd))
return NULL;
+ if (abfd->symcount > 0)
+ abfd->flags |= HAS_SYMS;
+
return abfd->xvec;
}
return abfd->xvec;
}
@@
-865,7
+871,7
@@
srec_set_section_contents (abfd, section, location, offset, bytes_to_do)
}
else if ((section->lma + offset + bytes_to_do - 1) <= 0xffffff
}
else if ((section->lma + offset + bytes_to_do - 1) <= 0xffffff
- && tdata->type < 2)
+ && tdata->type <
=
2)
{
tdata->type = 2;
}
{
tdata->type = 2;
}
@@
-994,31
+1000,28
@@
srec_write_section (abfd, tdata, list)
tdata_type *tdata;
srec_data_list_type *list;
{
tdata_type *tdata;
srec_data_list_type *list;
{
- unsigned int
byte
s_written = 0;
+ unsigned int
octet
s_written = 0;
bfd_byte *location = list->data;
bfd_byte *location = list->data;
- while (
byte
s_written < list->size)
+ while (
octet
s_written < list->size)
{
bfd_vma address;
{
bfd_vma address;
+ unsigned int octets_this_chunk = list->size - octets_written;
- unsigned int bytes_this_chunk = list->size - bytes_written;
+ if (octets_this_chunk > CHUNK)
+ octets_this_chunk = CHUNK;
- if (bytes_this_chunk > CHUNK)
- {
- bytes_this_chunk = CHUNK;
- }
-
- address = list->where + bytes_written;
+ address = list->where + octets_written / bfd_octets_per_byte (abfd);
if (! srec_write_record (abfd,
tdata->type,
address,
location,
if (! srec_write_record (abfd,
tdata->type,
address,
location,
- location +
byte
s_this_chunk))
+ location +
octet
s_this_chunk))
return false;
return false;
-
bytes_written += byte
s_this_chunk;
- location +=
byte
s_this_chunk;
+
octets_written += octet
s_this_chunk;
+ location +=
octet
s_this_chunk;
}
return true;
}
return true;
@@
-1059,7
+1062,8
@@
srec_write_symbols (abfd)
for (i = 0; i < count; i++)
{
asymbol *s = table[i];
for (i = 0; i < count; i++)
{
asymbol *s = table[i];
- if (! bfd_is_local_label (abfd, s))
+ if (! bfd_is_local_label (abfd, s)
+ && (s->flags & BSF_DEBUGGING) == 0)
{
/* Just dump out non debug symbols */
bfd_size_type l;
{
/* Just dump out non debug symbols */
bfd_size_type l;
@@
-1132,8
+1136,8
@@
symbolsrec_write_object_contents (abfd)
/*ARGSUSED*/
static int
srec_sizeof_headers (abfd, exec)
/*ARGSUSED*/
static int
srec_sizeof_headers (abfd, exec)
- bfd *abfd;
- boolean exec;
+ bfd *abfd
ATTRIBUTE_UNUSED
;
+ boolean exec
ATTRIBUTE_UNUSED
;
{
return 0;
}
{
return 0;
}
@@
-1202,7
+1206,7
@@
srec_get_symtab (abfd, alocation)
/*ARGSUSED*/
static void
srec_get_symbol_info (ignore_abfd, symbol, ret)
/*ARGSUSED*/
static void
srec_get_symbol_info (ignore_abfd, symbol, ret)
- bfd *ignore_abfd;
+ bfd *ignore_abfd
ATTRIBUTE_UNUSED
;
asymbol *symbol;
symbol_info *ret;
{
asymbol *symbol;
symbol_info *ret;
{
@@
-1212,7
+1216,7
@@
srec_get_symbol_info (ignore_abfd, symbol, ret)
/*ARGSUSED*/
static void
srec_print_symbol (ignore_abfd, afile, symbol, how)
/*ARGSUSED*/
static void
srec_print_symbol (ignore_abfd, afile, symbol, how)
- bfd *ignore_abfd;
+ bfd *ignore_abfd
ATTRIBUTE_UNUSED
;
PTR afile;
asymbol *symbol;
bfd_print_symbol_type how;
PTR afile;
asymbol *symbol;
bfd_print_symbol_type how;
@@
-1255,6
+1259,7
@@
srec_print_symbol (ignore_abfd, afile, symbol, how)
#define srec_bfd_get_relocated_section_contents \
bfd_generic_get_relocated_section_contents
#define srec_bfd_relax_section bfd_generic_relax_section
#define srec_bfd_get_relocated_section_contents \
bfd_generic_get_relocated_section_contents
#define srec_bfd_relax_section bfd_generic_relax_section
+#define srec_bfd_gc_sections bfd_generic_gc_sections
#define srec_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
#define srec_bfd_link_add_symbols _bfd_generic_link_add_symbols
#define srec_bfd_final_link _bfd_generic_final_link
#define srec_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
#define srec_bfd_link_add_symbols _bfd_generic_link_add_symbols
#define srec_bfd_final_link _bfd_generic_final_link
@@
-1310,6
+1315,8
@@
const bfd_target srec_vec =
BFD_JUMP_TABLE_LINK (srec),
BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
BFD_JUMP_TABLE_LINK (srec),
BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
+ NULL,
+
(PTR) 0
};
(PTR) 0
};
@@
-1365,5
+1372,7
@@
const bfd_target symbolsrec_vec =
BFD_JUMP_TABLE_LINK (srec),
BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
BFD_JUMP_TABLE_LINK (srec),
BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
+ NULL,
+
(PTR) 0
};
(PTR) 0
};
This page took
0.026786 seconds
and
4
git commands to generate.