From owner-p4-projects@FreeBSD.ORG Fri May 23 14:14:58 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 59E8237B404; Fri, 23 May 2003 14:14:58 -0700 (PDT) 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 D01E937B401 for ; Fri, 23 May 2003 14:14:57 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5584443F3F for ; Fri, 23 May 2003 14:14:57 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h4NLEv0U089781 for ; Fri, 23 May 2003 14:14:57 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h4NLEu0t089778 for perforce@freebsd.org; Fri, 23 May 2003 14:14:56 -0700 (PDT) Date: Fri, 23 May 2003 14:14:56 -0700 (PDT) Message-Id: <200305232114.h4NLEu0t089778@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 31729 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, 23 May 2003 21:14:59 -0000 http://perforce.freebsd.org/chv.cgi?CH=31729 Change 31729 by peter@peter_hammer on 2003/05/23 14:14:14 make this compile and link. There is a long way to go still. Affected files ... .. //depot/projects/hammer/libexec/rtld-elf/amd64/reloc.c#5 edit Differences ... ==== //depot/projects/hammer/libexec/rtld-elf/amd64/reloc.c#5 (text+ko) ==== @@ -48,7 +48,7 @@ #include "rtld.h" /* - * Process the special R_386_COPY relocations in the main program. These + * Process the special R_X86_64_COPY relocations in the main program. These * copy data from a shared object into a region in the main program's BSS * segment. * @@ -64,7 +64,7 @@ rellim = (const Elf_Rel *) ((caddr_t) dstobj->rel + dstobj->relsize); for (rel = dstobj->rel; rel < rellim; rel++) { - if (ELF_R_TYPE(rel->r_info) == R_386_COPY) { + if (ELF_R_TYPE(rel->r_info) == R_X86_64_COPY) { void *dstaddr; const Elf_Sym *dstsym; const char *name; @@ -132,10 +132,10 @@ switch (ELF_R_TYPE(rel->r_info)) { - case R_386_NONE: + case R_X86_64_NONE: break; - case R_386_32: + case R_X86_64_64: { const Elf_Sym *def; const Obj_Entry *defobj; @@ -149,7 +149,7 @@ } break; - case R_386_PC32: + case R_X86_64_PC32: /* * I don't think the dynamic linker should ever see this * type of relocation. But the binutils-2.6 tools sometimes @@ -169,8 +169,9 @@ (Elf_Addr) where; } break; + /* missing: R_X86_64_GOT32 R_X86_64_PLT32 */ - case R_386_COPY: + case R_X86_64_COPY: /* * These are deferred until all other relocations have * been done. All we do here is make sure that the COPY @@ -178,13 +179,13 @@ * only in executable files. */ if (!obj->mainprog) { - _rtld_error("%s: Unexpected R_386_COPY relocation" + _rtld_error("%s: Unexpected R_X86_64_COPY relocation" " in shared library", obj->path); goto done; } break; - case R_386_GLOB_DAT: + case R_X86_64_GLOB_DAT: { const Elf_Sym *def; const Obj_Entry *defobj; @@ -198,10 +199,12 @@ } break; - case R_386_RELATIVE: + case R_X86_64_RELATIVE: *where += (Elf_Addr) obj->relocbase; break; + /* missing: R_X86_64_GOTPCREL, R_X86_64_32, R_X86_64_32S, R_X86_64_16, R_X86_64_PC16, R_X86_64_8, R_X86_64_PC8 */ + default: _rtld_error("%s: Unsupported relocation type %d" " in non-PLT relocations\n", obj->path, @@ -227,7 +230,7 @@ for (rel = obj->pltrel; rel < rellim; rel++) { Elf_Addr *where; - assert(ELF_R_TYPE(rel->r_info) == R_386_JMP_SLOT); + assert(ELF_R_TYPE(rel->r_info) == R_X86_64_JMP_SLOT); /* Relocate the GOT slot pointing into the PLT. */ where = (Elf_Addr *)(obj->relocbase + rel->r_offset); @@ -251,7 +254,7 @@ const Elf_Sym *def; const Obj_Entry *defobj; - assert(ELF_R_TYPE(rel->r_info) == R_386_JMP_SLOT); + assert(ELF_R_TYPE(rel->r_info) == R_X86_64_JMP_SLOT); where = (Elf_Addr *)(obj->relocbase + rel->r_offset); def = find_symdef(ELF_R_SYM(rel->r_info), obj, &defobj, true, NULL); if (def == NULL)