diff --git a/core/binutils/PKGBUILD b/core/binutils/PKGBUILD index ea1568101..e73c0987c 100644 --- a/core/binutils/PKGBUILD +++ b/core/binutils/PKGBUILD @@ -11,7 +11,7 @@ noautobuild=1 pkgname=binutils pkgver=2.24 -pkgrel=3 +pkgrel=4 pkgdesc="A set of programs to assemble and manipulate binary and object files" arch=('i686' 'x86_64') url="http://www.gnu.org/software/binutils/" @@ -22,10 +22,12 @@ checkdepends=('dejagnu') options=('staticlibs' '!distcc' '!ccache') install=binutils.install source=(ftp://ftp.gnu.org/gnu/binutils/binutils-${pkgver}.tar.bz2{,.sig} - binutils-2.24-lto-testsuite.patch) + binutils-2.24-lto-testsuite.patch + binutils-2.24-static-pie-hang.patch) md5sums=('e0f71a7b2ddab0f8612336ac81d9636b' 'SKIP' - 'b16e895c24ff80acd98a21021eccefad') + 'b16e895c24ff80acd98a21021eccefad' + '4d2cf591560c3d25265778146bbe1941') prepare() { cd ${srcdir}/binutils-${pkgver} @@ -36,6 +38,9 @@ prepare() { # fix lto testsuite with gcc-4.9 - commit b35d44f1 patch -p1 -i $srcdir/binutils-2.24-lto-testsuite.patch + # fix autoconf hang with -static -fPIE -pie - commits d1ec1e40 and 818d220a + patch -p1 -i $srcdir/binutils-2.24-static-pie-hang.patch + mkdir ${srcdir}/binutils-build } diff --git a/core/binutils/binutils-2.24-static-pie-hang.patch b/core/binutils/binutils-2.24-static-pie-hang.patch new file mode 100644 index 000000000..512485e7c --- /dev/null +++ b/core/binutils/binutils-2.24-static-pie-hang.patch @@ -0,0 +1,78 @@ +diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c +index 4d391e1..d7f59e5 100644 +--- a/bfd/elf32-i386.c ++++ b/bfd/elf32-i386.c +@@ -2368,8 +2368,13 @@ elf_i386_allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf) + + for (pp = &eh->dyn_relocs; (p = *pp) != NULL; ) + { +- p->count -= p->pc_count; +- p->pc_count = 0; ++ /* Don't update reloc count if there are any non ++ pc-relative relocs. */ ++ if (!h->pointer_equality_needed) ++ { ++ p->count -= p->pc_count; ++ p->pc_count = 0; ++ } + if (p->count == 0) + *pp = p->next; + else +diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c +index edee8ec..999011b 100644 +--- a/bfd/elf64-x86-64.c ++++ b/bfd/elf64-x86-64.c +@@ -2463,8 +2463,13 @@ elf_x86_64_allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf) + + for (pp = &eh->dyn_relocs; (p = *pp) != NULL; ) + { +- p->count -= p->pc_count; +- p->pc_count = 0; ++ /* Don't update reloc count if there are any non ++ pc-relative relocs. */ ++ if (!h->pointer_equality_needed) ++ { ++ p->count -= p->pc_count; ++ p->pc_count = 0; ++ } + if (p->count == 0) + *pp = p->next; + else +diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c +index 4d391e1..e834a5a 100644 +--- a/bfd/elf32-i386.c ++++ b/bfd/elf32-i386.c +@@ -2390,9 +2390,12 @@ elf_i386_allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf) + } + + /* Also discard relocs on undefined weak syms with non-default +- visibility. */ ++ visibility. Don't discard relocs against __ehdr_start which ++ will be defined by assign_file_positions_for_non_load_sections ++ later. */ + if (eh->dyn_relocs != NULL +- && h->root.type == bfd_link_hash_undefweak) ++ && h->root.type == bfd_link_hash_undefweak ++ && strcmp (h->root.root.string, "__ehdr_start") != 0) + { + if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT) + eh->dyn_relocs = NULL; +diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c +index edee8ec..f364fe4 100644 +--- a/bfd/elf64-x86-64.c ++++ b/bfd/elf64-x86-64.c +@@ -2473,9 +2473,12 @@ elf_x86_64_allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf) + } + + /* Also discard relocs on undefined weak syms with non-default +- visibility. */ ++ visibility. Don't discard relocs against __ehdr_start which ++ will be defined by assign_file_positions_for_non_load_sections ++ later. */ + if (eh->dyn_relocs != NULL +- && h->root.type == bfd_link_hash_undefweak) ++ && h->root.type == bfd_link_hash_undefweak ++ && strcmp (h->root.root.string, "__ehdr_start") != 0) + { + if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT) + eh->dyn_relocs = NULL;