summaryrefslogtreecommitdiff
path: root/core/binutils
diff options
context:
space:
mode:
authorNicolás Reynolds <fauno@endefensadelsl.org>2014-06-17 03:27:11 +0000
committerNicolás Reynolds <fauno@endefensadelsl.org>2014-06-17 03:27:11 +0000
commit6459b84bf754eda5323f40eb7af76dde65b63251 (patch)
tree81947a270848520d4cf2f9d1c5ce91ced54fcdff /core/binutils
parent942111e62628e9a5c4729563215b1cfb8911735e (diff)
Tue Jun 17 03:23:47 UTC 2014
Diffstat (limited to 'core/binutils')
-rw-r--r--core/binutils/PKGBUILD12
-rw-r--r--core/binutils/binutils-2.24-shared-pie.patch99
-rw-r--r--core/binutils/binutils-2.24-static-pie-hang.patch78
3 files changed, 105 insertions, 84 deletions
diff --git a/core/binutils/PKGBUILD b/core/binutils/PKGBUILD
index ba9f6327f..a227a791c 100644
--- a/core/binutils/PKGBUILD
+++ b/core/binutils/PKGBUILD
@@ -1,11 +1,11 @@
-# $Id: PKGBUILD 214772 2014-06-10 10:35:54Z allan $
+# $Id: PKGBUILD 215105 2014-06-14 08:08:00Z allan $
# Maintainer: Allan McRae <allan@archlinux.org>
# toolchain build order: linux-api-headers->glibc->binutils->gcc->binutils->glibc
pkgname=binutils
pkgver=2.24
-pkgrel=5
+pkgrel=6
pkgdesc="A set of programs to assemble and manipulate binary and object files"
arch=('i686' 'x86_64')
url="http://www.gnu.org/software/binutils/"
@@ -19,11 +19,11 @@ 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-static-pie-hang.patch)
+ binutils-2.24-shared-pie.patch)
md5sums=('e0f71a7b2ddab0f8612336ac81d9636b'
'SKIP'
'b16e895c24ff80acd98a21021eccefad'
- '4d2cf591560c3d25265778146bbe1941')
+ 'ec59461c4febab9cfe1c1ef33326bc50')
validpgpkeys=('EAF1C276A747E9ED86210CBAC3126D3B4AE55E93')
prepare() {
@@ -35,8 +35,8 @@ 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
+ # fix issues with -static -fPIE -pie - commit 4199e3b8
+ patch -p1 -i $srcdir/binutils-2.24-shared-pie.patch
mkdir ${srcdir}/binutils-build
}
diff --git a/core/binutils/binutils-2.24-shared-pie.patch b/core/binutils/binutils-2.24-shared-pie.patch
new file mode 100644
index 000000000..d40aa47e0
--- /dev/null
+++ b/core/binutils/binutils-2.24-shared-pie.patch
@@ -0,0 +1,99 @@
+diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em
+index 9a2fe89..13f86f0 100644
+--- a/ld/emultempl/elf32.em
++++ b/ld/emultempl/elf32.em
+@@ -1480,6 +1480,8 @@ gld${EMULATION_NAME}_before_allocation (void)
+ const char *rpath;
+ asection *sinterp;
+ bfd *abfd;
++ struct elf_link_hash_entry *ehdr_start = NULL;
++ struct bfd_link_hash_entry ehdr_start_save;
+
+ if (is_elf_hash_table (link_info.hash))
+ {
+@@ -1504,6 +1506,16 @@ gld${EMULATION_NAME}_before_allocation (void)
+ _bfd_elf_link_hash_hide_symbol (&link_info, h, TRUE);
+ if (ELF_ST_VISIBILITY (h->other) != STV_INTERNAL)
+ h->other = (h->other & ~ELF_ST_VISIBILITY (-1)) | STV_HIDDEN;
++ /* Don't leave the symbol undefined. Undefined hidden
++ symbols typically won't have dynamic relocations, but
++ we most likely will need dynamic relocations for
++ __ehdr_start if we are building a PIE or shared
++ library. */
++ ehdr_start = h;
++ ehdr_start_save = h->root;
++ h->root.type = bfd_link_hash_defined;
++ h->root.u.def.section = bfd_abs_section_ptr;
++ h->root.u.def.value = 0;
+ }
+ }
+
+@@ -1620,6 +1632,14 @@ ${ELF_INTERPRETER_SET_DEFAULT}
+
+ if (!bfd_elf_size_dynsym_hash_dynstr (link_info.output_bfd, &link_info))
+ einfo ("%P%F: failed to set dynamic section sizes: %E\n");
++
++ if (ehdr_start != NULL)
++ {
++ /* If we twiddled __ehdr_start to defined earlier, put it back
++ as it was. */
++ ehdr_start->root.type = ehdr_start_save.type;
++ ehdr_start->root.u = ehdr_start_save.u;
++ }
+ }
+
+ EOF
+diff --git a/ld/testsuite/ld-elf/ehdr_start-shared.d b/ld/testsuite/ld-elf/ehdr_start-shared.d
+new file mode 100644
+index 0000000..c17516a
+--- /dev/null
++++ b/ld/testsuite/ld-elf/ehdr_start-shared.d
+@@ -0,0 +1,9 @@
++#source: ehdr_start.s
++#ld: -e _start -shared
++#nm: -n
++#target: *-*-linux* *-*-gnu* *-*-nacl*
++#xfail: cris*-*-* frv-*-*
++
++#...
++[0-9a-f]*000 [Adrt] __ehdr_start
++#pass
+diff --git a/ld/testsuite/ld-elf/ehdr_start-userdef.d b/ld/testsuite/ld-elf/ehdr_start-userdef.d
+index 2a88e98..b58ae3f 100644
+--- a/ld/testsuite/ld-elf/ehdr_start-userdef.d
++++ b/ld/testsuite/ld-elf/ehdr_start-userdef.d
+@@ -2,6 +2,7 @@
+ #ld: -e _start -T ehdr_start-userdef.t
+ #readelf: -Ws
+ #target: *-*-linux* *-*-gnu* *-*-nacl*
++#xfail: frv-*-*
+
+ #...
+ Symbol table '\.symtab' contains [0-9]+ entries:
+diff --git a/ld/testsuite/ld-elf/ehdr_start-weak.d b/ld/testsuite/ld-elf/ehdr_start-weak.d
+index 8bd9035..24ae34c 100644
+--- a/ld/testsuite/ld-elf/ehdr_start-weak.d
++++ b/ld/testsuite/ld-elf/ehdr_start-weak.d
+@@ -2,6 +2,7 @@
+ #ld: -e _start -T ehdr_start-missing.t
+ #nm: -n
+ #target: *-*-linux* *-*-gnu* *-*-nacl*
++#xfail: frv-*-*
+
+ #...
+ \s+[wU] __ehdr_start
+diff --git a/ld/testsuite/ld-elf/ehdr_start.d b/ld/testsuite/ld-elf/ehdr_start.d
+index 52e5b54..d538b66 100644
+--- a/ld/testsuite/ld-elf/ehdr_start.d
++++ b/ld/testsuite/ld-elf/ehdr_start.d
+@@ -2,6 +2,7 @@
+ #ld: -e _start
+ #nm: -n
+ #target: *-*-linux* *-*-gnu* *-*-nacl*
++#xfail: frv-*-*
+
+ #...
+ [0-9a-f]*000 [Adrt] __ehdr_start
+--
+1.7.1
+
diff --git a/core/binutils/binutils-2.24-static-pie-hang.patch b/core/binutils/binutils-2.24-static-pie-hang.patch
deleted file mode 100644
index 512485e7c..000000000
--- a/core/binutils/binutils-2.24-static-pie-hang.patch
+++ /dev/null
@@ -1,78 +0,0 @@
-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;