svn commit: trunk/buildroot/toolchain/gcc: 3.4.4 3.4.5 4.0.2

Peter S. Mazinger ps.m at gmx.net
Wed Feb 15 09:31:23 UTC 2006


On Wed, 15 Feb 2006, Peter S. Mazinger wrote:

> On Wed, 15 Feb 2006, Mike Frysinger wrote:
> 
> > On Tuesday 14 February 2006 06:46, Peter S. Mazinger wrote:
> > > On Tue, 14 Feb 2006, Mike Frysinger wrote:
> > > > On Monday 13 February 2006 08:02, Peter S. Mazinger wrote:
> > > > > I would rather do this only for gcc-3.x but not for 4.0.2. I would
> > > > > propose to switch to use the glibc unwinding code beginning w/
> > > > > gcc-4.0.2 (w/o sjlj-exceptions, but w/ --enable-__cxa_atexit, the
> > > > > latter is though only true for uClibc-svn). gcc-4.0.2 has a check to
> > > > > see if the glibc-like unwinding is usable (on native uClibc x86 it
> > > > > considers it usable, else it switches to the non-glibc version). If we
> > > > > move  dl_iterate_phdr() to libc.so/.a, then we won't have any problem
> > > > > w/ it missing from libgcc_eh.a
> > > >
> > > > well get uClibc svn up-to-snuff for unwind and we'll talk about gcc-4 ;)
> > >
> > > I don't understand what you mean ;-(
> > 
> > lets get dl_iterate_phdr() to the same state as glibc right ?
> > -mike
> 
> we will probably need dl-support.c ported to uClibc
> 
> Peter

attached is my attempt to change dl_iterate_phdr to be like glibc's for 
the static case.

If we go w/ AS_NEEDED in libc.so (for *_array support), then we could 
leave it in ld.so, moving only the part from libdl.a to libc.a

Peter

-- 
Peter S. Mazinger <ps dot m at gmx dot net>           ID: 0xA5F059F2
Key fingerprint = 92A4 31E1 56BC 3D5A 2D08  BB6E C389 975E A5F0 59F2
-------------- next part --------------
--- ldso/ldso/dl-elf.c.mps	2006-01-27 14:05:42 +0100
+++ ldso/ldso/dl-elf.c	2006-01-27 17:43:32 +0100
@@ -797,7 +797,7 @@
 /* we want this in ldso.so and libdl.a but nowhere else */
 #ifdef __USE_GNU
 #if defined IS_IN_rtld || (defined IS_IN_libdl && ! defined SHARED)
-extern __typeof(dl_iterate_phdr) __dl_iterate_phdr;
+extern __typeof(dl_iterate_phdr) __dl_iterate_phdr attribute_hidden;
 int
 __dl_iterate_phdr (int (*callback) (struct dl_phdr_info *info, size_t size, void *data), void *data)
 {
@@ -816,6 +816,28 @@
 	}
 	return ret;
 }
+# ifdef SHARED
 strong_alias(__dl_iterate_phdr, dl_iterate_phdr)
+# else
+//extern ElfW(auxv_t) auxvt[AT_EGID + 1];
+extern ElfW(auxv_t) auxvt[];
+int
+dl_iterate_phdr (int (*callback) (struct dl_phdr_info *info, size_t size, void *data), void *data)
+{
+	if (auxvt[AT_PHNUM].a_un.a_val != 0) {
+		/* This entry describes this statically-linked program itself.  */
+		struct dl_phdr_info info;
+		int ret;
+		info.dlpi_addr = 0;
+		info.dlpi_name = "";
+		info.dlpi_phdr = (ElfW(Phdr) *) auxvt[AT_PHDR].a_un.a_val;
+		info.dlpi_phnum = auxvt[AT_PHNUM].a_un.a_val;
+		ret = callback (&info, sizeof (struct dl_phdr_info), data);
+		if (ret)
+			return ret;
+	}
+	return __dl_iterate_phdr (callback, data);
+}
+# endif
 #endif
 #endif


More information about the uClibc mailing list