This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: A patch to add --with-oldest-abi=ABI. [Re: A patch to add --disable-old-version.]


On Sat, Dec 02, 2000 at 09:57:41AM -0800, H . J . Lu wrote:
> > This works if there is versioning information but not if there isn't.
> > In the latter case the oldest interface is taken.  But if that is gone
> > the only existing interface is used and this is wrong and dangerous.
> > This is mainly important for binaries linked against glibc 2.0 but I'm
> > not sure there isn't a problem elsewhere.
> > 
> 
> I don't think it is really a problem. If we really want, we can
> disallow the unversioned reference in ld.so with --with-oldest-abi=ABI.
> I may be able to provide such a patch.
> 

Here is a patch.

BTW, when I did

# objdump --dynamic-sym */*.so | grep UND | grep -v GLIBC

it showed quite a few references to symbols without versions.

-- 
H.J. Lu (hjl@valinux.com)
---
2000-12-02  H.J. Lu  <hjl@gnu.org>

	* elf/rtld.c (dl_main): Report a fatal error if the loaded file
	has no symbol versioning and an oldest ABI supported is
	configured.

Index: elf/rtld.c
===================================================================
RCS file: /work/cvs/gnu/glibc/elf/rtld.c,v
retrieving revision 1.1.1.13
diff -u -p -r1.1.1.13 rtld.c
--- elf/rtld.c	2000/11/07 01:28:01	1.1.1.13
+++ elf/rtld.c	2000/12/03 20:19:06
@@ -1076,6 +1076,15 @@ of this helper program; chances are you 
 	   implementation in ld.so.  */
 	struct libname_list *lnp = l->l_libname->next;
 
+#ifdef GLIBC_OLDEST_ABI
+#define VERSYMTAG (DT_NUM + DT_THISPROCNUM + DT_VERSIONTAGIDX (DT_VERSYM))
+	if (l->l_info[VERSYMTAG] == NULL)
+	  /* The loaded file has no symbol versioning and an oldest ABI
+	     supported is configured, report a fatal error.  */
+	  _dl_sysdep_fatal (l->l_name[0] ? l->l_name : _dl_argv[0],
+			    ": No symbol version information\n", NULL);
+#endif
+
 	while (__builtin_expect (lnp != NULL, 0))
 	  {
 	    lnp->dont_free = 1;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]