From owner-svn-src-all@FreeBSD.ORG Thu Dec 11 08:22:21 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 47E4B1065673; Thu, 11 Dec 2008 08:22:21 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 38A0B8FC12; Thu, 11 Dec 2008 08:22:21 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBB8MLeB059323; Thu, 11 Dec 2008 08:22:21 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBB8MKLd059320; Thu, 11 Dec 2008 08:22:20 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200812110822.mBB8MKLd059320@svn.freebsd.org> From: Warner Losh Date: Thu, 11 Dec 2008 08:22:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185925 - in head/contrib/binutils: bfd gas/config ld/emulparams X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Dec 2008 08:22:21 -0000 Author: imp Date: Thu Dec 11 08:22:20 2008 New Revision: 185925 URL: http://svn.freebsd.org/changeset/base/185925 Log: Push mips support into the tree. Added: head/contrib/binutils/ld/emulparams/elf32bmip_fbsd.sh (contents, props changed) Modified: head/contrib/binutils/bfd/config.bfd head/contrib/binutils/gas/config/tc-mips.c Modified: head/contrib/binutils/bfd/config.bfd ============================================================================== --- head/contrib/binutils/bfd/config.bfd Thu Dec 11 08:20:34 2008 (r185924) +++ head/contrib/binutils/bfd/config.bfd Thu Dec 11 08:22:20 2008 (r185925) @@ -768,6 +768,10 @@ case "${targ}" in targ_defvec=bfd_elf32_littlemips_vec targ_selvecs="bfd_elf32_bigmips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec ecoff_little_vec ecoff_big_vec" ;; + mips*-*-freebsd*) + targ_defvec=bfd_elf32_tradbigmips_vec + targ_selvecs="bfd_elf32_tradlittlemips_vec bfd_elf32_ntradbigmisp_vec bfd_elf32_ntradlittlemips_vec bfd_elf64_tradbigmips_vec bfd_elf64_tradlittlemips_vec ecoff_big_vec ecoff_little_vec" + ;; mips*-*-netbsd*) targ_defvec=bfd_elf32_bigmips_vec targ_selvecs="bfd_elf32_littlemips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec ecoff_big_vec ecoff_little_vec" Modified: head/contrib/binutils/gas/config/tc-mips.c ============================================================================== --- head/contrib/binutils/gas/config/tc-mips.c Thu Dec 11 08:20:34 2008 (r185924) +++ head/contrib/binutils/gas/config/tc-mips.c Thu Dec 11 08:22:20 2008 (r185925) @@ -281,6 +281,9 @@ static int mips_32bitmode = 0; #define HAVE_64BIT_OBJECTS (mips_abi == N64_ABI) +/* True if relocations are stored in-place. */ +#define HAVE_IN_PLACE_ADDENDS (!HAVE_NEWABI) + /* We can only have 64bit addresses if the object file format supports it. */ #define HAVE_32BIT_ADDRESSES \ @@ -13020,6 +13023,26 @@ mips_fix_adjustable (fixS *fixp) if (fixp->fx_addsy == NULL) return 1; + /* If symbol SYM is in a mergeable section, relocations of the form + SYM + 0 can usually be made section-relative. The mergeable data + is then identified by the section offset rather than by the symbol. + + However, if we're generating REL LO16 relocations, the offset is split + between the LO16 and parterning high part relocation. The linker will + need to recalculate the complete offset in order to correctly identify + the merge data. + + The linker has traditionally not looked for the parterning high part + relocation, and has thus allowed orphaned R_MIPS_LO16 relocations to be + placed anywhere. Rather than break backwards compatibility by changing + this, it seems better not to force the issue, and instead keep the + original symbol. This will work with either linker behavior. */ + if ((fixp->fx_r_type == BFD_RELOC_LO16 + || reloc_needs_lo_p (fixp->fx_r_type)) + && HAVE_IN_PLACE_ADDENDS + && (S_GET_SEGMENT (fixp->fx_addsy)->flags & SEC_MERGE) != 0) + return 0; + #ifdef OBJ_ELF if (OUTPUT_FLAVOR == bfd_target_elf_flavour && S_GET_OTHER (fixp->fx_addsy) == STO_MIPS16 Added: head/contrib/binutils/ld/emulparams/elf32bmip_fbsd.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/binutils/ld/emulparams/elf32bmip_fbsd.sh Thu Dec 11 08:22:20 2008 (r185925) @@ -0,0 +1,3 @@ +. ${srcdir}/emulparams/elf32bmip.sh +. ${srcdir}/emulparams/elf_fbsd.sh +GENERATE_PIE_SCRIPT=yes