From owner-svn-ports-head@freebsd.org Tue Nov 29 13:44:48 2016 Return-Path: Delivered-To: svn-ports-head@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 49947C5BC22; Tue, 29 Nov 2016 13:44:48 +0000 (UTC) (envelope-from andrew@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 F32271372; Tue, 29 Nov 2016 13:44:47 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uATDilnM073800; Tue, 29 Nov 2016 13:44:47 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uATDilg5073798; Tue, 29 Nov 2016 13:44:47 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201611291344.uATDilg5073798@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 29 Nov 2016 13:44:47 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r427378 - in head/devel/binutils: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Nov 2016 13:44:48 -0000 Author: andrew (src committer) Date: Tue Nov 29 13:44:46 2016 New Revision: 427378 URL: https://svnweb.freebsd.org/changeset/ports/427378 Log: 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. Approved by: bapt Differential Revision: https://reviews.freebsd.org/D8622 Added: head/devel/binutils/files/patch-bfd_elfnn-aarch64.c (contents, props changed) Modified: head/devel/binutils/Makefile Modified: head/devel/binutils/Makefile ============================================================================== --- head/devel/binutils/Makefile Tue Nov 29 13:01:46 2016 (r427377) +++ head/devel/binutils/Makefile Tue Nov 29 13:44:46 2016 (r427378) @@ -3,7 +3,7 @@ PORTNAME= binutils PORTVERSION= 2.27 -PORTREVISION= 4 +PORTREVISION= 5 PORTEPOCH?= 1 CATEGORIES?= devel MASTER_SITES= SOURCEWARE/binutils/releases Added: head/devel/binutils/files/patch-bfd_elfnn-aarch64.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/binutils/files/patch-bfd_elfnn-aarch64.c Tue Nov 29 13:44:46 2016 (r427378) @@ -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: