From ede76260a7201121e1dbed3a14e280bd3aa8c459 Mon Sep 17 00:00:00 2001 From: Hans-Peter Nilsson Date: Thu, 13 Nov 2008 10:57:00 +0000 Subject: [PATCH] * nm.c (filter_symbols): Only call memcpy when from != to. --- binutils/ChangeLog | 5 +++++ binutils/nm.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 587a60df507..414fa467926 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,8 @@ +2008-11-13 Hans-Peter Nilsson + Alan Modra + + * nm.c (filter_symbols): Only call memcpy when from != to. + 2008-11-10 Tristan Gingold Alan Modra diff --git a/binutils/nm.c b/binutils/nm.c index 1dbf47e84a9..e11568ab33d 100644 --- a/binutils/nm.c +++ b/binutils/nm.c @@ -449,7 +449,8 @@ filter_symbols (bfd *abfd, bfd_boolean dynamic, void *minisyms, if (keep) { - memcpy (to, from, size); + if (to != from) + memcpy (to, from, size); to += size; } } -- 2.30.2