public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
From: Richard Henderson <rth@twiddle.net>
To: libc-hacker@sourceware.org
Subject: [rfa] fix alpha ld.so undef symbol
Date: Tue, 13 Mar 2007 16:48:00 -0000	[thread overview]
Message-ID: <20070313164816.GA5635@twiddle.net> (raw)

Since

2007-02-12  Ulrich Drepper  <drepper@redhat.com>

        * elf/rtld.c (RESOLVE_MAP): Always return bootstrap_map reference.
        * elf/Makefile ($(objpfx)ld.so): Check that ld.so has no undefined
        references.

ld.so has failed on alpha, because we'd had an undef weak symbol
that was resolved from libc.so.  This patch rearranges things so
that the symbol is now defined in ld.so instead.

Of course, that meant that I had to find a new place to get the
symbol defined for the static libc, and in the process I discovered
that we weren't processing the auxv entries for the static libc
either.  This patch fixes that with one ifdef in common code.

Ok?


r~


2007-03-13  Richard Henderson  <rth@redhat.com>

	* elf/dl-support.c (_dl_aux_init): Honor DL_PLATFORM_AUXV.
	* sysdeps/unix/sysv/linux/alpha/dl-auxv.h: New file.
	* sysdeps/unix/sysv/linux/alpha/dl-support.c: New file.
	* sysdeps/unix/sysv/linux/alpha/dl-sysdep.c (__libc_alpha_cache_shape):
	Move to dl-auxv.h; initialize instead of extern weak.
	(DL_PLATFORM_AUXV): Move to dl-auxv.h; don't test for undef
	weak symbol.
	* sysdeps/unix/sysv/linux/alpha/sysconf.c (__libc_alpha_cache_shape):
	Extern instead of initialized.

Index: elf/dl-support.c
===================================================================
RCS file: /cvs/glibc/libc/elf/dl-support.c,v
retrieving revision 1.91
diff -u -p -r1.91 dl-support.c
--- elf/dl-support.c	19 Dec 2006 15:23:02 -0000	1.91
+++ elf/dl-support.c	13 Mar 2007 16:09:45 -0000
@@ -211,6 +211,9 @@ _dl_aux_init (ElfW(auxv_t) *av)
 	__libc_enable_secure = av->a_un.a_val;
 	__libc_enable_secure_decided = 1;
 	break;
+#ifdef DL_PLATFORM_AUXV
+      DL_PLATFORM_AUXV
+#endif
       }
   if (seen == 0xf)
     {
Index: sysdeps/unix/sysv/linux/alpha/dl-auxv.h
===================================================================
RCS file: sysdeps/unix/sysv/linux/alpha/dl-auxv.h
diff -N sysdeps/unix/sysv/linux/alpha/dl-auxv.h
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ sysdeps/unix/sysv/linux/alpha/dl-auxv.h	13 Mar 2007 16:09:50 -0000
@@ -0,0 +1,36 @@
+/* Auxiliary vector processing for Linux/Alpha.
+   Copyright (C) 2007 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+/* Scan the Aux Vector for the cache shape entries.  */
+
+long __libc_alpha_cache_shape[4] = { -2, -2, -2, -2 };
+
+#define DL_PLATFORM_AUXV				\
+      case AT_L1I_CACHESHAPE:				\
+	__libc_alpha_cache_shape[0] = av->a_un.a_val;	\
+	break;						\
+      case AT_L1D_CACHESHAPE:				\
+	__libc_alpha_cache_shape[1] = av->a_un.a_val;	\
+	break;						\
+      case AT_L2_CACHESHAPE:				\
+	__libc_alpha_cache_shape[2] = av->a_un.a_val;	\
+	break;						\
+      case AT_L3_CACHESHAPE:				\
+	__libc_alpha_cache_shape[3] = av->a_un.a_val;	\
+	break;
Index: sysdeps/unix/sysv/linux/alpha/dl-support.c
===================================================================
RCS file: sysdeps/unix/sysv/linux/alpha/dl-support.c
diff -N sysdeps/unix/sysv/linux/alpha/dl-support.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ sysdeps/unix/sysv/linux/alpha/dl-support.c	13 Mar 2007 16:09:50 -0000
@@ -0,0 +1,2 @@
+#include "dl-auxv.h"
+#include <elf/dl-support.c>
Index: sysdeps/unix/sysv/linux/alpha/dl-sysdep.c
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/alpha/dl-sysdep.c,v
retrieving revision 1.2
diff -u -p -r1.2 dl-sysdep.c
--- sysdeps/unix/sysv/linux/alpha/dl-sysdep.c	8 Jan 2006 08:21:16 -0000	1.2
+++ sysdeps/unix/sysv/linux/alpha/dl-sysdep.c	13 Mar 2007 16:09:50 -0000
@@ -1,59 +1,2 @@
-/* Operating system support for run-time dynamic linker.  Linux/Alpha version.
-   Copyright (C) 1997, 1998, 2001, 2003, 2006 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
-
-#include <config.h>
-#include <kernel-features.h>
-#include <ldsodefs.h>
-
-extern long __libc_alpha_cache_shape[4];
-weak_extern (__libc_alpha_cache_shape);
-
-
-/* Scan the Aux Vector for the cache shape entries.  */
-#define DL_PLATFORM_AUXV				\
-      case AT_L1I_CACHESHAPE:				\
-	{						\
-	  long *cls = __libc_alpha_cache_shape;		\
-	  if (cls != NULL)				\
-	    cls[0] = av->a_un.a_val;			\
-	  break;					\
-	}						\
-      case AT_L1D_CACHESHAPE:				\
-	{						\
-	  long *cls = __libc_alpha_cache_shape;		\
-	  if (cls != NULL)				\
-	    cls[1] = av->a_un.a_val;			\
-	  break;					\
-	}						\
-      case AT_L2_CACHESHAPE:				\
-	{						\
-	  long *cls = __libc_alpha_cache_shape;		\
-	  if (cls != NULL)				\
-	    cls[2] = av->a_un.a_val;			\
-	  break;					\
-	}						\
-      case AT_L3_CACHESHAPE:				\
-	{						\
-	  long *cls = __libc_alpha_cache_shape;		\
-	  if (cls != NULL)				\
-	    cls[3] = av->a_un.a_val;			\
-	  break;					\
-	}
-
+#include "dl-auxv.h"
 #include <sysdeps/unix/sysv/linux/dl-sysdep.c>
Index: sysdeps/unix/sysv/linux/alpha/sysconf.c
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/alpha/sysconf.c,v
retrieving revision 1.1
diff -u -p -r1.1 sysconf.c
--- sysdeps/unix/sysv/linux/alpha/sysconf.c	7 May 2004 01:57:19 -0000	1.1
+++ sysdeps/unix/sysv/linux/alpha/sysconf.c	13 Mar 2007 16:09:51 -0000
@@ -27,7 +27,7 @@ static long int linux_sysconf (int name)
 #define CSHAPE(totalsize, linesize, assoc) \
   ((totalsize & ~0xff) | (linesize << 4) | assoc)
 
-long __libc_alpha_cache_shape[4] = { -2, -2, -2, -2 };
+extern long __libc_alpha_cache_shape[4];
 
 static inline unsigned long
 implver (void)

             reply	other threads:[~2007-03-13 16:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-13 16:48 Richard Henderson [this message]
2007-03-13 20:17 ` Roland McGrath
2007-03-13 20:41   ` Steven Munroe
2007-03-13 21:04     ` Roland McGrath
2007-03-20 12:36     ` [PATCH] Fix up ppc __cache_line_size Jakub Jelinek
2007-03-20 14:59       ` Steven Munroe
2007-03-22 22:01       ` Steven Munroe
2007-03-13 21:15   ` [rfa] fix alpha ld.so undef symbol Richard Henderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070313164816.GA5635@twiddle.net \
    --to=rth@twiddle.net \
    --cc=libc-hacker@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).