Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(87)

Unified Diff: bfd/srec.c

Issue 124383005: GDB 7.6.50 (Closed) Base URL: http://git.chromium.org/native_client/nacl-gdb.git@upstream
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « bfd/sparclinux.c ('k') | bfd/sunos.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bfd/srec.c
diff --git a/bfd/srec.c b/bfd/srec.c
index 6226773387252b3d4e9f5df43e832e5a937e9161..ded9e76ca28992e7d5bfd0ea6aa60c9136e7e09f 100644
--- a/bfd/srec.c
+++ b/bfd/srec.c
@@ -870,6 +870,7 @@ srec_set_section_contents (bfd *abfd,
file_ptr offset,
bfd_size_type bytes_to_do)
{
+ int opb = bfd_octets_per_byte (abfd);
tdata_type *tdata = abfd->tdata.srec_data;
srec_data_list_type *entry;
@@ -892,16 +893,16 @@ srec_set_section_contents (bfd *abfd,
regardless of the siez of the addresses. */
if (S3Forced)
tdata->type = 3;
- else if ((section->lma + offset + bytes_to_do - 1) <= 0xffff)
+ else if ((section->lma + (offset + bytes_to_do) / opb - 1) <= 0xffff)
; /* The default, S1, is OK. */
- else if ((section->lma + offset + bytes_to_do - 1) <= 0xffffff
+ else if ((section->lma + (offset + bytes_to_do) / opb - 1) <= 0xffffff
&& tdata->type <= 2)
tdata->type = 2;
else
tdata->type = 3;
entry->data = data;
- entry->where = section->lma + offset;
+ entry->where = section->lma + offset / opb;
entry->size = bytes_to_do;
/* Sort the records by address. Optimize for the common case of
« no previous file with comments | « bfd/sparclinux.c ('k') | bfd/sunos.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698