From owner-p4-projects@FreeBSD.ORG Mon Aug 21 22:34:39 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 2F21616A4E1; Mon, 21 Aug 2006 22:34:39 +0000 (UTC) X-Original-To: perforce@FreeBSD.org 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 0AA5516A4DF for ; Mon, 21 Aug 2006 22:34:39 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id CDEFC43D5A for ; Mon, 21 Aug 2006 22:34:31 +0000 (GMT) (envelope-from gonzo@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k7LMYV9a056932 for ; Mon, 21 Aug 2006 22:34:31 GMT (envelope-from gonzo@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k7LMYVP4056929 for perforce@freebsd.org; Mon, 21 Aug 2006 22:34:31 GMT (envelope-from gonzo@FreeBSD.org) Date: Mon, 21 Aug 2006 22:34:31 GMT Message-Id: <200608212234.k7LMYVP4056929@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko To: Perforce Change Reviews Cc: Subject: PERFORCE change 104738 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Aug 2006 22:34:39 -0000 http://perforce.freebsd.org/chv.cgi?CH=104738 Change 104738 by gonzo@gonzo_hideout on 2006/08/21 22:33:43 o Get rid of x86_64 bits. o Fixed Elf32_Auxinfo struct: a_un should contain a_ptr and a_fcn fields. o Added MIPS-specific relocations from NetBSD tree. o ELF_TARGET_DATA considers target endianess. Affected files ... .. //depot/projects/mips2/src/sys/mips/include/elf.h#3 edit Differences ... ==== //depot/projects/mips2/src/sys/mips/include/elf.h#3 (text+ko) ==== @@ -1,3 +1,5 @@ +/* $NetBSD: elf_machdep.h,v 1.10 2005/12/11 12:18:09 christos Exp $ */ + /*- * Copyright (c) 1996-1997 John D. Polstra. * All rights reserved. @@ -40,9 +42,9 @@ #include /* Definitions common to all 64 bit architectures. */ #include -#define ELF_ARCH EM_X86_64 +#define ELF_ARCH EM_MIPS -#define ELF_MACHINE_OK(x) ((x) == EM_X86_64) +#define ELF_MACHINE_OK(x) ((x) == EM_MIPS) /* * Auxiliary vector entries for passing information to the interpreter. @@ -54,6 +56,8 @@ int a_type; /* Entry type. */ union { int a_val; /* Integer value. */ + void *a_ptr; /* Address. */ + void (*a_fcn)(void); /* Function pointer (not used). */ } a_un; } Elf32_Auxinfo; @@ -103,36 +107,55 @@ #define AT_COUNT 15 /* Count of defined aux entry types. */ +/* mips relocs. */ + +#define R_MIPS_NONE 0 +#define R_MIPS_16 1 +#define R_MIPS_32 2 +#define R_MIPS_REL32 3 +#define R_MIPS_REL R_MIPS_REL32 +#define R_MIPS_26 4 +#define R_MIPS_HI16 5 /* high 16 bits of symbol value */ +#define R_MIPS_LO16 6 /* low 16 bits of symbol value */ +#define R_MIPS_GPREL16 7 /* GP-relative reference */ +#define R_MIPS_LITERAL 8 /* Reference to literal section */ +#define R_MIPS_GOT16 9 /* Reference to global offset table */ +#define R_MIPS_GOT R_MIPS_GOT16 +#define R_MIPS_PC16 10 /* 16 bit PC relative reference */ +#define R_MIPS_CALL16 11 /* 16 bit call thru glbl offset tbl */ +#define R_MIPS_CALL R_MIPS_CALL16 +#define R_MIPS_GPREL32 12 + +/* 13, 14, 15 are not defined at this point. */ +#define R_MIPS_UNUSED1 13 +#define R_MIPS_UNUSED2 14 +#define R_MIPS_UNUSED3 15 + /* - * Relocation types. + * The remaining relocs are apparently part of the 64-bit Irix ELF ABI. */ +#define R_MIPS_SHIFT5 16 +#define R_MIPS_SHIFT6 17 -#define R_X86_64_NONE 0 /* No relocation. */ -#define R_X86_64_64 1 /* Add 64 bit symbol value. */ -#define R_X86_64_PC32 2 /* PC-relative 32 bit signed sym value. */ -#define R_X86_64_GOT32 3 /* PC-relative 32 bit GOT offset. */ -#define R_X86_64_PLT32 4 /* PC-relative 32 bit PLT offset. */ -#define R_X86_64_COPY 5 /* Copy data from shared object. */ -#define R_X86_64_GLOB_DAT 6 /* Set GOT entry to data address. */ -#define R_X86_64_JMP_SLOT 7 /* Set GOT entry to code address. */ -#define R_X86_64_RELATIVE 8 /* Add load address of shared object. */ -#define R_X86_64_GOTPCREL 9 /* Add 32 bit signed pcrel offset to GOT. */ -#define R_X86_64_32 10 /* Add 32 bit zero extended symbol value */ -#define R_X86_64_32S 11 /* Add 32 bit sign extended symbol value */ -#define R_X86_64_16 12 /* Add 16 bit zero extended symbol value */ -#define R_X86_64_PC16 13 /* Add 16 bit signed extended pc relative symbol value */ -#define R_X86_64_8 14 /* Add 8 bit zero extended symbol value */ -#define R_X86_64_PC8 15 /* Add 8 bit signed extended pc relative symbol value */ -#define R_X86_64_DTPMOD64 16 /* ID of module containing symbol */ -#define R_X86_64_DTPOFF64 17 /* Offset in TLS block */ -#define R_X86_64_TPOFF64 18 /* Offset in static TLS block */ -#define R_X86_64_TLSGD 19 /* PC relative offset to GD GOT entry */ -#define R_X86_64_TLSLD 20 /* PC relative offset to LD GOT entry */ -#define R_X86_64_DTPOFF32 21 /* Offset in TLS block */ -#define R_X86_64_GOTTPOFF 22 /* PC relative offset to IE GOT entry */ -#define R_X86_64_TPOFF32 23 /* Offset in static TLS block */ - -#define R_X86_64_COUNT 24 /* Count of defined relocation types. */ +#define R_MIPS_64 18 +#define R_MIPS_GOT_DISP 19 +#define R_MIPS_GOT_PAGE 20 +#define R_MIPS_GOT_OFST 21 +#define R_MIPS_GOT_HI16 22 +#define R_MIPS_GOT_LO16 23 +#define R_MIPS_SUB 24 +#define R_MIPS_INSERT_A 25 +#define R_MIPS_INSERT_B 26 +#define R_MIPS_DELETE 27 +#define R_MIPS_HIGHER 28 +#define R_MIPS_HIGHEST 29 +#define R_MIPS_CALL_HI16 30 +#define R_MIPS_CALL_LO16 31 +#define R_MIPS_SCN_DISP 32 +#define R_MIPS_REL16 33 +#define R_MIPS_ADD_IMMEDIATE 34 +#define R_MIPS_PJUMP 35 +#define R_MIPS_RELGOT 36 /* Define "machine" characteristics */ #if __ELF_WORD_SIZE == 32 @@ -140,8 +163,14 @@ #else #define ELF_TARG_CLASS ELFCLASS64 #endif + +#ifdef __MIPSEB__ +#define ELF_TARG_DATA ELFDATA2MSB +#else #define ELF_TARG_DATA ELFDATA2LSB -#define ELF_TARG_MACH EM_X86_64 +#endif + +#define ELF_TARG_MACH EM_MIPS #define ELF_TARG_VER 1 #endif /* !_MACHINE_ELF_H_ */