public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Linker is broken due to _bfd_elf_merge_symbol change
@ 2005-05-04  6:11 H. J. Lu
  2005-05-04  6:13 ` Alan Modra
  2005-05-04  6:18 ` PATCH: " H. J. Lu
  0 siblings, 2 replies; 8+ messages in thread
From: H. J. Lu @ 2005-05-04  6:11 UTC (permalink / raw)
  To: Alan Modra, paul; +Cc: binutils

I got extra libstc++ failures in gcc 3.4 on ia32, ia64 and x86_64:

FAIL: 21_strings/basic_string/append/char/1.cc execution test
FAIL: 21_strings/basic_string/append/wchar_t/1.cc execution test
FAIL: gctest
FAIL: 21_strings/basic_string/cons/char/1.cc execution test
FAIL: 21_strings/basic_string/cons/wchar_t/1.cc execution test
FAIL: 21_strings/basic_string/element_access/char/1.cc execution test
FAIL: 21_strings/basic_string/element_access/wchar_t/1.cc execution
test
FAIL: 21_strings/basic_string/insert/char/1.cc execution test
FAIL: 21_strings/basic_string/insert/wchar_t/1.cc execution test
FAIL: 21_strings/basic_string/substr/char/1.cc execution test
FAIL: 21_strings/basic_string/substr/wchar_t/1.cc execution test
FAIL: 23_containers/bitset/cons/1.cc execution test
FAIL: 23_containers/bitset/cons/6282.cc execution test
FAIL: 23_containers/bitset/test/1.cc execution test
FAIL: 23_containers/vector/capacity/8230.cc execution test
FAIL: 23_containers/vector/element_access/1.cc execution test

due to

http://sourceware.org/ml/binutils/2005-05/msg00018.html

I will revert it if it is't fixed soon.


H.J.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Linker is broken due to _bfd_elf_merge_symbol change
  2005-05-04  6:11 Linker is broken due to _bfd_elf_merge_symbol change H. J. Lu
@ 2005-05-04  6:13 ` Alan Modra
  2005-05-04  6:24   ` H. J. Lu
  2005-05-04  6:18 ` PATCH: " H. J. Lu
  1 sibling, 1 reply; 8+ messages in thread
From: Alan Modra @ 2005-05-04  6:13 UTC (permalink / raw)
  To: H. J. Lu; +Cc: paul, binutils

On Tue, May 03, 2005 at 10:43:23PM -0700, H. J. Lu wrote:
> http://sourceware.org/ml/binutils/2005-05/msg00018.html
> 
> I will revert it if it is't fixed soon.

Not without explaining why the patch causes a problem.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

^ permalink raw reply	[flat|nested] 8+ messages in thread

* PATCH: Linker is broken due to _bfd_elf_merge_symbol change
  2005-05-04  6:11 Linker is broken due to _bfd_elf_merge_symbol change H. J. Lu
  2005-05-04  6:13 ` Alan Modra
@ 2005-05-04  6:18 ` H. J. Lu
  2005-05-04  8:06   ` Alan Modra
  2005-05-04 13:10   ` Paul Brook
  1 sibling, 2 replies; 8+ messages in thread
From: H. J. Lu @ 2005-05-04  6:18 UTC (permalink / raw)
  To: Alan Modra, paul; +Cc: binutils

On Tue, May 03, 2005 at 10:43:23PM -0700, H. J. Lu wrote:
> I got extra libstc++ failures in gcc 3.4 on ia32, ia64 and x86_64:
> 
> FAIL: 21_strings/basic_string/append/char/1.cc execution test
> FAIL: 21_strings/basic_string/append/wchar_t/1.cc execution test
> FAIL: gctest
> FAIL: 21_strings/basic_string/cons/char/1.cc execution test
> FAIL: 21_strings/basic_string/cons/wchar_t/1.cc execution test
> FAIL: 21_strings/basic_string/element_access/char/1.cc execution test
> FAIL: 21_strings/basic_string/element_access/wchar_t/1.cc execution
> test
> FAIL: 21_strings/basic_string/insert/char/1.cc execution test
> FAIL: 21_strings/basic_string/insert/wchar_t/1.cc execution test
> FAIL: 21_strings/basic_string/substr/char/1.cc execution test
> FAIL: 21_strings/basic_string/substr/wchar_t/1.cc execution test
> FAIL: 23_containers/bitset/cons/1.cc execution test
> FAIL: 23_containers/bitset/cons/6282.cc execution test
> FAIL: 23_containers/bitset/test/1.cc execution test
> FAIL: 23_containers/vector/capacity/8230.cc execution test
> FAIL: 23_containers/vector/element_access/1.cc execution test
> 
> due to
> 
> http://sourceware.org/ml/binutils/2005-05/msg00018.html
> 
> I will revert it if it is't fixed soon.
> 

This patch seems to work. Paul, I tried your testcase. It looks OK:

gnu-10:pts/3[86]> gcc x.o y.o -B/export/build/gnu/binutils-import/build-i686-linux/ld/
gnu-10:pts/3[82]> readelf -s x.o | grep foo
     7: 00000000     5 FUNC    GLOBAL DEFAULT    1 foo
gnu-10:pts/3[83]> readelf -s y.o | grep foo
     8: 00000000    40 FUNC    WEAK   DEFAULT    1 foo
gnu-10:pts/3[84]> readelf -s a.out| grep foo
    60: 08048368     5 FUNC    GLOBAL DEFAULT   12 foo

Paul, could you please provide a patch of a simple testcase for your
problem?


H.J.
----
2005-05-03  H.J. Lu  <hongjiu.lu@intel.com>

	* elflink.c (_bfd_elf_merge_symbol): Only skip weak definitions
	at the end, if a strong definition has already been seen.

--- bfd/elflink.c.weak	2005-05-02 08:34:48.000000000 -0700
+++ bfd/elflink.c	2005-05-03 22:47:58.000000000 -0700
@@ -1078,13 +1078,6 @@ _bfd_elf_merge_symbol (bfd *abfd,
       || h->root.type == bfd_link_hash_undefined)
     *size_change_ok = TRUE;
 
-  /* Skip weak definitions of symbols that are already defined.  */
-  if (newdef && olddef && newweak && !oldweak)
-    {
-      *skip = TRUE;
-      return TRUE;
-    }
-
   /* NEWDYNCOMMON and OLDDYNCOMMON indicate whether the new or old
      symbol, respectively, appears to be a common symbol in a dynamic
      object.  If a symbol appears in an uninitialized section, and is
@@ -1211,6 +1204,10 @@ _bfd_elf_merge_symbol (bfd *abfd,
       *size_change_ok = TRUE;
     }
 
+  /* Skip weak definitions of symbols that are already defined.  */
+  if (newdef && olddef && newweak && !oldweak)
+    *skip = TRUE;
+
   /* If the old symbol is from a dynamic object, and the new symbol is
      a definition which is not from a dynamic object, then the new
      symbol overrides the old symbol.  Symbols from regular files

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Linker is broken due to _bfd_elf_merge_symbol change
  2005-05-04  6:13 ` Alan Modra
@ 2005-05-04  6:24   ` H. J. Lu
  0 siblings, 0 replies; 8+ messages in thread
From: H. J. Lu @ 2005-05-04  6:24 UTC (permalink / raw)
  To: paul, binutils

On Wed, May 04, 2005 at 03:41:34PM +0930, Alan Modra wrote:
> On Tue, May 03, 2005 at 10:43:23PM -0700, H. J. Lu wrote:
> > http://sourceware.org/ml/binutils/2005-05/msg00018.html
> > 
> > I will revert it if it is't fixed soon.
> 
> Not without explaining why the patch causes a problem.
> 

If you take a look at _bfd_elf_merge_symbol, newdef and olddef can
change after:

  /* Skip weak definitions of symbols that are already defined.  */
  if (newdef && olddef && newweak && !oldweak)
    {
      *skip = TRUE;
      return TRUE;
    }

That is the wrong place to check them. My patch:

http://sourceware.org/ml/binutils/2005-05/msg00089.html

moved it after all changes of newdef and olddef.


H.J.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: PATCH: Linker is broken due to _bfd_elf_merge_symbol change
  2005-05-04  6:18 ` PATCH: " H. J. Lu
@ 2005-05-04  8:06   ` Alan Modra
  2005-05-04 13:10   ` Paul Brook
  1 sibling, 0 replies; 8+ messages in thread
From: Alan Modra @ 2005-05-04  8:06 UTC (permalink / raw)
  To: H. J. Lu; +Cc: paul, binutils

On Tue, May 03, 2005 at 11:13:02PM -0700, H. J. Lu wrote:
> 	* elflink.c (_bfd_elf_merge_symbol): Only skip weak definitions
> 	at the end, if a strong definition has already been seen.

I think this is OK.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: PATCH: Linker is broken due to _bfd_elf_merge_symbol change
  2005-05-04  6:18 ` PATCH: " H. J. Lu
  2005-05-04  8:06   ` Alan Modra
@ 2005-05-04 13:10   ` Paul Brook
  2005-05-04 13:23     ` H. J. Lu
  1 sibling, 1 reply; 8+ messages in thread
From: Paul Brook @ 2005-05-04 13:10 UTC (permalink / raw)
  To: binutils; +Cc: H. J. Lu, Alan Modra

> H.J.
> ----
> 2005-05-03  H.J. Lu  <hongjiu.lu@intel.com>
>
> 	* elflink.c (_bfd_elf_merge_symbol): Only skip weak definitions
> 	at the end, if a strong definition has already been seen.
>
> --- bfd/elflink.c.weak	2005-05-02 08:34:48.000000000 -0700
> +++ bfd/elflink.c	2005-05-03 22:47:58.000000000 -0700
> @@ -1078,13 +1078,6 @@ _bfd_elf_merge_symbol (bfd *abfd,
>
>        || h->root.type == bfd_link_hash_undefined)
>
>      *size_change_ok = TRUE;
>
> -  /* Skip weak definitions of symbols that are already defined.  */
> -  if (newdef && olddef && newweak && !oldweak)
> -    {
> -      *skip = TRUE;
> -      return TRUE;
> -    }
> -
>    /* NEWDYNCOMMON and OLDDYNCOMMON indicate whether the new or old
>       symbol, respectively, appears to be a common symbol in a dynamic
>       object.  If a symbol appears in an uninitialized section, and is
> @@ -1211,6 +1204,10 @@ _bfd_elf_merge_symbol (bfd *abfd,
>        *size_change_ok = TRUE;
>      }
>
> +  /* Skip weak definitions of symbols that are already defined.  */
> +  if (newdef && olddef && newweak && !oldweak)
> +    *skip = TRUE;

Shouldn't this also return TRUE?

Paul

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: PATCH: Linker is broken due to _bfd_elf_merge_symbol change
  2005-05-04 13:10   ` Paul Brook
@ 2005-05-04 13:23     ` H. J. Lu
  2005-05-05  2:37       ` Alan Modra
  0 siblings, 1 reply; 8+ messages in thread
From: H. J. Lu @ 2005-05-04 13:23 UTC (permalink / raw)
  To: Paul Brook; +Cc: binutils, Alan Modra

On Wed, May 04, 2005 at 02:08:03PM +0100, Paul Brook wrote:
> > H.J.
> > ----
> > 2005-05-03  H.J. Lu  <hongjiu.lu@intel.com>
> >
> > 	* elflink.c (_bfd_elf_merge_symbol): Only skip weak definitions
> > 	at the end, if a strong definition has already been seen.
> >
> > --- bfd/elflink.c.weak	2005-05-02 08:34:48.000000000 -0700
> > +++ bfd/elflink.c	2005-05-03 22:47:58.000000000 -0700
> > @@ -1078,13 +1078,6 @@ _bfd_elf_merge_symbol (bfd *abfd,
> >
> >        || h->root.type == bfd_link_hash_undefined)
> >
> >      *size_change_ok = TRUE;
> >
> > -  /* Skip weak definitions of symbols that are already defined.  */
> > -  if (newdef && olddef && newweak && !oldweak)
> > -    {
> > -      *skip = TRUE;
> > -      return TRUE;
> > -    }
> > -
> >    /* NEWDYNCOMMON and OLDDYNCOMMON indicate whether the new or old
> >       symbol, respectively, appears to be a common symbol in a dynamic
> >       object.  If a symbol appears in an uninitialized section, and is
> > @@ -1211,6 +1204,10 @@ _bfd_elf_merge_symbol (bfd *abfd,
> >        *size_change_ok = TRUE;
> >      }
> >
> > +  /* Skip weak definitions of symbols that are already defined.  */
> > +  if (newdef && olddef && newweak && !oldweak)
> > +    *skip = TRUE;
> 
> Shouldn't this also return TRUE?
> 

Not if flip != NULL.


H.J.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: PATCH: Linker is broken due to _bfd_elf_merge_symbol change
  2005-05-04 13:23     ` H. J. Lu
@ 2005-05-05  2:37       ` Alan Modra
  0 siblings, 0 replies; 8+ messages in thread
From: Alan Modra @ 2005-05-05  2:37 UTC (permalink / raw)
  To: H. J. Lu; +Cc: Paul Brook, binutils

On Wed, May 04, 2005 at 06:10:02AM -0700, H. J. Lu wrote:
> On Wed, May 04, 2005 at 02:08:03PM +0100, Paul Brook wrote:
> > > +  /* Skip weak definitions of symbols that are already defined.  */
> > > +  if (newdef && olddef && newweak && !oldweak)
> > > +    *skip = TRUE;
> > 
> > Shouldn't this also return TRUE?
> 
> Not if flip != NULL.

Actually, the two conditions are mutually exclusive.  Since the flip
block is the last one in the function, I don't think it matters one way
or another.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2005-05-05  2:02 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-04  6:11 Linker is broken due to _bfd_elf_merge_symbol change H. J. Lu
2005-05-04  6:13 ` Alan Modra
2005-05-04  6:24   ` H. J. Lu
2005-05-04  6:18 ` PATCH: " H. J. Lu
2005-05-04  8:06   ` Alan Modra
2005-05-04 13:10   ` Paul Brook
2005-05-04 13:23     ` H. J. Lu
2005-05-05  2:37       ` Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).