benchmarking combreloc
Jakub Jelinek
jakub@redhat.com
Wed Oct 31 03:31:00 GMT 2001
On Wed, Oct 31, 2001 at 01:11:16AM -0500, Jack Howarth wrote:
> Hello,
> Has anyone actually benchmarked the effect of combreloc on
> loading programs built with a -z combreloc enabled binutils and
> a glibc built against that as well. I have done some simple benchmarks
> on Debian sid ppc comparing the effects of Jakub's prelinker with
> that obtained with and without combreloc. This was done by using
> the -Wl,-znocombreloc linker flag when linking the t1 tutorial to
> attempt to disable combreloc in a program.
You're not testing what you think you're testing.
If you want to measure the difference between -z nocombreloc and
-z combreloc, you need to either build a custom glibc wbich will disable
symbol lookup cache (e.g. by hacking elf/dl-reloc.c and
#define RESOLVE(ref, version, r_type) \
(ELFW(ST_BIND) ((*ref)->st_info) != STB_LOCAL \
- ? ((__builtin_expect ((*ref) == l->l_lookup_cache.sym, 0) \
+ ? ((0 && __builtin_expect ((*ref) == l->l_lookup_cache.sym, 0) \
&& elf_machine_type_class (r_type) == l->l_lookup_cache.type_class) \
? (++_dl_num_cache_relocations, \
(*ref) = l->l_lookup_cache.ret, \
l->l_lookup_cache.value) \
), or make sure all libraries in question (including libc and ld.so)
were linked with -z nocombreloc.
As you can see, there are 22744 relocs served from cache against 9647 real lookups,
so you'll see big difference...
Jakub
More information about the Libc-alpha
mailing list