This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
RE: LD issue : Problem in NOCROSSREFS overlay check
Alan,
In merging the part of ldcref.c 1.16 that you mention in my
binutils-2.17, it now works fine!
Thanks you for your help
Phil.
-----Original Message-----
From: Alan Modra [mailto:amodra@bigpond.net.au]
Sent: Friday, February 16, 2007 4:24 PM
To: Philippe Vandermersch
Cc: binutils@sourceware.org
Subject: Re: LD issue : Problem in NOCROSSREFS overlay check
On Fri, Feb 16, 2007 at 10:50:37AM -0800, Philippe Vandermersch wrote:
> The cross reference check is done at the section level.
> My object file after a "ld -r" contains multiple sections.
> One local symbol happens to have the same name in two different
sections
> : that should not be a problem.
Agreed. In my last email I was merely pointing out how the "ld -r"
link step uncovered a problem with the cross-reference checks. I
wasn't trying to say that no bug existed.
> What I do not understand is that there is a specific test added in
> check_reloc_refs (ldcref.c) to actually test if 2 locals symbols
> collide.
> If I remove that test, it works.
>
> I just want to know the reason why this test has been added.
I'm not sure which test you mean. There is a test against defsec for
section symbols; That should also happen for local symbols.
* ldcref.c (check_reloc_refs): Compare section for locals.
Index: ld/ldcref.c
===================================================================
RCS file: /cvs/src/src/ld/ldcref.c,v
retrieving revision 1.15
diff -u -p -r1.15 ldcref.c
--- ld/ldcref.c 19 Jul 2006 01:50:23 -0000 1.15
+++ ld/ldcref.c 17 Feb 2007 00:15:12 -0000
@@ -710,11 +710,11 @@ check_reloc_refs (bfd *abfd, asection *s
| BSF_WEAK)) != 0))
|| (!global
&& ((*q->sym_ptr_ptr)->flags & (BSF_LOCAL
- | BSF_SECTION_SYM)) !=
0))
+ | BSF_SECTION_SYM)) !=
0
+ && bfd_get_section (*q->sym_ptr_ptr) == info->defsec))
&& (symname != NULL
? strcmp (bfd_asymbol_name (*q->sym_ptr_ptr), symname) ==
0
- : (((*q->sym_ptr_ptr)->flags & BSF_SECTION_SYM) != 0
- && bfd_get_section (*q->sym_ptr_ptr) == info->defsec)))
+ : ((*q->sym_ptr_ptr)->flags & BSF_SECTION_SYM) != 0))
{
/* We found a reloc for the symbol. The symbol is defined
in OUTSECNAME. This reloc is from a section which is
--
Alan Modra
IBM OzLabs - Linux Technology Centre
-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain
confidential information. Any unauthorized review, use, disclosure or distribution
is prohibited. If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------