public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* Symbol redefinition bugs
@ 2005-11-18 19:19 Andreas Schwab
  2005-11-20 12:46 ` Jeff Bailey
  0 siblings, 1 reply; 6+ messages in thread
From: Andreas Schwab @ 2005-11-18 19:19 UTC (permalink / raw)
  To: libc-hacker

The current binutils revealed some symbol redefinition bugs in the
ppc/ppc64 port.

Andreas.

2005-11-18  Andreas Schwab  <schwab@suse.de>

	* sysdeps/powerpc/powerpc32/fpu/s_lround.S: Remove useless alias.

	* sysdeps/unix/sysv/linux/powerpc/powerpc32/socket.S: Handle
	NO_WEAK_ALIAS.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/socket.S: Likewise.

--- libc/sysdeps/powerpc/powerpc32/fpu/s_lround.S.~1.4.~	2005-06-20 11:05:09.000000000 +0200
+++ libc/sysdeps/powerpc/powerpc32/fpu/s_lround.S	2005-11-18 19:24:09.000000000 +0100
@@ -79,7 +79,6 @@ ENTRY (__lround)
 	b	.L9
 	END (__lround)
 
-strong_alias (__lround, __lround)
 weak_alias (__lround, lround)
 
 strong_alias (__lround, __lroundf)
--- libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/socket.S.~1.4.~	2005-06-20 11:05:20.000000000 +0200
+++ libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/socket.S	2005-11-18 18:25:51.000000000 +0100
@@ -44,7 +44,11 @@
 #define stackblock 20
 
 #ifndef __socket
-#define __socket P(__,socket)
+# ifndef NO_WEAK_ALIAS
+#  define __socket P(__,socket)
+# else
+#  define __socket socket
+# endif
 #endif
 
 	.text
@@ -114,4 +118,6 @@ ENTRY(__socket)
 
 PSEUDO_END (__socket)
 
+#ifndef NO_WEAK_ALIAS
 weak_alias (__socket, socket)
+#endif
--- libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/socket.S.~1.5.~	2005-01-10 10:41:04.000000000 +0100
+++ libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/socket.S	2005-11-18 19:10:23.000000000 +0100
@@ -41,12 +41,12 @@
 
 #define stackblock 80 /* offset to socket parm area.  */
 
-#ifndef socket
-/* If this is just socket.S leave it alone! */
-#else
 #ifndef __socket
-#define __socket P(__,socket)
-#endif
+# ifndef NO_WEAK_ALIAS
+#  define __socket P(__,socket)
+# else
+#  define __socket socket
+# endif
 #endif
 
 	.text
@@ -120,4 +120,6 @@ ENTRY(__socket)
 	cfi_endproc
 PSEUDO_END (__socket)
 
+#ifndef NO_WEAK_ALIAS
 weak_alias (__socket, socket)
+#endif

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

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

* Re: Symbol redefinition bugs
  2005-11-18 19:19 Symbol redefinition bugs Andreas Schwab
@ 2005-11-20 12:46 ` Jeff Bailey
  2005-11-20 14:38   ` Andreas Schwab
  2005-11-21 21:01   ` Roland McGrath
  0 siblings, 2 replies; 6+ messages in thread
From: Jeff Bailey @ 2005-11-20 12:46 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: libc-hacker

On ven, 2005-11-18 at 20:19 +0100, Andreas Schwab wrote:
> The current binutils revealed some symbol redefinition bugs in the
> ppc/ppc64 port.
> 
> Andreas.
> 
> 2005-11-18  Andreas Schwab  <schwab@suse.de>
> 
> 	* sysdeps/powerpc/powerpc32/fpu/s_lround.S: Remove useless alias.
> 
> 	* sysdeps/unix/sysv/linux/powerpc/powerpc32/socket.S: Handle
> 	NO_WEAK_ALIAS.
> 	* sysdeps/unix/sysv/linux/powerpc/powerpc64/socket.S: Likewise.

Done this way, readelf -a showed that the various symbols went from being
WEAK to being GLOBAL.  I've been testing the following patch instead for
upload to Ubuntu.  (identical readelf -a output on ppc; .free, .realloc
and .malloc are GLOBAL instead of WEAK on ppc64 and I don't know why yet)

2005-11-17  Jeff Bailey  <jbailey@ubuntu.com>

	* sysdeps/powerpc/powerpc32/fpu/s_lround.S: Extra strong_alias
          confuses new binutils

	* sysdeps/unix/sysv/linux/bind.S: bind should be the alias,
          not __bind.

	* sysdeps/unix/sysv/linux/getsockname.S: getsockname should
          be the alias, not __getsockname.

	* sysdeps/unix/sysv/linux/listen.S: listen should be the alias,
          not __listen.

	* sysdeps/unix/sysv/linux/setsockopt.S: setsockopt should
          be the alias, not __setsockopt.

	* sysdeps/unix/sysv/linux/powerpc/powerpc32/socket.S: Don't
	  set weak_alias if NO_WEAK_ALIAS is set.


diff -ru build-tree/glibc-2.3.5/sysdeps/powerpc/powerpc32/fpu/s_lround.S glibc-2.3.5/sysdeps/powerpc/powerpc32/fpu/s_lround.S
--- sysdeps/powerpc/powerpc32/fpu/s_lround.S    2004-06-30 18:29:12.000000000 -0400
+++ powerpc/powerpc32/fpu/s_lround.S    2005-11-17 18:35:46.000000000 -0500
@@ -88,7 +88,6 @@
        b       .L9
        END (__lround)

-strong_alias (__lround, __lround)
 weak_alias (__lround, lround)

 strong_alias (__lround, __lroundf)
diff -ru build-tree/glibc-2.3.5/sysdeps/unix/sysv/linux/bind.S glibc-2.3.5/sysdeps/unix/sysv/linux/bind.S
--- sysdeps/unix/sysv/linux/bind.S      2002-05-14 20:17:25.000000000 -0400
+++ sysdeps/unix/sysv/linux/bind.S      2005-11-17 20:21:57.000000000 -0500
@@ -2,4 +2,4 @@
 #define        NARGS   3
 #define NO_WEAK_ALIAS  1
 #include <socket.S>
-weak_alias (bind, __bind)
+weak_alias (__bind, bind)
diff -ru build-tree/glibc-2.3.5/sysdeps/unix/sysv/linux/getsockname.S glibc-2.3.5/sysdeps/unix/sysv/linux/getsockname.S
--- sysdeps/unix/sysv/linux/getsockname.S       2002-05-14 20:17:58.000000000 -0400
+++ sysdeps/unix/sysv/linux/getsockname.S       2005-11-17 20:34:14.000000000 -0500
@@ -2,4 +2,4 @@
 #define        NARGS   3
 #define NO_WEAK_ALIAS  1
 #include <socket.S>
-weak_alias (getsockname, __getsockname)
+weak_alias (__getsockname, getsockname)
diff -ru build-tree/glibc-2.3.5/sysdeps/unix/sysv/linux/listen.S glibc-2.3.5/sysdeps/unix/sysv/linux/listen.S
--- sysdeps/unix/sysv/linux/listen.S    2002-05-14 20:18:37.000000000 -0400
+++ sysdeps/unix/sysv/linux/listen.S    2005-11-17 20:49:01.000000000 -0500
@@ -2,4 +2,4 @@
 #define        NARGS   2
 #define NO_WEAK_ALIAS  1
 #include <socket.S>
-weak_alias (listen, __listen)
+weak_alias (__listen, listen)
diff -ru build-tree/glibc-2.3.5/sysdeps/unix/sysv/linux/powerpc/powerpc32/socket.S glibc-2.3.5/sysdeps/unix/sysv/linux/powerpc/powerpc32/socket.S
--- sysdeps/unix/sysv/linux/powerpc/powerpc32/socket.S  2003-07-11 18:46:12.000000000 -0400
+++ sysdeps/unix/sysv/linux/powerpc/powerpc32/socket.S  2005-11-17 20:29:56.000000000 -0500
@@ -116,4 +116,6 @@

 PSEUDO_END (__socket)

+#ifndef NO_WEAK_ALIAS
 weak_alias (__socket, socket)
+#endif
diff -ru build-tree/glibc-2.3.5/sysdeps/unix/sysv/linux/setsockopt.S glibc-2.3.5/sysdeps/unix/sysv/linux/setsockopt.S
--- sysdeps/unix/sysv/linux/setsockopt.S        2002-05-14 20:19:09.000000000 -0400
+++ sysdeps/unix/sysv/linux/setsockopt.S        2005-11-17 20:49:48.000000000 -0500
@@ -2,4 +2,4 @@
 #define        NARGS   5
 #define NO_WEAK_ALIAS  1
 #include <socket.S>
-weak_alias (setsockopt, __setsockopt)
+weak_alias (__setsockopt, setsockopt)


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

* Re: Symbol redefinition bugs
  2005-11-20 12:46 ` Jeff Bailey
@ 2005-11-20 14:38   ` Andreas Schwab
  2005-11-21 21:01   ` Roland McGrath
  1 sibling, 0 replies; 6+ messages in thread
From: Andreas Schwab @ 2005-11-20 14:38 UTC (permalink / raw)
  To: Jeff Bailey; +Cc: libc-hacker

Jeff Bailey <jbailey@raspberryginger.com> writes:

> 	* sysdeps/unix/sysv/linux/bind.S: bind should be the alias,
>           not __bind.

Did you test that on other architectures?

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

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

* Re: Symbol redefinition bugs
  2005-11-20 12:46 ` Jeff Bailey
  2005-11-20 14:38   ` Andreas Schwab
@ 2005-11-21 21:01   ` Roland McGrath
  2005-11-22  3:55     ` Jeff Bailey
  1 sibling, 1 reply; 6+ messages in thread
From: Roland McGrath @ 2005-11-21 21:01 UTC (permalink / raw)
  To: Jeff Bailey; +Cc: Andreas Schwab, libc-hacker

> Done this way, readelf -a showed that the various symbols went from being
> WEAK to being GLOBAL.

Which symbols?  Show the exact details you are talking about.

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

* Re: Symbol redefinition bugs
  2005-11-21 21:01   ` Roland McGrath
@ 2005-11-22  3:55     ` Jeff Bailey
  2005-11-22  4:33       ` Ulrich Drepper
  0 siblings, 1 reply; 6+ messages in thread
From: Jeff Bailey @ 2005-11-22  3:55 UTC (permalink / raw)
  To: Roland McGrath; +Cc: Andreas Schwab, libc-hacker

On lun, 2005-11-21 at 13:01 -0800, Roland McGrath wrote:
> > Done this way, readelf -a showed that the various symbols went from being
> > WEAK to being GLOBAL.
> 
> Which symbols?  Show the exact details you are talking about.

This is on powerpc-linux using readelf -a.
The "old" build, is CVS HEAD glibc as of 2005-11-17 using binutils
2.16.1.  The "new" build is CVS HEAD glibc from today, using binutils
CVS from 20051117.

old:
   617: 000d85ac    44 FUNC    WEAK   DEFAULT   10 socket@@GLIBC_2.0
   954: 000d807c    44 FUNC    WEAK   DEFAULT   10 bind@@GLIBC_2.0
  1014: 000d8550    52 FUNC    WEAK   DEFAULT   10 setsockopt@@GLIBC_2.0
  1253: 000d81c0    40 FUNC    WEAK   DEFAULT   10 listen@@GLIBC_2.0
  2184: 000d8160    44 FUNC    WEAK   DEFAULT   10
getsockname@@GLIBC_2.0

new:
   617: 000d861c    44 FUNC    WEAK   DEFAULT   10 socket@@GLIBC_2.0
   954: 000d80ec    44 FUNC    GLOBAL DEFAULT   10 bind@@GLIBC_2.0
  1014: 000d85c0    52 FUNC    GLOBAL DEFAULT   10 setsockopt@@GLIBC_2.0
  1253: 000d8230    40 FUNC    GLOBAL DEFAULT   10 listen@@GLIBC_2.0
  2184: 000d81d0    44 FUNC    GLOBAL DEFAULT   10
getsockname@@GLIBC_2.0

With the patch I offered, it keeps these symbols as weak on ppc.  I had
tested it against ppc and x86_64.

x86_64 also had these symbols as weak before, but i386 did not:

   944: 000b90f0    57 FUNC    GLOBAL DEFAULT   11 bind@@GLIBC_2.0
(etc)

If you want bind, setsockopt, listen, and getsockname as weak, I'll redo
the patch against current CVS and resubmit.

Tks,
Jeff Bailey

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

* Re: Symbol redefinition bugs
  2005-11-22  3:55     ` Jeff Bailey
@ 2005-11-22  4:33       ` Ulrich Drepper
  0 siblings, 0 replies; 6+ messages in thread
From: Ulrich Drepper @ 2005-11-22  4:33 UTC (permalink / raw)
  To: Jeff Bailey; +Cc: libc-hacker

Jeff Bailey wrote:
> With the patch I offered, it keeps these symbols as weak on ppc.  I had
> tested it against ppc and x86_64.

There is no difference between weak and non-weak symbols in DSOs.

-- 
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖

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

end of thread, other threads:[~2005-11-22  4:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-18 19:19 Symbol redefinition bugs Andreas Schwab
2005-11-20 12:46 ` Jeff Bailey
2005-11-20 14:38   ` Andreas Schwab
2005-11-21 21:01   ` Roland McGrath
2005-11-22  3:55     ` Jeff Bailey
2005-11-22  4:33       ` Ulrich Drepper

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).