This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [RFC] Fix PR 16910: Relocate symbol correctly if it is wrapped
- From: Alan Modra <amodra at gmail dot com>
- To: Yao Qi <yao at codesourcery dot com>
- Cc: binutils at sourceware dot org
- Date: Wed, 11 Jun 2014 19:32:30 +0930
- Subject: Re: [RFC] Fix PR 16910: Relocate symbol correctly if it is wrapped
- Authentication-results: sourceware.org; auth=none
- References: <1399541408-12698-1-git-send-email-yao at codesourcery dot com> <20140509040512 dot GG5162 at bubble dot grove dot modra dot org> <536C88E2 dot 4000509 at codesourcery dot com> <53964D23 dot 8050101 at mentor dot com> <20140610133632 dot GP5592 at bubble dot grove dot modra dot org> <5397FDC7 dot 8050903 at codesourcery dot com>
On Wed, Jun 11, 2014 at 02:57:11PM +0800, Yao Qi wrote:
> What you meant probably is "l - sizeof WRAP + 1 != h->root.string",
> in order to check whether 'l' is incremented in [1] or not.
Oops, yes. Caught out by last minute changes.
* linker.c (unwrap_hash_lookup): Add missing parens.
diff --git a/bfd/linker.c b/bfd/linker.c
index d00238c..2e21054 100644
--- a/bfd/linker.c
+++ b/bfd/linker.c
@@ -621,7 +621,7 @@ unwrap_hash_lookup (struct bfd_link_info *info,
if (bfd_hash_lookup (info->wrap_hash, l, FALSE, FALSE) != NULL)
{
char save = 0;
- if (l - sizeof WRAP - 1 != h->root.string)
+ if (l - (sizeof WRAP - 1) != h->root.string)
{
--l;
save = *l;
--
Alan Modra
Australia Development Lab, IBM