svn commit: r428028 - in branches/2016Q4/devel/binutils: . files
Jason Unovitch
junovitch at FreeBSD.org
Wed Dec 7 02:52:14 UTC 2016
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:
More information about the svn-ports-branches
mailing list