Date: Tue, 29 Nov 2016 13:44:47 +0000 (UTC) From: Andrew Turner <andrew@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r427378 - in head/devel/binutils: . files Message-ID: <201611291344.uATDilg5073798@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201611291344.uATDilg5073798>