This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [RFA:] Fix PR14481 for almost all a.out-targets
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Hans-Peter Nilsson <hans-peter dot nilsson at axis dot com>
- Cc: binutils at sourceware dot org
- Date: Tue, 6 Nov 2012 21:56:15 -0800
- Subject: Re: [RFA:] Fix PR14481 for almost all a.out-targets
- References: <201211070512.qA75CKih028694@ignucius.se.axis.com>
On Tue, Nov 6, 2012 at 9:12 PM, Hans-Peter Nilsson
<hans-peter.nilsson@axis.com> wrote:
>
> and for the other two it's something like:
> ==7197== Source and destination overlap in memcpy(0x40366C0, 0x40366C0, 89)
> ==7197== at 0x40076D9: memcpy (mc_replace_strmem.c:402)
> ==7197== by 0x8088E9C: bfd_get_section_contents (section.c:1549)
> ==7197== by 0x8097734: bfd_get_full_section_contents (compress.c:185)
> ==7197== by 0x80D7742: bfd_generic_get_relocated_section_contents (reloc.c:6809)
> ==7197== by 0x80973E1: bfd_simple_get_relocated_section_contents (simple.c:239)
> ==7197== by 0x804F8C6: load_specific_debug_section (objdump.c:2278)
> ==7197== by 0x804F9DA: dump_dwarf_section (objdump.c:2361)
> ==7197== by 0x808909B: bfd_map_over_sections (section.c:1329)
> ==7197== by 0x804DAEF: dump_dwarf (objdump.c:2411)
> ==7197== by 0x804E14B: dump_bfd (objdump.c:3242)
> ==7197== by 0x804ECD6: display_any_bfd (objdump.c:3329)
> ==7197== by 0x804ED85: display_file (objdump.c:3404)
>
> Those are pretty recent IIRC, at least from this year.
>
I am checking in this.
--
H.J.
---
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 530ef7d..1db65fa 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,10 @@
2012-11-06 H.J. Lu <hongjiu.lu@intel.com>
+ * section.c (bfd_get_section_contents): Replace memcpy
+ with memmove.
+
+2012-11-06 H.J. Lu <hongjiu.lu@intel.com>
+
PR binutils/14813
* bfdio.c (bfd_iovec): Change return type of bclose to
bfd_boolean.
diff --git a/bfd/section.c b/bfd/section.c
index ab5635b..6fd7d8e 100644
--- a/bfd/section.c
+++ b/bfd/section.c
@@ -1546,7 +1546,7 @@ bfd_get_section_contents (bfd *abfd,
return FALSE;
}
- memcpy (location, section->contents + offset, (size_t) count);
+ memmove (location, section->contents + offset, (size_t) count);
return TRUE;
}