From owner-svn-ports-branches@freebsd.org Wed Dec 7 02:52:14 2016 Return-Path: Delivered-To: svn-ports-branches@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2058C6AB5F; Wed, 7 Dec 2016 02:52:14 +0000 (UTC) (envelope-from junovitch@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7D58B1364; Wed, 7 Dec 2016 02:52:14 +0000 (UTC) (envelope-from junovitch@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB72qDIJ018488; Wed, 7 Dec 2016 02:52:13 GMT (envelope-from junovitch@FreeBSD.org) Received: (from junovitch@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB72qD39018486; Wed, 7 Dec 2016 02:52:13 GMT (envelope-from junovitch@FreeBSD.org) Message-Id: <201612070252.uB72qD39018486@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: junovitch set sender to junovitch@FreeBSD.org using -f From: Jason Unovitch Date: Wed, 7 Dec 2016 02:52:13 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-branches@freebsd.org Subject: svn commit: r428028 - in branches/2016Q4/devel/binutils: . files X-SVN-Group: ports-branches MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-branches@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the branches of the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Dec 2016 02:52:14 -0000 Author: junovitch Date: Wed Dec 7 02:52:13 2016 New Revision: 428028 URL: https://svnweb.freebsd.org/changeset/ports/428028 Log: MFH: r427378 Fix booting the arm64 kernel when built with clang 3.9.0 Clang 3.9.0 changes how weak extern is handled. They now use the got to handle them. This is a problem as ld.bfd doesn't fill out any default value in the got so pointers become NULL. This caused the kernel to fail to boot as we use this in linker sets. This fixes the issue by setting a default value in the got. The kernel still loads data through it, but because we always load it at a fixed virtual address the address it finds is valid. Requested by: andrew Approved by: ports-secteam (with hat), bapt Differential Revision: https://reviews.freebsd.org/D8622 Added: branches/2016Q4/devel/binutils/files/patch-bfd_elfnn-aarch64.c - copied unchanged from r427378, head/devel/binutils/files/patch-bfd_elfnn-aarch64.c Modified: branches/2016Q4/devel/binutils/Makefile Directory Properties: branches/2016Q4/ (props changed) Modified: branches/2016Q4/devel/binutils/Makefile ============================================================================== --- branches/2016Q4/devel/binutils/Makefile Wed Dec 7 02:35:13 2016 (r428027) +++ branches/2016Q4/devel/binutils/Makefile Wed Dec 7 02:52:13 2016 (r428028) @@ -3,7 +3,7 @@ PORTNAME= binutils PORTVERSION= 2.27 -PORTREVISION= 4 +PORTREVISION= 5 PORTEPOCH?= 1 CATEGORIES?= devel MASTER_SITES= SOURCEWARE/binutils/releases Copied: branches/2016Q4/devel/binutils/files/patch-bfd_elfnn-aarch64.c (from r427378, head/devel/binutils/files/patch-bfd_elfnn-aarch64.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/2016Q4/devel/binutils/files/patch-bfd_elfnn-aarch64.c Wed Dec 7 02:52:13 2016 (r428028, copy of r427378, head/devel/binutils/files/patch-bfd_elfnn-aarch64.c) @@ -0,0 +1,28 @@ +--- bfd/elfnn-aarch64.c.orig 2016-11-20 12:04:44.613621000 +0000 ++++ bfd/elfnn-aarch64.c 2016-11-20 12:05:01.143334000 +0000 +@@ -4369,7 +4369,9 @@ + off = h->got.offset; + BFD_ASSERT (off != (bfd_vma) - 1); + if (!WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, bfd_link_pic (info), h) +- || (bfd_link_pic (info) ++ || ((bfd_link_pic (info) ++ || (!bfd_link_relocatable (info) ++ && (info->export_dynamic || info->dynamic))) + && SYMBOL_REFERENCES_LOCAL (info, h)) + || (ELF_ST_VISIBILITY (h->other) + && h->root.type == bfd_link_hash_undefweak)) +@@ -8891,6 +8893,14 @@ + + h->root.u.def.section->output_section->vma + + h->root.u.def.section->output_offset); + } ++ else if (!bfd_link_relocatable (info) ++ && (info->export_dynamic || info->dynamic) ++ && SYMBOL_REFERENCES_LOCAL (info, h)) ++ { ++ BFD_ASSERT ((h->got.offset & 1) != 0); ++ rela.r_info = ELFNN_R_INFO (h->dynindx, AARCH64_R (GLOB_DAT)); ++ rela.r_addend = 0; ++ } + else + { + do_glob_dat: