Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Jun 2004 21:07:06 GMT
From:      Peter Wemm <peter@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 55046 for review
Message-ID:  <200406152107.i5FL76Ll078107@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=55046

Change 55046 by peter@peter_daintree on 2004/06/15 21:06:29

	Argh. The search_symbol methods need to compensate for the bases too.
	I think its time to switch to iedwose's alternate strategy.

Affected files ...

.. //depot/projects/hammer/sys/kern/link_elf_obj.c#41 edit

Differences ...

==== //depot/projects/hammer/sys/kern/link_elf_obj.c#41 (text+ko) ====

@@ -772,6 +772,7 @@
 	u_long off = (uintptr_t) (void *) value;
 	u_long diff = off;
 	u_long st_value;
+	Elf_Addr base;
 	const Elf_Sym *es;
 	const Elf_Sym *best = 0;
 	int i;
@@ -779,7 +780,10 @@
 	for (i = 0, es = ef->ddbsymtab; i < ef->ddbsymcnt; i++, es++) {
 		if (es->st_name == 0)
 			continue;
-		st_value = es->st_value + (uintptr_t) (void *) ef->address;
+		base = findbase(ef, es->st_shndx);
+		if (base == 0)
+			base = (Elf_Addr)ef->address;
+		st_value = es->st_value + base;
 		if (off >= st_value) {
 			if (off - st_value < diff) {
 				diff = off - st_value;



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