Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 08 Jun 1999 00:57:36 +0900
From:      Hidetoshi Shimokawa <simokawa@sat.t.u-tokyo.ac.jp>
To:        jdp@FreeBSD.org
Cc:        freebsd-alpha@freebsd.org
Subject:   Re: cvs commit: src/lib/csu/alpha crtbegin.c
Message-ID:  <14171.60400.466517.68187Y@ett.sat.t.u-tokyo.ac.jp>
In-Reply-To: In your message of "Sun, 6 Jun 1999 08:59:09 -0700 (PDT)" <199906061559.IAA28808@freefall.freebsd.org>
References:  <199906061559.IAA28808@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
I noticed that some large dynamic linked program is slow on alpha.

For example,

1) make /usr/src/libexec/rtld-elf with DEBUG code and install it.

Index: Makefile
===================================================================
RCS file: /pub/FreeBSD-CVS/src/libexec/rtld-elf/Makefile,v
retrieving revision 1.6
diff -u -r1.6 Makefile
--- Makefile	1999/04/09 00:28:31	1.6
+++ Makefile	1999/04/17 08:44:17
@@ -6,6 +6,7 @@
 		reloc.c
 NOMAN=		true
 CFLAGS+=	-Wall -DFREEBSD_ELF -I${.CURDIR}/${MACHINE_ARCH} -I${.CURDIR}
+CFLAGS+=	-DDEBUG
 LDFLAGS+=	-nostdlib -e .rtld_start
 INSTALLFLAGS+=	-fschg -C
 
Index: rtld.c
===================================================================
RCS file: /pub/FreeBSD-CVS/src/libexec/rtld-elf/rtld.c,v
retrieving revision 1.23
diff -u -r1.23 rtld.c
--- rtld.c	1999/04/22 01:54:38	1.23
+++ rtld.c	1999/04/22 13:07:27
@@ -327,6 +327,8 @@
       defobj->strtab + def->st_name, basename(obj->path),
       target, basename(defobj->path));
 
+    dbg("where (%p)  %p -> %p", where, *where, target);
+
     *where = (Elf_Addr) target;
     return target;
 }

2) run 'LD_DEBUG=yes /usr/libexec/elf/gdb'
...
...
"malloc" in "gdb" ==> 0x1602a9580 in "libc.so.3"
where (0x120187bc0)  0x1602a9580 -> 0x1602a9580
"malloc" in "gdb" ==> 0x1602a9580 in "libc.so.3"
where (0x120187bc0)  0x1602a9580 -> 0x1602a9580
"memcpy" in "gdb" ==> 0x1602a9c40 in "libc.so.3"
where (0x120187bb8)  0x1602a9c40 -> 0x1602a9c40
"malloc" in "gdb" ==> 0x1602a9580 in "libc.so.3"
where (0x120187bc0)  0x1602a9580 -> 0x1602a9580
"malloc" in "gdb" ==> 0x1602a9580 in "libc.so.3"
where (0x120187bc0)  0x1602a9580 -> 0x1602a9580
"malloc" in "gdb" ==> 0x1602a9580 in "libc.so.3"
where (0x120187bc0)  0x1602a9580 -> 0x1602a9580
"memcpy" in "gdb" ==> 0x1602a9c40 in "libc.so.3"
where (0x120187bb8)  0x1602a9c40 -> 0x1602a9c40
"malloc" in "gdb" ==> 0x1602a9580 in "libc.so.3"
...
...

I think rewriting jump slot should be once for each function.

This problem seems still exist after make world with this commit.
Do you have any idea about this?

/\ Hidetoshi Shimokawa
\/  simokawa@sat.t.u-tokyo.ac.jp
PGP public key: finger -l simokawa@sat.t.u-tokyo.ac.jp


At Sun, 6 Jun 1999 08:59:09 -0700 (PDT),
John Polstra <jdp@FreeBSD.org> wrote:
> 
> jdp         1999/06/06 08:59:09 PDT
> 
>   Modified files:
>     lib/csu/alpha        crtbegin.c 
>   Log:
>   Call do_ctors() and do_dtors() using indirect calls through function
>   pointers.  The calls are in different sections from the functions
>   being called, and they can potentially be far away.  On a very large
>   program, the 21-bit displacement field of the BSR instruction
>   overflowed at link time.
>   
>   Revision  Changes    Path
>   1.4       +12 -3     src/lib/csu/alpha/crtbegin.c
> 


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-alpha" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?14171.60400.466517.68187Y>