From owner-freebsd-arch Tue Apr 23 0:23:27 2002 Delivered-To: freebsd-arch@freebsd.org Received: from kayak.xcllnt.net (209-128-86-226.bayarea.net [209.128.86.226]) by hub.freebsd.org (Postfix) with ESMTP id 639F137B4DF for ; Tue, 23 Apr 2002 00:23:02 -0700 (PDT) Received: from athlon.pn.xcllnt.net (athlon.pn.xcllnt.net [192.168.4.3]) by kayak.xcllnt.net (8.11.6/8.11.4) with ESMTP id g3N7MjJ65146 for ; Tue, 23 Apr 2002 00:22:45 -0700 (PDT) (envelope-from marcel@kayak.pn.xcllnt.net) Received: from athlon.pn.xcllnt.net (localhost [127.0.0.1]) by athlon.pn.xcllnt.net (8.12.3/8.12.2) with ESMTP id g3N7MiCf072416 for ; Tue, 23 Apr 2002 00:22:44 -0700 (PDT) (envelope-from marcel@athlon.pn.xcllnt.net) Received: (from marcel@localhost) by athlon.pn.xcllnt.net (8.12.3/8.12.3/Submit) id g3N7MiVo072395 for arch@FreeBSD.org; Tue, 23 Apr 2002 00:22:44 -0700 (PDT) Date: Tue, 23 Apr 2002 00:22:44 -0700 From: Marcel Moolenaar To: arch@FreeBSD.org Subject: RTLD fix: part 1: kernel modules Message-ID: <20020423072244.GA40461@athlon.pn.xcllnt.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.27i Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Gang, The attached diff is primarily created to resolve a RTLD problem on ia64, but should prevent other architectures from the same and also (potentially) improve dynamic linking performance. The bottom line is this: On ia64, local symbols are not added to the hash table. My guess is that the rationale is that if the symbol exists only for relocation purposes, then you don't need to do a lookup because the relocation has the index of the symbol. Provided that linkers will not do lookups when not needed, this is safe. Unfortunately, we always do lookups (hash based). As such, we got unresolved symbols even though the symbol was in the symbol table; just not in the hash table. The attached diff changes the way we relocate for ELF. We don't pass the symbol name to elf_reloc anymore, because the relocation contains the index of the symbols. A new support function is created that does the lookup given the symbol index. For local symbols this is trivial. For global symbols we can avoid lookups in the future by being more smart. The second part is a similar change to ld-elf.so. I haven't looked at that yet. Compiles for alpha, i386 and ia64 Tested on ia64 Please review, -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message