From owner-p4-projects@FreeBSD.ORG Thu Apr 1 18:44:47 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 17D4316A4D8; Thu, 1 Apr 2004 18:44:47 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 836DB16A4CF for ; Thu, 1 Apr 2004 18:44:46 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7B5A043D45 for ; Thu, 1 Apr 2004 18:44:46 -0800 (PST) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i322ikGe030328 for ; Thu, 1 Apr 2004 18:44:46 -0800 (PST) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i322iknq030324 for perforce@freebsd.org; Thu, 1 Apr 2004 18:44:46 -0800 (PST) (envelope-from peter@freebsd.org) Date: Thu, 1 Apr 2004 18:44:46 -0800 (PST) Message-Id: <200404020244.i322iknq030324@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 50160 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Apr 2004 02:44:47 -0000 http://perforce.freebsd.org/chv.cgi?CH=50160 Change 50160 by peter@peter_hammer on 2004/04/01 18:44:32 implement another relocation type. try and fix PC32 while here. Affected files ... .. //depot/projects/hammer/sys/amd64/amd64/elf_machdep.c#16 edit Differences ... ==== //depot/projects/hammer/sys/amd64/amd64/elf_machdep.c#16 (text+ko) ==== @@ -107,8 +107,8 @@ elf_reloc_internal(linker_file_t lf, const void *data, int type, int local, elf_lookup_fn lu) { Elf_Addr relocbase = (Elf_Addr) lf->address; - Elf_Addr *where; - int32_t *where32; + Elf64_Addr *where; + Elf32_Addr *where32, val32; Elf_Addr addr; Elf_Addr addend; Elf_Word rtype, symidx; @@ -173,11 +173,23 @@ printf("addr 0x%lx, addend 0x%lx\n", addr, addend); if (addr == 0) return -1; - addr += addend - (Elf_Addr)where; - /* XXX needs to be 32 bit *where, not 64 bit */ + val32 = (Elf32_Addr)(addr + addend - (Elf_Addr)where); where32 = (int32_t *)where; - if (*where32 != addr) - *where32 = addr; + if (*where32 != val32) + *where32 = val32; +printf("*where32 = 0x%x\n", *where32); + break; + + case R_X86_64_32S: /* S + A sign extend */ +printf("R_X86_64_32\n"); + addr = lu(lf, symidx, 1); +printf("addr 0x%lx, addend 0x%lx\n", addr, addend); + if (addr == 0) + return -1; + val32 = (Elf32_Addr)(addr + addend); + where32 = (Elf32_Addr *)where; + if (*where32 != val32) + *where32 = val32; printf("*where32 = 0x%x\n", *where32); break;