binutils: Delete recipes for 2.22

We have 2.23.1 as default now.

(From OE-Core rev: a2f5a228422f9807fa21de88ad589853817695f8)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Khem Raj 2013-02-26 12:55:24 -08:00 committed by Richard Purdie
parent 68ddf00775
commit 0d2b60e2d6
37 changed files with 0 additions and 25429 deletions

View File

@ -1,51 +0,0 @@
PR = "r17"
LIC_FILES_CHKSUM="\
file://src-release;endline=17;md5=4830a9ef968f3b18dd5e9f2c00db2d35\
file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552\
file://COPYING.LIB;md5=9f604d8a4f8e74f4f5140845a21b6674\
file://COPYING3;md5=d32239bcb673463ab874e80d47fae504\
file://COPYING3.LIB;md5=6a6a8e020838b23406c81b19c1d46df6\
file://gas/COPYING;md5=d32239bcb673463ab874e80d47fae504\
file://include/COPYING;md5=59530bdf33659b29e73d4adb9f9f6552\
file://include/COPYING3;md5=d32239bcb673463ab874e80d47fae504\
file://libiberty/COPYING.LIB;md5=a916467b91076e631dd8edb7424769c7\
file://bfd/COPYING;md5=d32239bcb673463ab874e80d47fae504\
"
SRC_URI = "\
${GNU_MIRROR}/binutils/binutils-${PV}.tar.bz2 \
file://binutils-uclibc-100-uclibc-conf.patch \
file://binutils-uclibc-300-001_ld_makefile_patch.patch \
file://binutils-uclibc-300-006_better_file_error.patch \
file://binutils-uclibc-300-012_check_ldrunpath_length.patch \
file://binutils-uclibc-gas-needs-libm.patch \
file://binutils-x86_64_i386_biarch.patch \
file://libtool-2.4-update.patch \
file://binutils-2.19.1-ld-sysroot.patch \
file://libiberty_path_fix.patch \
file://binutils-poison.patch \
file://libtool-rpath-fix.patch \
file://clone-shadow.patch \
file://binutils-powerpc-e5500.patch \
file://binutils-armv5e.patch \
file://mips64-default-ld-emulation.patch \
file://0001-PR-ld-13470.patch \
file://rpath-sysroot.patch \
file://0006-mips-dis.c-print_insn_micromips-Rename-local-variabl.patch \
file://0019-PR-ld-13468.patch \
file://0028-Backport-from-mainline.patch \
file://0035-2011-12-19-Chung-Lin-Tang-cltang-codesourcery.com.patch \
file://0036-2011-12-19-Chung-Lin-Tang-cltang-codesourcery.com.patch \
file://0037-2011-12-19-Chung-Lin-Tang-cltang-codesourcery.com.patch \
file://0039-emulparams-elf32bmip.sh-OTHER_SECTIONS-Put-.mdebug.-.patch \
file://0052-gas.patch \
file://0055-Remove-ABI_64_P-check-on-R_X86_64_PCXX.patch \
file://0078-PR-binutils-13622.patch \
file://0144-timer.cc-include-unistd.h.patch \
file://0166-2012-04-27-Doug-Kwan-dougkwan-google.com.patch \
file://0182-PR-ld-13991.patch \
"
SRC_URI[md5sum] = "ee0f10756c84979622b992a4a61ea3f5"
SRC_URI[sha256sum] = "6c7af8ed1c8cf9b4b9d6e6fe09a3e1d3d479fe63984ba8b9b26bf356b6313ca9"

View File

@ -1,3 +0,0 @@
require binutils.inc
require binutils-${PV}.inc
require binutils-cross-canadian.inc

View File

@ -1,3 +0,0 @@
require binutils.inc
require binutils-${PV}.inc
require binutils-cross.inc

View File

@ -1,14 +0,0 @@
require binutils-cross_${PV}.bb
inherit crosssdk
PR = "r1"
PROVIDES = "virtual/${TARGET_PREFIX}binutils-crosssdk"
SRC_URI += "file://relocatable_sdk.patch"
do_configure_prepend () {
sed -i 's#/usr/local/lib /lib /usr/lib#${SDKPATHNATIVE}/lib ${SDKPATHNATIVE}/usr/lib /usr/local/lib /lib /usr/lib#' ${S}/ld/configure.tgt
}

View File

@ -1,82 +0,0 @@
From 82fdddd1c4e37881db9b4c6a944261521c6f10ac Mon Sep 17 00:00:00 2001
From: Alan Modra <amodra@bigpond.net.au>
Date: Sat, 3 Dec 2011 00:57:59 +0000
Subject: [PATCH] PR ld/13470 * elf32-ppc.c
(ppc_elf_copy_indirect_symbol): Revert substantive
change in 2011-07-01 commit. Comment. *
elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Likewise.
---
bfd/ChangeLog | 7 +++++++
bfd/elf32-ppc.c | 14 ++++++++++----
bfd/elf64-ppc.c | 14 ++++++++++----
3 files changed, 27 insertions(+), 8 deletions(-)
Upstream-Status: Backport
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Index: binutils-2.22/bfd/elf32-ppc.c
===================================================================
--- binutils-2.22.orig/bfd/elf32-ppc.c 2011-11-21 01:29:21.000000000 -0800
+++ binutils-2.22/bfd/elf32-ppc.c 2012-05-31 14:28:48.273784929 -0700
@@ -2987,10 +2987,6 @@
edir->elf.needs_plt |= eind->elf.needs_plt;
edir->elf.pointer_equality_needed |= eind->elf.pointer_equality_needed;
- /* If we were called to copy over info for a weak sym, that's all. */
- if (eind->elf.root.type != bfd_link_hash_indirect)
- return;
-
if (eind->dyn_relocs != NULL)
{
if (edir->dyn_relocs != NULL)
@@ -3022,6 +3018,16 @@
eind->dyn_relocs = NULL;
}
+ /* If we were called to copy over info for a weak sym, that's all.
+ You might think dyn_relocs need not be copied over; After all,
+ both syms will be dynamic or both non-dynamic so we're just
+ moving reloc accounting around. However, ELIMINATE_COPY_RELOCS
+ code in ppc_elf_adjust_dynamic_symbol needs to check for
+ dyn_relocs in read-only sections, and it does so on what is the
+ DIR sym here. */
+ if (eind->elf.root.type != bfd_link_hash_indirect)
+ return;
+
/* Copy over the GOT refcount entries that we may have already seen to
the symbol which just became indirect. */
edir->elf.got.refcount += eind->elf.got.refcount;
Index: binutils-2.22/bfd/elf64-ppc.c
===================================================================
--- binutils-2.22.orig/bfd/elf64-ppc.c 2011-11-21 01:29:24.000000000 -0800
+++ binutils-2.22/bfd/elf64-ppc.c 2012-05-31 14:28:48.285784951 -0700
@@ -4435,10 +4435,6 @@
edir->elf.ref_regular_nonweak |= eind->elf.ref_regular_nonweak;
edir->elf.needs_plt |= eind->elf.needs_plt;
- /* If we were called to copy over info for a weak sym, that's all. */
- if (eind->elf.root.type != bfd_link_hash_indirect)
- return;
-
/* Copy over any dynamic relocs we may have on the indirect sym. */
if (eind->dyn_relocs != NULL)
{
@@ -4471,6 +4467,16 @@
eind->dyn_relocs = NULL;
}
+ /* If we were called to copy over info for a weak sym, that's all.
+ You might think dyn_relocs need not be copied over; After all,
+ both syms will be dynamic or both non-dynamic so we're just
+ moving reloc accounting around. However, ELIMINATE_COPY_RELOCS
+ code in ppc64_elf_adjust_dynamic_symbol needs to check for
+ dyn_relocs in read-only sections, and it does so on what is the
+ DIR sym here. */
+ if (eind->elf.root.type != bfd_link_hash_indirect)
+ return;
+
/* Copy over got entries that we may have already seen to the
symbol which just became indirect. */
if (eind->elf.got.glist != NULL)

View File

@ -1,634 +0,0 @@
Upstream-Status: Backport
From f72b2c498bc98f42048a3bf7f7d7891db9cabcfc Mon Sep 17 00:00:00 2001
From: Pierre Muller <muller@ics.u-strasbg.fr>
Date: Fri, 25 Nov 2011 16:57:32 +0000
Subject: [PATCH 006/262] * mips-dis.c (print_insn_micromips): Rename
local variable iprintf to infprintf to
avoid shadow warning.
---
opcodes/ChangeLog | 5 ++
opcodes/mips-dis.c | 188 ++++++++++++++++++++++++++--------------------------
2 files changed, 99 insertions(+), 94 deletions(-)
2011-11-25 Pierre Muller <muller@ics.u-strasbg.fr>
* mips-dis.c (print_insn_micromips): Rename local variable iprintf
to infprintf to avoid shadow warning.
diff --git a/opcodes/mips-dis.c b/opcodes/mips-dis.c
index 4e18d8a..72285de 100644
--- a/opcodes/mips-dis.c
+++ b/opcodes/mips-dis.c
@@ -2260,7 +2260,7 @@ print_insn_mips16 (bfd_vma memaddr, struct disassemble_info *info)
static int
print_insn_micromips (bfd_vma memaddr, struct disassemble_info *info)
{
- const fprintf_ftype iprintf = info->fprintf_func;
+ const fprintf_ftype infprintf = info->fprintf_func;
const struct mips_opcode *op, *opend;
unsigned int lsb, msbd, msb;
void *is = info->stream;
@@ -2307,7 +2307,7 @@ print_insn_micromips (bfd_vma memaddr, struct disassemble_info *info)
status = (*info->read_memory_func) (memaddr + 2, buffer, 2, info);
if (status != 0)
{
- iprintf (is, "micromips 0x%x", higher);
+ infprintf (is, "micromips 0x%x", higher);
(*info->memory_error_func) (status, memaddr + 2, info);
return -1;
}
@@ -2320,7 +2320,7 @@ print_insn_micromips (bfd_vma memaddr, struct disassemble_info *info)
status = (*info->read_memory_func) (memaddr + 4, buffer, 2, info);
if (status != 0)
{
- iprintf (is, "micromips 0x%x", higher);
+ infprintf (is, "micromips 0x%x", higher);
(*info->memory_error_func) (status, memaddr + 4, info);
return -1;
}
@@ -2328,7 +2328,7 @@ print_insn_micromips (bfd_vma memaddr, struct disassemble_info *info)
insn = bfd_getb16 (buffer);
else
insn = bfd_getl16 (buffer);
- iprintf (is, "0x%x%04x (48-bit insn)", higher, insn);
+ infprintf (is, "0x%x%04x (48-bit insn)", higher, insn);
info->insn_type = dis_noninsn;
return 6;
@@ -2341,7 +2341,7 @@ print_insn_micromips (bfd_vma memaddr, struct disassemble_info *info)
status = (*info->read_memory_func) (memaddr + 2, buffer, 2, info);
if (status != 0)
{
- iprintf (is, "micromips 0x%x", higher);
+ infprintf (is, "micromips 0x%x", higher);
(*info->memory_error_func) (status, memaddr + 2, info);
return -1;
}
@@ -2371,9 +2371,9 @@ print_insn_micromips (bfd_vma memaddr, struct disassemble_info *info)
{
const char *s;
- iprintf (is, "%s", op->name);
+ infprintf (is, "%s", op->name);
if (op->args[0] != '\0')
- iprintf (is, "\t");
+ infprintf (is, "\t");
for (s = op->args; *s != '\0'; s++)
{
@@ -2382,37 +2382,37 @@ print_insn_micromips (bfd_vma memaddr, struct disassemble_info *info)
case ',':
case '(':
case ')':
- iprintf (is, "%c", *s);
+ infprintf (is, "%c", *s);
break;
case '.':
delta = GET_OP (insn, OFFSET10);
if (delta & 0x200)
delta |= ~0x3ff;
- iprintf (is, "%d", delta);
+ infprintf (is, "%d", delta);
break;
case '1':
- iprintf (is, "0x%lx", GET_OP (insn, STYPE));
+ infprintf (is, "0x%lx", GET_OP (insn, STYPE));
break;
case '<':
- iprintf (is, "0x%lx", GET_OP (insn, SHAMT));
+ infprintf (is, "0x%lx", GET_OP (insn, SHAMT));
break;
case '\\':
- iprintf (is, "0x%lx", GET_OP (insn, 3BITPOS));
+ infprintf (is, "0x%lx", GET_OP (insn, 3BITPOS));
break;
case '|':
- iprintf (is, "0x%lx", GET_OP (insn, TRAP));
+ infprintf (is, "0x%lx", GET_OP (insn, TRAP));
break;
case '~':
delta = GET_OP (insn, OFFSET12);
if (delta & 0x800)
delta |= ~0x7ff;
- iprintf (is, "%d", delta);
+ infprintf (is, "%d", delta);
break;
case 'a':
@@ -2433,34 +2433,34 @@ print_insn_micromips (bfd_vma memaddr, struct disassemble_info *info)
case 'r':
case 's':
case 'v':
- iprintf (is, "%s", mips_gpr_names[GET_OP (insn, RS)]);
+ infprintf (is, "%s", mips_gpr_names[GET_OP (insn, RS)]);
break;
case 'c':
- iprintf (is, "0x%lx", GET_OP (insn, CODE));
+ infprintf (is, "0x%lx", GET_OP (insn, CODE));
break;
case 'd':
- iprintf (is, "%s", mips_gpr_names[GET_OP (insn, RD)]);
+ infprintf (is, "%s", mips_gpr_names[GET_OP (insn, RD)]);
break;
case 'h':
- iprintf (is, "0x%lx", GET_OP (insn, PREFX));
+ infprintf (is, "0x%lx", GET_OP (insn, PREFX));
break;
case 'i':
case 'u':
- iprintf (is, "0x%lx", GET_OP (insn, IMMEDIATE));
+ infprintf (is, "0x%lx", GET_OP (insn, IMMEDIATE));
break;
case 'j': /* Same as i, but sign-extended. */
case 'o':
delta = (GET_OP (insn, DELTA) ^ 0x8000) - 0x8000;
- iprintf (is, "%d", delta);
+ infprintf (is, "%d", delta);
break;
case 'k':
- iprintf (is, "0x%x", GET_OP (insn, CACHE));
+ infprintf (is, "0x%x", GET_OP (insn, CACHE));
break;
case 'n':
@@ -2472,26 +2472,26 @@ print_insn_micromips (bfd_vma memaddr, struct disassemble_info *info)
if (s_reg_encode != 0)
{
if (s_reg_encode == 1)
- iprintf (is, "%s", mips_gpr_names[16]);
+ infprintf (is, "%s", mips_gpr_names[16]);
else if (s_reg_encode < 9)
- iprintf (is, "%s-%s",
+ infprintf (is, "%s-%s",
mips_gpr_names[16],
mips_gpr_names[15 + s_reg_encode]);
else if (s_reg_encode == 9)
- iprintf (is, "%s-%s,%s",
+ infprintf (is, "%s-%s,%s",
mips_gpr_names[16],
mips_gpr_names[23],
mips_gpr_names[30]);
else
- iprintf (is, "UNKNOWN");
+ infprintf (is, "UNKNOWN");
}
if (immed & 0x10) /* For ra. */
{
if (s_reg_encode == 0)
- iprintf (is, "%s", mips_gpr_names[31]);
+ infprintf (is, "%s", mips_gpr_names[31]);
else
- iprintf (is, ",%s", mips_gpr_names[31]);
+ infprintf (is, ",%s", mips_gpr_names[31]);
}
break;
}
@@ -2504,32 +2504,32 @@ print_insn_micromips (bfd_vma memaddr, struct disassemble_info *info)
break;
case 'q':
- iprintf (is, "0x%lx", GET_OP (insn, CODE2));
+ infprintf (is, "0x%lx", GET_OP (insn, CODE2));
break;
case 't':
case 'w':
- iprintf (is, "%s", mips_gpr_names[GET_OP (insn, RT)]);
+ infprintf (is, "%s", mips_gpr_names[GET_OP (insn, RT)]);
break;
case 'y':
- iprintf (is, "%s", mips_gpr_names[GET_OP (insn, RS3)]);
+ infprintf (is, "%s", mips_gpr_names[GET_OP (insn, RS3)]);
break;
case 'z':
- iprintf (is, "%s", mips_gpr_names[0]);
+ infprintf (is, "%s", mips_gpr_names[0]);
break;
case 'B':
- iprintf (is, "0x%lx", GET_OP (insn, CODE10));
+ infprintf (is, "0x%lx", GET_OP (insn, CODE10));
break;
case 'C':
- iprintf (is, "0x%lx", GET_OP (insn, COPZ));
+ infprintf (is, "0x%lx", GET_OP (insn, COPZ));
break;
case 'D':
- iprintf (is, "%s", mips_fpr_names[GET_OP (insn, FD)]);
+ infprintf (is, "%s", mips_fpr_names[GET_OP (insn, FD)]);
break;
case 'E':
@@ -2540,7 +2540,7 @@ print_insn_micromips (bfd_vma memaddr, struct disassemble_info *info)
'T' format. Therefore, until we gain understanding of
cp2 register names, we can simply print the register
numbers. */
- iprintf (is, "$%ld", GET_OP (insn, RT));
+ infprintf (is, "$%ld", GET_OP (insn, RT));
break;
case 'G':
@@ -2559,44 +2559,44 @@ print_insn_micromips (bfd_vma memaddr, struct disassemble_info *info)
case 0x000002fc: /* mtc0 */
case 0x580000fc: /* dmfc0 */
case 0x580002fc: /* dmtc0 */
- iprintf (is, "%s", mips_cp0_names[GET_OP (insn, RS)]);
+ infprintf (is, "%s", mips_cp0_names[GET_OP (insn, RS)]);
break;
default:
- iprintf (is, "$%ld", GET_OP (insn, RS));
+ infprintf (is, "$%ld", GET_OP (insn, RS));
break;
}
break;
case 'H':
- iprintf (is, "%ld", GET_OP (insn, SEL));
+ infprintf (is, "%ld", GET_OP (insn, SEL));
break;
case 'K':
- iprintf (is, "%s", mips_hwr_names[GET_OP (insn, RS)]);
+ infprintf (is, "%s", mips_hwr_names[GET_OP (insn, RS)]);
break;
case 'M':
- iprintf (is, "$fcc%ld", GET_OP (insn, CCC));
+ infprintf (is, "$fcc%ld", GET_OP (insn, CCC));
break;
case 'N':
- iprintf (is,
+ infprintf (is,
(op->pinfo & (FP_D | FP_S)) != 0
? "$fcc%ld" : "$cc%ld",
GET_OP (insn, BCC));
break;
case 'R':
- iprintf (is, "%s", mips_fpr_names[GET_OP (insn, FR)]);
+ infprintf (is, "%s", mips_fpr_names[GET_OP (insn, FR)]);
break;
case 'S':
case 'V':
- iprintf (is, "%s", mips_fpr_names[GET_OP (insn, FS)]);
+ infprintf (is, "%s", mips_fpr_names[GET_OP (insn, FS)]);
break;
case 'T':
- iprintf (is, "%s", mips_fpr_names[GET_OP (insn, FT)]);
+ infprintf (is, "%s", mips_fpr_names[GET_OP (insn, FT)]);
break;
case '+':
@@ -2606,18 +2606,18 @@ print_insn_micromips (bfd_vma memaddr, struct disassemble_info *info)
{
case 'A':
lsb = GET_OP (insn, EXTLSB);
- iprintf (is, "0x%x", lsb);
+ infprintf (is, "0x%x", lsb);
break;
case 'B':
msb = GET_OP (insn, INSMSB);
- iprintf (is, "0x%x", msb - lsb + 1);
+ infprintf (is, "0x%x", msb - lsb + 1);
break;
case 'C':
case 'H':
msbd = GET_OP (insn, EXTMSBD);
- iprintf (is, "0x%x", msbd + 1);
+ infprintf (is, "0x%x", msbd + 1);
break;
case 'D':
@@ -2637,30 +2637,30 @@ print_insn_micromips (bfd_vma memaddr, struct disassemble_info *info)
mips_cp0sel_names_len,
cp0reg, sel);
if (n != NULL)
- iprintf (is, "%s", n->name);
+ infprintf (is, "%s", n->name);
else
- iprintf (is, "$%d,%d", cp0reg, sel);
+ infprintf (is, "$%d,%d", cp0reg, sel);
break;
}
case 'E':
lsb = GET_OP (insn, EXTLSB) + 32;
- iprintf (is, "0x%x", lsb);
+ infprintf (is, "0x%x", lsb);
break;
case 'F':
msb = GET_OP (insn, INSMSB) + 32;
- iprintf (is, "0x%x", msb - lsb + 1);
+ infprintf (is, "0x%x", msb - lsb + 1);
break;
case 'G':
msbd = GET_OP (insn, EXTMSBD) + 32;
- iprintf (is, "0x%x", msbd + 1);
+ infprintf (is, "0x%x", msbd + 1);
break;
default:
/* xgettext:c-format */
- iprintf (is,
+ infprintf (is,
_("# internal disassembler error, "
"unrecognized modifier (+%c)"),
*s);
@@ -2674,111 +2674,111 @@ print_insn_micromips (bfd_vma memaddr, struct disassemble_info *info)
switch (*s)
{
case 'a': /* global pointer. */
- iprintf (is, "%s", mips_gpr_names[28]);
+ infprintf (is, "%s", mips_gpr_names[28]);
break;
case 'b':
regno = micromips_to_32_reg_b_map[GET_OP (insn, MB)];
- iprintf (is, "%s", mips_gpr_names[regno]);
+ infprintf (is, "%s", mips_gpr_names[regno]);
break;
case 'c':
regno = micromips_to_32_reg_c_map[GET_OP (insn, MC)];
- iprintf (is, "%s", mips_gpr_names[regno]);
+ infprintf (is, "%s", mips_gpr_names[regno]);
break;
case 'd':
regno = micromips_to_32_reg_d_map[GET_OP (insn, MD)];
- iprintf (is, "%s", mips_gpr_names[regno]);
+ infprintf (is, "%s", mips_gpr_names[regno]);
break;
case 'e':
regno = micromips_to_32_reg_e_map[GET_OP (insn, ME)];
- iprintf (is, "%s", mips_gpr_names[regno]);
+ infprintf (is, "%s", mips_gpr_names[regno]);
break;
case 'f':
/* Save lastregno for "mt" to print out later. */
lastregno = micromips_to_32_reg_f_map[GET_OP (insn, MF)];
- iprintf (is, "%s", mips_gpr_names[lastregno]);
+ infprintf (is, "%s", mips_gpr_names[lastregno]);
break;
case 'g':
regno = micromips_to_32_reg_g_map[GET_OP (insn, MG)];
- iprintf (is, "%s", mips_gpr_names[regno]);
+ infprintf (is, "%s", mips_gpr_names[regno]);
break;
case 'h':
regno = micromips_to_32_reg_h_map[GET_OP (insn, MH)];
- iprintf (is, "%s", mips_gpr_names[regno]);
+ infprintf (is, "%s", mips_gpr_names[regno]);
break;
case 'i':
regno = micromips_to_32_reg_i_map[GET_OP (insn, MI)];
- iprintf (is, "%s", mips_gpr_names[regno]);
+ infprintf (is, "%s", mips_gpr_names[regno]);
break;
case 'j':
- iprintf (is, "%s", mips_gpr_names[GET_OP (insn, MJ)]);
+ infprintf (is, "%s", mips_gpr_names[GET_OP (insn, MJ)]);
break;
case 'l':
regno = micromips_to_32_reg_l_map[GET_OP (insn, ML)];
- iprintf (is, "%s", mips_gpr_names[regno]);
+ infprintf (is, "%s", mips_gpr_names[regno]);
break;
case 'm':
regno = micromips_to_32_reg_m_map[GET_OP (insn, MM)];
- iprintf (is, "%s", mips_gpr_names[regno]);
+ infprintf (is, "%s", mips_gpr_names[regno]);
break;
case 'n':
regno = micromips_to_32_reg_n_map[GET_OP (insn, MN)];
- iprintf (is, "%s", mips_gpr_names[regno]);
+ infprintf (is, "%s", mips_gpr_names[regno]);
break;
case 'p':
/* Save lastregno for "mt" to print out later. */
lastregno = GET_OP (insn, MP);
- iprintf (is, "%s", mips_gpr_names[lastregno]);
+ infprintf (is, "%s", mips_gpr_names[lastregno]);
break;
case 'q':
regno = micromips_to_32_reg_q_map[GET_OP (insn, MQ)];
- iprintf (is, "%s", mips_gpr_names[regno]);
+ infprintf (is, "%s", mips_gpr_names[regno]);
break;
case 'r': /* program counter. */
- iprintf (is, "$pc");
+ infprintf (is, "$pc");
break;
case 's': /* stack pointer. */
lastregno = 29;
- iprintf (is, "%s", mips_gpr_names[29]);
+ infprintf (is, "%s", mips_gpr_names[29]);
break;
case 't':
- iprintf (is, "%s", mips_gpr_names[lastregno]);
+ infprintf (is, "%s", mips_gpr_names[lastregno]);
break;
case 'z': /* $0. */
- iprintf (is, "%s", mips_gpr_names[0]);
+ infprintf (is, "%s", mips_gpr_names[0]);
break;
case 'A':
/* Sign-extend the immediate. */
immed = ((GET_OP (insn, IMMA) ^ 0x40) - 0x40) << 2;
- iprintf (is, "%d", immed);
+ infprintf (is, "%d", immed);
break;
case 'B':
immed = micromips_imm_b_map[GET_OP (insn, IMMB)];
- iprintf (is, "%d", immed);
+ infprintf (is, "%d", immed);
break;
case 'C':
immed = micromips_imm_c_map[GET_OP (insn, IMMC)];
- iprintf (is, "0x%lx", immed);
+ infprintf (is, "0x%lx", immed);
break;
case 'D':
@@ -2797,50 +2797,50 @@ print_insn_micromips (bfd_vma memaddr, struct disassemble_info *info)
case 'F':
immed = GET_OP (insn, IMMF);
- iprintf (is, "0x%x", immed);
+ infprintf (is, "0x%x", immed);
break;
case 'G':
immed = (insn >> MICROMIPSOP_SH_IMMG) + 1;
immed = (immed & MICROMIPSOP_MASK_IMMG) - 1;
- iprintf (is, "%d", immed);
+ infprintf (is, "%d", immed);
break;
case 'H':
immed = GET_OP (insn, IMMH) << 1;
- iprintf (is, "%d", immed);
+ infprintf (is, "%d", immed);
break;
case 'I':
immed = (insn >> MICROMIPSOP_SH_IMMI) + 1;
immed = (immed & MICROMIPSOP_MASK_IMMI) - 1;
- iprintf (is, "%d", immed);
+ infprintf (is, "%d", immed);
break;
case 'J':
immed = GET_OP (insn, IMMJ) << 2;
- iprintf (is, "%d", immed);
+ infprintf (is, "%d", immed);
break;
case 'L':
immed = GET_OP (insn, IMML);
- iprintf (is, "%d", immed);
+ infprintf (is, "%d", immed);
break;
case 'M':
immed = (insn >> MICROMIPSOP_SH_IMMM) - 1;
immed = (immed & MICROMIPSOP_MASK_IMMM) + 1;
- iprintf (is, "%d", immed);
+ infprintf (is, "%d", immed);
break;
case 'N':
immed = GET_OP (insn, IMMN);
if (immed == 0)
- iprintf (is, "%s,%s",
+ infprintf (is, "%s,%s",
mips_gpr_names[16],
mips_gpr_names[31]);
else
- iprintf (is, "%s-%s,%s",
+ infprintf (is, "%s-%s,%s",
mips_gpr_names[16],
mips_gpr_names[16 + immed],
mips_gpr_names[31]);
@@ -2848,35 +2848,35 @@ print_insn_micromips (bfd_vma memaddr, struct disassemble_info *info)
case 'O':
immed = GET_OP (insn, IMMO);
- iprintf (is, "0x%x", immed);
+ infprintf (is, "0x%x", immed);
break;
case 'P':
immed = GET_OP (insn, IMMP) << 2;
- iprintf (is, "%d", immed);
+ infprintf (is, "%d", immed);
break;
case 'Q':
/* Sign-extend the immediate. */
immed = (GET_OP (insn, IMMQ) ^ 0x400000) - 0x400000;
immed <<= 2;
- iprintf (is, "%d", immed);
+ infprintf (is, "%d", immed);
break;
case 'U':
immed = GET_OP (insn, IMMU) << 2;
- iprintf (is, "%d", immed);
+ infprintf (is, "%d", immed);
break;
case 'W':
immed = GET_OP (insn, IMMW) << 2;
- iprintf (is, "%d", immed);
+ infprintf (is, "%d", immed);
break;
case 'X':
/* Sign-extend the immediate. */
immed = (GET_OP (insn, IMMX) ^ 0x8) - 0x8;
- iprintf (is, "%d", immed);
+ infprintf (is, "%d", immed);
break;
case 'Y':
@@ -2885,12 +2885,12 @@ print_insn_micromips (bfd_vma memaddr, struct disassemble_info *info)
if (immed >= -2 && immed <= 1)
immed ^= 0x100;
immed = immed << 2;
- iprintf (is, "%d", immed);
+ infprintf (is, "%d", immed);
break;
default:
/* xgettext:c-format */
- iprintf (is,
+ infprintf (is,
_("# internal disassembler error, "
"unrecognized modifier (m%c)"),
*s);
@@ -2900,7 +2900,7 @@ print_insn_micromips (bfd_vma memaddr, struct disassemble_info *info)
default:
/* xgettext:c-format */
- iprintf (is,
+ infprintf (is,
_("# internal disassembler error, "
"unrecognized modifier (%c)"),
*s);
@@ -2937,7 +2937,7 @@ print_insn_micromips (bfd_vma memaddr, struct disassemble_info *info)
}
#undef GET_OP
- iprintf (is, "0x%x", insn);
+ infprintf (is, "0x%x", insn);
info->insn_type = dis_noninsn;
return length;
--
1.7.9.5

View File

@ -1,46 +0,0 @@
Upstream-Status: Backport
From 4c362e4511c4046e230fc9e330bf086753f04338 Mon Sep 17 00:00:00 2001
From: Alan Modra <amodra@bigpond.net.au>
Date: Sat, 3 Dec 2011 10:29:17 +0000
Subject: [PATCH 019/262] PR ld/13468 * elflink.c
(bfd_elf_final_link): Don't segfault when checking
for DT_TEXTREL and .dynamic does not exist.
---
bfd/ChangeLog | 6 ++++++
bfd/elflink.c | 9 +++------
2 files changed, 9 insertions(+), 6 deletions(-)
2011-12-03 Alan Modra <amodra@gmail.com>
PR ld/13468
* elflink.c (bfd_elf_final_link): Don't segfault when checking
for DT_TEXTREL and .dynamic does not exist.
diff --git a/bfd/elflink.c b/bfd/elflink.c
index fc4266b..8556cec 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -11188,15 +11188,12 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info)
goto error_return;
/* Check for DT_TEXTREL (late, in case the backend removes it). */
- if ((info->warn_shared_textrel && info->shared)
- || info->error_textrel)
+ if (((info->warn_shared_textrel && info->shared)
+ || info->error_textrel)
+ && (o = bfd_get_section_by_name (dynobj, ".dynamic")) != NULL)
{
bfd_byte *dyncon, *dynconend;
- /* Fix up .dynamic entries. */
- o = bfd_get_section_by_name (dynobj, ".dynamic");
- BFD_ASSERT (o != NULL);
-
dyncon = o->contents;
dynconend = o->contents + o->size;
for (; dyncon < dynconend; dyncon += bed->s->sizeof_dyn)
--
1.7.9.5

View File

@ -1,139 +0,0 @@
Upstream-Status: Backport
From fbd07e4e15de7a81a2de7f9583fa3240302e2867 Mon Sep 17 00:00:00 2001
From: David Daney <ddaney@avtrex.com>
Date: Sun, 11 Dec 2011 02:28:10 +0000
Subject: [PATCH 028/262] Backport from mainline:
2011-12-10 David Daney <david.daney@cavium.com>
* elfxx-mips.c (mips_elf_link_hash_table.rld_value): Remove.
(mips_elf_link_hash_table.rld_symbol): New field;
(MIPS_ELF_RLD_MAP_SIZE): New macro.
(_bfd_mips_elf_add_symbol_hook): Remember __rld_obj_head symbol
in rld_symbol.
(_bfd_mips_elf_create_dynamic_sections): Remember __rld_map symbol
in rld_symbol.
(_bfd_mips_elf_size_dynamic_sections): Set correct size for .rld_map.
(_bfd_mips_elf_finish_dynamic_symbol): Remove .rld_map handling.
(_bfd_mips_elf_finish_dynamic_sections): Use rld_symbol to
calculate DT_MIPS_RLD_MAP value.
(_bfd_mips_elf_link_hash_table_create): Initialize rld_symbol,
quit initializing rld_value.
diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c
index 33a454d..6b908ad 100644
--- a/bfd/elfxx-mips.c
+++ b/bfd/elfxx-mips.c
@@ -436,8 +436,8 @@ struct mips_elf_link_hash_table
entry is set to the address of __rld_obj_head as in IRIX5. */
bfd_boolean use_rld_obj_head;
- /* This is the value of the __rld_map or __rld_obj_head symbol. */
- bfd_vma rld_value;
+ /* The __rld_map or __rld_obj_head symbol. */
+ struct elf_link_hash_entry *rld_symbol;
/* This is set if we see any mips16 stub sections. */
bfd_boolean mips16_stubs_seen;
@@ -768,6 +768,10 @@ static bfd *reldyn_sorting_bfd;
#define MIPS_ELF_GOT_SIZE(abfd) \
(get_elf_backend_data (abfd)->s->arch_size / 8)
+/* The size of the .rld_map section. */
+#define MIPS_ELF_RLD_MAP_SIZE(abfd) \
+ (get_elf_backend_data (abfd)->s->arch_size / 8)
+
/* The size of a symbol-table entry. */
#define MIPS_ELF_SYM_SIZE(abfd) \
(get_elf_backend_data (abfd)->s->sizeof_sym)
@@ -7081,6 +7085,7 @@ _bfd_mips_elf_add_symbol_hook (bfd *abfd, struct bfd_link_info *info,
return FALSE;
mips_elf_hash_table (info)->use_rld_obj_head = TRUE;
+ mips_elf_hash_table (info)->rld_symbol = h;
}
/* If this is a mips16 text symbol, add 1 to the value to make it
@@ -7266,6 +7271,7 @@ _bfd_mips_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
if (! bfd_elf_link_record_dynamic_symbol (info, h))
return FALSE;
+ mips_elf_hash_table (info)->rld_symbol = h;
}
}
@@ -9027,7 +9033,7 @@ _bfd_mips_elf_size_dynamic_sections (bfd *output_bfd,
{
/* We add a room for __rld_map. It will be filled in by the
rtld to contain a pointer to the _r_debug structure. */
- s->size += 4;
+ s->size += MIPS_ELF_RLD_MAP_SIZE (output_bfd);
}
else if (SGI_COMPAT (output_bfd)
&& CONST_STRNEQ (name, ".compact_rel"))
@@ -10030,31 +10036,6 @@ _bfd_mips_elf_finish_dynamic_symbol (bfd *output_bfd,
if (IRIX_COMPAT (output_bfd) == ict_irix6)
mips_elf_irix6_finish_dynamic_symbol (output_bfd, name, sym);
- if (! info->shared)
- {
- if (! mips_elf_hash_table (info)->use_rld_obj_head
- && (strcmp (name, "__rld_map") == 0
- || strcmp (name, "__RLD_MAP") == 0))
- {
- asection *s = bfd_get_section_by_name (dynobj, ".rld_map");
- BFD_ASSERT (s != NULL);
- sym->st_value = s->output_section->vma + s->output_offset;
- bfd_put_32 (output_bfd, 0, s->contents);
- if (mips_elf_hash_table (info)->rld_value == 0)
- mips_elf_hash_table (info)->rld_value = sym->st_value;
- }
- else if (mips_elf_hash_table (info)->use_rld_obj_head
- && strcmp (name, "__rld_obj_head") == 0)
- {
- /* IRIX6 does not use a .rld_map section. */
- if (IRIX_COMPAT (output_bfd) == ict_irix5
- || IRIX_COMPAT (output_bfd) == ict_none)
- BFD_ASSERT (bfd_get_section_by_name (dynobj, ".rld_map")
- != NULL);
- mips_elf_hash_table (info)->rld_value = sym->st_value;
- }
- }
-
/* Keep dynamic MIPS16 symbols odd. This allows the dynamic linker to
treat MIPS16 symbols like any other. */
if (ELF_ST_IS_MIPS16 (sym->st_other))
@@ -10517,7 +10498,19 @@ _bfd_mips_elf_finish_dynamic_sections (bfd *output_bfd,
break;
case DT_MIPS_RLD_MAP:
- dyn.d_un.d_ptr = mips_elf_hash_table (info)->rld_value;
+ {
+ struct elf_link_hash_entry *h;
+ h = mips_elf_hash_table (info)->rld_symbol;
+ if (!h)
+ {
+ dyn_to_skip = MIPS_ELF_DYN_SIZE (dynobj);
+ swap_out_p = FALSE;
+ break;
+ }
+ s = h->root.u.def.section;
+ dyn.d_un.d_ptr = (s->output_section->vma + s->output_offset
+ + h->root.u.def.value);
+ }
break;
case DT_MIPS_OPTIONS:
@@ -12794,7 +12787,7 @@ _bfd_mips_elf_link_hash_table_create (bfd *abfd)
ret->procedure_count = 0;
ret->compact_rel_size = 0;
ret->use_rld_obj_head = FALSE;
- ret->rld_value = 0;
+ ret->rld_symbol = NULL;
ret->mips16_stubs_seen = FALSE;
ret->use_plts_and_copy_relocs = FALSE;
ret->is_vxworks = FALSE;
--
1.7.9.5

View File

@ -1,47 +0,0 @@
Upstream-Status: Backport
From 97beee82f0e45e65308083a7e4cfaab57623733c Mon Sep 17 00:00:00 2001
From: cltang <cltang>
Date: Mon, 19 Dec 2011 10:34:15 +0000
Subject: [PATCH 035/262] 2011-12-19 Chung-Lin Tang
<cltang@codesourcery.com>
Backport from mainline:
2011-12-13 Chung-Lin Tang <cltang@codesourcery.com>
* elfxx-mips.c (mips_elf_calculate_relocation): Correct
R_MIPS16_HI16/R_MIPS16_LO16 handling of two cleared lower bits,
update comments.
diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c
index 6b908ad..3939183 100644
--- a/bfd/elfxx-mips.c
+++ b/bfd/elfxx-mips.c
@@ -5531,10 +5531,11 @@ mips_elf_calculate_relocation (bfd *abfd, bfd *input_bfd,
12: addu $v0,$v1
14: move $gp,$v0
So the offsets of hi and lo relocs are the same, but the
- $pc is four higher than $t9 would be, so reduce
- both reloc addends by 4. */
+ base $pc is that used by the ADDIUPC instruction at $t9 + 4.
+ ADDIUPC clears the low two bits of the instruction address,
+ so the base is ($t9 + 4) & ~3. */
if (r_type == R_MIPS16_HI16)
- value = mips_elf_high (addend + gp - p - 4);
+ value = mips_elf_high (addend + gp - ((p + 4) & ~(bfd_vma) 0x3));
/* The microMIPS .cpload sequence uses the same assembly
instructions as the traditional psABI version, but the
incoming $t9 has the low bit set. */
@@ -5557,7 +5558,7 @@ mips_elf_calculate_relocation (bfd *abfd, bfd *input_bfd,
/* See the comment for R_MIPS16_HI16 above for the reason
for this conditional. */
if (r_type == R_MIPS16_LO16)
- value = addend + gp - p;
+ value = addend + gp - (p & ~(bfd_vma) 0x3);
else if (r_type == R_MICROMIPS_LO16
|| r_type == R_MICROMIPS_HI0_LO16)
value = addend + gp - p + 3;
--
1.7.9.5

View File

@ -1,214 +0,0 @@
Upstream-Status: Backport
From 26e802720ccd055d70addadbc39f4119716f8573 Mon Sep 17 00:00:00 2001
From: cltang <cltang>
Date: Mon, 19 Dec 2011 10:39:27 +0000
Subject: [PATCH 036/262] 2011-12-19 Chung-Lin Tang
<cltang@codesourcery.com>
Backport from mainline:
2011-12-19 Chung-Lin Tang <cltang@codesourcery.com>
Catherine Moore <clm@codesourcery.com>
Sandra Loosemore <sandra@codesourcery.com>
Richard Sandiford <rdsandiford@googlemail.com>
* elfxx-mips.c (mips_elf_local_pic_function_p): Return true when
H is a MIPS16 function with a kept 32-bit stub. Update comments.
(mips_elf_get_la25_target): New function.
(mips_elf_add_la25_intro): Change to use mips_elf_get_la25_target().
(mips_elf_add_la25_stub): Move compute of use_trampoline_p down,
change to use mips_elf_get_la25_target().
(mips_elf_relocation_needs_la25_stub): Add target_is_16_bit_code_p
parameter, add switch case for R_MIPS16_26.
(mips_elf_calculate_relocation): Redirect relocation to point to the
LA25 stub if it exists, instead of the MIPS16 stub. Update arguments
of call to mips_elf_relocation_needs_la25_stub(), don't use la25 stub
for mips16->mips16 calls.
(_bfd_mips_elf_check_relocs): Update arguments of call to
mips_elf_relocation_needs_la25_stub().
(mips_elf_create_la25_stub): Change to use mips_elf_get_la25_target().
diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c
index 3939183..9f3833b 100644
--- a/bfd/elfxx-mips.c
+++ b/bfd/elfxx-mips.c
@@ -1575,9 +1575,10 @@ _bfd_mips_elf_init_stubs (struct bfd_link_info *info,
}
/* Return true if H is a locally-defined PIC function, in the sense
- that it might need $25 to be valid on entry. Note that MIPS16
- functions never need $25 to be valid on entry; they set up $gp
- using PC-relative instructions instead. */
+ that it or its fn_stub might need $25 to be valid on entry.
+ Note that MIPS16 functions set up $gp using PC-relative instructions,
+ so they themselves never need $25 to be valid. Only non-MIPS16
+ entry points are of interest here. */
static bfd_boolean
mips_elf_local_pic_function_p (struct mips_elf_link_hash_entry *h)
@@ -1586,11 +1587,32 @@ mips_elf_local_pic_function_p (struct mips_elf_link_hash_entry *h)
|| h->root.root.type == bfd_link_hash_defweak)
&& h->root.def_regular
&& !bfd_is_abs_section (h->root.root.u.def.section)
- && !ELF_ST_IS_MIPS16 (h->root.other)
+ && (!ELF_ST_IS_MIPS16 (h->root.other)
+ || (h->fn_stub && h->need_fn_stub))
&& (PIC_OBJECT_P (h->root.root.u.def.section->owner)
|| ELF_ST_IS_MIPS_PIC (h->root.other)));
}
+/* Set *SEC to the input section that contains the target of STUB.
+ Return the offset of the target from the start of that section. */
+
+static bfd_vma
+mips_elf_get_la25_target (struct mips_elf_la25_stub *stub,
+ asection **sec)
+{
+ if (ELF_ST_IS_MIPS16 (stub->h->root.other))
+ {
+ BFD_ASSERT (stub->h->need_fn_stub);
+ *sec = stub->h->fn_stub;
+ return 0;
+ }
+ else
+ {
+ *sec = stub->h->root.root.u.def.section;
+ return stub->h->root.root.u.def.value;
+ }
+}
+
/* STUB describes an la25 stub that we have decided to implement
by inserting an LUI/ADDIU pair before the target function.
Create the section and redirect the function symbol to it. */
@@ -1615,7 +1637,7 @@ mips_elf_add_la25_intro (struct mips_elf_la25_stub *stub,
sprintf (name, ".text.stub.%d", (int) htab_elements (htab->la25_stubs));
/* Create the section. */
- input_section = stub->h->root.root.u.def.section;
+ mips_elf_get_la25_target (stub, &input_section);
s = htab->add_stub_section (name, input_section,
input_section->output_section);
if (s == NULL)
@@ -1689,12 +1711,6 @@ mips_elf_add_la25_stub (struct bfd_link_info *info,
bfd_vma value;
void **slot;
- /* Prefer to use LUI/ADDIU stubs if the function is at the beginning
- of the section and if we would need no more than 2 nops. */
- s = h->root.root.u.def.section;
- value = h->root.root.u.def.value;
- use_trampoline_p = (value != 0 || s->alignment_power > 4);
-
/* Describe the stub we want. */
search.stub_section = NULL;
search.offset = 0;
@@ -1724,6 +1740,11 @@ mips_elf_add_la25_stub (struct bfd_link_info *info,
*stub = search;
*slot = stub;
+ /* Prefer to use LUI/ADDIU stubs if the function is at the beginning
+ of the section and if we would need no more than 2 nops. */
+ value = mips_elf_get_la25_target (stub, &s);
+ use_trampoline_p = (value != 0 || s->alignment_power > 4);
+
h->la25_stub = stub;
return (use_trampoline_p
? mips_elf_add_la25_trampoline (stub, info)
@@ -4911,7 +4932,8 @@ is_gott_symbol (struct bfd_link_info *info, struct elf_link_hash_entry *h)
stub. */
static bfd_boolean
-mips_elf_relocation_needs_la25_stub (bfd *input_bfd, int r_type)
+mips_elf_relocation_needs_la25_stub (bfd *input_bfd, int r_type,
+ bfd_boolean target_is_16_bit_code_p)
{
/* We specifically ignore branches and jumps from EF_PIC objects,
where the onus is on the compiler or programmer to perform any
@@ -4925,7 +4947,6 @@ mips_elf_relocation_needs_la25_stub (bfd *input_bfd, int r_type)
{
case R_MIPS_26:
case R_MIPS_PC16:
- case R_MIPS16_26:
case R_MICROMIPS_26_S1:
case R_MICROMIPS_PC7_S1:
case R_MICROMIPS_PC10_S1:
@@ -4933,6 +4954,9 @@ mips_elf_relocation_needs_la25_stub (bfd *input_bfd, int r_type)
case R_MICROMIPS_PC23_S2:
return TRUE;
+ case R_MIPS16_26:
+ return !target_is_16_bit_code_p;
+
default:
return FALSE;
}
@@ -5193,14 +5217,28 @@ mips_elf_calculate_relocation (bfd *abfd, bfd *input_bfd,
have already noticed that we were going to need the
stub. */
if (local_p)
- sec = elf_tdata (input_bfd)->local_stubs[r_symndx];
+ {
+ sec = elf_tdata (input_bfd)->local_stubs[r_symndx];
+ value = 0;
+ }
else
{
BFD_ASSERT (h->need_fn_stub);
- sec = h->fn_stub;
+ if (h->la25_stub)
+ {
+ /* If a LA25 header for the stub itself exists, point to the
+ prepended LUI/ADDIU sequence. */
+ sec = h->la25_stub->stub_section;
+ value = h->la25_stub->offset;
+ }
+ else
+ {
+ sec = h->fn_stub;
+ value = 0;
+ }
}
- symbol = sec->output_section->vma + sec->output_offset;
+ symbol = sec->output_section->vma + sec->output_offset + value;
/* The target is 16-bit, but the stub isn't. */
target_is_16_bit_code_p = FALSE;
}
@@ -5250,7 +5288,8 @@ mips_elf_calculate_relocation (bfd *abfd, bfd *input_bfd,
/* If this is a direct call to a PIC function, redirect to the
non-PIC stub. */
else if (h != NULL && h->la25_stub
- && mips_elf_relocation_needs_la25_stub (input_bfd, r_type))
+ && mips_elf_relocation_needs_la25_stub (input_bfd, r_type,
+ target_is_16_bit_code_p))
symbol = (h->la25_stub->stub_section->output_section->vma
+ h->la25_stub->stub_section->output_offset
+ h->la25_stub->offset);
@@ -7925,7 +7964,9 @@ _bfd_mips_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
return FALSE;
}
- if (h != NULL && mips_elf_relocation_needs_la25_stub (abfd, r_type))
+ if (h != NULL
+ && mips_elf_relocation_needs_la25_stub (abfd, r_type,
+ ELF_ST_IS_MIPS16 (h->other)))
((struct mips_elf_link_hash_entry *) h)->has_nonpic_branches = TRUE;
switch (r_type)
@@ -9622,9 +9663,9 @@ mips_elf_create_la25_stub (void **slot, void *data)
offset = stub->offset;
/* Work out the target address. */
- target = (stub->h->root.root.u.def.section->output_section->vma
- + stub->h->root.root.u.def.section->output_offset
- + stub->h->root.root.u.def.value);
+ target = mips_elf_get_la25_target (stub, &s);
+ target += s->output_section->vma + s->output_offset;
+
target_high = ((target + 0x8000) >> 16) & 0xffff;
target_low = (target & 0xffff);
--
1.7.9.5

View File

@ -1,49 +0,0 @@
Upstream-Status: Backport
From 80041361bf80194da35c5efb842125f3ce1d2bf2 Mon Sep 17 00:00:00 2001
From: Joseph Myers <joseph@codesourcery.com>
Date: Tue, 20 Dec 2011 18:00:03 +0000
Subject: [PATCH 039/262] * emulparams/elf32bmip.sh (OTHER_SECTIONS):
Put .mdebug.* and .gcc_compiled_long* sections
at address 0.
---
ld/ChangeLog | 5 +++++
ld/emulparams/elf32bmip.sh | 16 ++++++++--------
2 files changed, 13 insertions(+), 8 deletions(-)
2011-12-20 Joseph Myers <joseph@codesourcery.com>
* emulparams/elf32bmip.sh (OTHER_SECTIONS): Put .mdebug.* and
.gcc_compiled_long* sections at address 0.
diff --git a/ld/emulparams/elf32bmip.sh b/ld/emulparams/elf32bmip.sh
index 44a0b8a..f0fcd2c 100644
--- a/ld/emulparams/elf32bmip.sh
+++ b/ld/emulparams/elf32bmip.sh
@@ -64,14 +64,14 @@ OTHER_BSS_SYMBOLS='_fbss = .;'
OTHER_SECTIONS='
.gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
.gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }
- .mdebug.abi32 : { KEEP(*(.mdebug.abi32)) }
- .mdebug.abiN32 : { KEEP(*(.mdebug.abiN32)) }
- .mdebug.abi64 : { KEEP(*(.mdebug.abi64)) }
- .mdebug.abiO64 : { KEEP(*(.mdebug.abiO64)) }
- .mdebug.eabi32 : { KEEP(*(.mdebug.eabi32)) }
- .mdebug.eabi64 : { KEEP(*(.mdebug.eabi64)) }
- .gcc_compiled_long32 : { KEEP(*(.gcc_compiled_long32)) }
- .gcc_compiled_long64 : { KEEP(*(.gcc_compiled_long64)) }
+ .mdebug.abi32 0 : { KEEP(*(.mdebug.abi32)) }
+ .mdebug.abiN32 0 : { KEEP(*(.mdebug.abiN32)) }
+ .mdebug.abi64 0 : { KEEP(*(.mdebug.abi64)) }
+ .mdebug.abiO64 0 : { KEEP(*(.mdebug.abiO64)) }
+ .mdebug.eabi32 0 : { KEEP(*(.mdebug.eabi32)) }
+ .mdebug.eabi64 0 : { KEEP(*(.mdebug.eabi64)) }
+ .gcc_compiled_long32 0 : { KEEP(*(.gcc_compiled_long32)) }
+ .gcc_compiled_long64 0 : { KEEP(*(.gcc_compiled_long64)) }
'
ARCH=mips
MACHINE=
--
1.7.9.5

View File

@ -1,83 +0,0 @@
Upstream-Status: Backport
From e45a3a5695408d472e8f0ca6c21eb03e5fd42817 Mon Sep 17 00:00:00 2001
From: Richard Sandiford <rsandifo@nildram.co.uk>
Date: Sun, 8 Jan 2012 12:34:30 +0000
Subject: [PATCH 052/262] gas/ * config/tc-mips.c (s_tls_rel_directive):
Call mips_clear_insn_labels.
gas/testsuite/
* gas/mips/tls-relw.s, gas/mips/tls-relw.d: New test.
* gas/mips/mips.exp: Run it.
---
gas/ChangeLog | 4 ++++
gas/config/tc-mips.c | 1 +
gas/testsuite/ChangeLog | 5 +++++
gas/testsuite/gas/mips/mips.exp | 1 +
gas/testsuite/gas/mips/tls-relw.d | 8 ++++++++
gas/testsuite/gas/mips/tls-relw.s | 12 ++++++++++++
6 files changed, 31 insertions(+)
create mode 100644 gas/testsuite/gas/mips/tls-relw.d
create mode 100644 gas/testsuite/gas/mips/tls-relw.s
2012-01-08 Richard Sandiford <rdsandiford@googlemail.com>
* config/tc-mips.c (s_tls_rel_directive): Call mips_clear_insn_labels.
diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c
index 0fb3a6e..5324450 100644
--- a/gas/config/tc-mips.c
+++ b/gas/config/tc-mips.c
@@ -16591,6 +16591,7 @@ s_tls_rel_directive (const size_t bytes, const char *dirstr,
md_number_to_chars (p, 0, bytes);
fix_new_exp (frag_now, p - frag_now->fr_literal, bytes, &ex, FALSE, rtype);
demand_empty_rest_of_line ();
+ mips_clear_insn_labels ();
}
/* Handle .dtprelword. */
--- a/gas/testsuite/gas/mips/mips.exp
+++ b/gas/testsuite/gas/mips/mips.exp
@@ -878,6 +878,7 @@ if { [istarget mips*-*-vxworks*] } {
run_list_test "tls-ill" "-32"
run_dump_test "tls-o32"
+ run_dump_test "tls-relw"
run_dump_test "jalr2"
run_dump_test_arches "aent" [mips_arch_list_matching mips1]
diff --git a/gas/testsuite/gas/mips/tls-relw.d b/gas/testsuite/gas/mips/tls-relw.d
new file mode 100644
index 0000000..bc13b43
--- /dev/null
+++ b/gas/testsuite/gas/mips/tls-relw.d
@@ -0,0 +1,8 @@
+# as: -EB
+# objdump: -sj.data
+
+.*
+
+Contents of section \.data:
+ 0000 00000001 00000000 00000002 00000004 ................
+ 0010 00000000 00000003 00000010 00000000 ................
diff --git a/gas/testsuite/gas/mips/tls-relw.s b/gas/testsuite/gas/mips/tls-relw.s
new file mode 100644
index 0000000..6890685
--- /dev/null
+++ b/gas/testsuite/gas/mips/tls-relw.s
@@ -0,0 +1,12 @@
+ .data
+start:
+ .word 1
+a:
+ .tprelword t1
+ .word 2
+ .word a-start
+b:
+ .dtprelword t2
+ .word 3
+ .word b-start
+ .word 0
--
1.7.9.5

View File

@ -1,176 +0,0 @@
Upstream-Status: Backport
From fee27086a7592c1812253e9c1c26f412dd87f3a2 Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Tue, 10 Jan 2012 20:34:56 +0000
Subject: [PATCH 055/262] Remove ABI_64_P check on R_X86_64_PCXX
bfd/
2012-01-10 H.J. Lu <hongjiu.lu@intel.com>
PR ld/13581
* elf64-x86-64.c (elf_x86_64_relocate_section): Remove ABI_64_P
check on R_X86_64_PCXX.
ld/testsuite/
2012-01-10 H.J. Lu <hongjiu.lu@intel.com>
PR ld/13581
* ld-x86-64/ilp32-4.s: New.
* ld-x86-64/ilp32-10.d: Likewise.
* ld-x86-64/ilp32-10.s: Likewise.
* ld-x86-64/ilp32-4.d: Adjusted.
* ld-x86-64/ilp32-5.d: Likewise.
* ld-x86-64/ilp32-5.s: Likewise.
* ld-x86-64/x86-64.exp: Run ilp32-10.
---
bfd/ChangeLog | 7 +++++++
bfd/elf64-x86-64.c | 1 -
ld/testsuite/ChangeLog | 14 ++++++++++++++
ld/testsuite/ld-x86-64/ilp32-10.d | 3 +++
ld/testsuite/ld-x86-64/ilp32-10.s | 3 +++
ld/testsuite/ld-x86-64/ilp32-4.d | 32 +++++++++++++-------------------
ld/testsuite/ld-x86-64/ilp32-4.s | 3 +++
ld/testsuite/ld-x86-64/ilp32-5.d | 2 +-
ld/testsuite/ld-x86-64/ilp32-5.s | 2 +-
ld/testsuite/ld-x86-64/x86-64.exp | 1 +
10 files changed, 46 insertions(+), 22 deletions(-)
create mode 100644 ld/testsuite/ld-x86-64/ilp32-10.d
create mode 100644 ld/testsuite/ld-x86-64/ilp32-10.s
create mode 100644 ld/testsuite/ld-x86-64/ilp32-4.s
diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
index 3a2444b..bdb3ae6 100644
--- a/bfd/elf64-x86-64.c
+++ b/bfd/elf64-x86-64.c
@@ -3460,7 +3460,6 @@ elf_x86_64_relocate_section (bfd *output_bfd,
case R_X86_64_PC16:
case R_X86_64_PC32:
if (info->shared
- && ABI_64_P (output_bfd)
&& (input_section->flags & SEC_ALLOC) != 0
&& (input_section->flags & SEC_READONLY) != 0
&& h != NULL)
diff --git a/ld/testsuite/ld-x86-64/ilp32-10.d b/ld/testsuite/ld-x86-64/ilp32-10.d
new file mode 100644
index 0000000..43d9fbd
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/ilp32-10.d
@@ -0,0 +1,3 @@
+#as: --x32
+#ld: -shared -melf32_x86_64
+#error: .*relocation R_X86_64_PC32 against undefined symbol `bar' can not be used when making a shared object; recompile with -fPIC
diff --git a/ld/testsuite/ld-x86-64/ilp32-10.s b/ld/testsuite/ld-x86-64/ilp32-10.s
new file mode 100644
index 0000000..70e4a90
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/ilp32-10.s
@@ -0,0 +1,3 @@
+ .globl foo
+foo:
+ mov bar(%rip), %rax
diff --git a/ld/testsuite/ld-x86-64/ilp32-4.d b/ld/testsuite/ld-x86-64/ilp32-4.d
index 84dc7b2..92d8a67 100644
--- a/ld/testsuite/ld-x86-64/ilp32-4.d
+++ b/ld/testsuite/ld-x86-64/ilp32-4.d
@@ -1,36 +1,30 @@
-#source: start.s
#as: --x32
#ld: -m elf32_x86_64 -shared --no-ld-generated-unwind-info
#readelf: -d -S --wide
-There are 10 section headers, starting at offset 0x22c:
+There are 9 section headers, starting at offset 0x1d8:
Section Headers:
\[Nr\] Name Type Addr Off Size ES Flg Lk Inf Al
\[ 0\] NULL 00000000 000000 000000 00 0 0 0
- \[ 1\] .hash HASH 00000094 000094 000030 04 A 2 0 4
- \[ 2\] .dynsym DYNSYM 000000c4 0000c4 000070 10 A 3 2 4
- \[ 3\] .dynstr STRTAB 00000134 000134 00001d 00 A 0 0 1
- \[ 4\] .rela.dyn RELA 00000154 000154 00000c 0c A 2 0 4
- \[ 5\] .text PROGBITS 00000160 000160 000005 00 AX 0 0 4
- \[ 6\] .dynamic DYNAMIC 00200168 000168 000078 08 WA 3 0 4
- \[ 7\] .shstrtab STRTAB 00000000 0001e0 00004a 00 0 0 1
- \[ 8\] .symtab SYMTAB 00000000 0003bc 0000e0 10 9 9 4
- \[ 9\] .strtab STRTAB 00000000 00049c 000043 00 0 0 1
+ \[ 1\] .hash HASH 00000094 000094 00002c 04 A 2 0 4
+ \[ 2\] .dynsym DYNSYM 000000c0 0000c0 000060 10 A 3 2 4
+ \[ 3\] .dynstr STRTAB 00000120 000120 000019 00 A 0 0 1
+ \[ 4\] .text PROGBITS 0000013c 00013c 000001 00 AX 0 0 4
+ \[ 5\] .dynamic DYNAMIC 00200140 000140 000058 08 WA 3 0 4
+ \[ 6\] .shstrtab STRTAB 00000000 000198 000040 00 0 0 1
+ \[ 7\] .symtab SYMTAB 00000000 000340 0000c0 10 8 8 4
+ \[ 8\] .strtab STRTAB 00000000 000400 00003f 00 0 0 1
Key to Flags:
W \(write\), A \(alloc\), X \(execute\), M \(merge\), S \(strings\), l \(large\)
I \(info\), L \(link order\), G \(group\), T \(TLS\), E \(exclude\), x \(unknown\)
O \(extra OS processing required\) o \(OS specific\), p \(processor specific\)
-Dynamic section at offset 0x168 contains 10 entries:
+Dynamic section at offset 0x140 contains 6 entries:
Tag Type Name/Value
0x00000004 \(HASH\) 0x94
- 0x00000005 \(STRTAB\) 0x134
- 0x00000006 \(SYMTAB\) 0xc4
- 0x0000000a \(STRSZ\) 29 \(bytes\)
+ 0x00000005 \(STRTAB\) 0x120
+ 0x00000006 \(SYMTAB\) 0xc0
+ 0x0000000a \(STRSZ\) 25 \(bytes\)
0x0000000b \(SYMENT\) 16 \(bytes\)
- 0x00000007 \(RELA\) 0x154
- 0x00000008 \(RELASZ\) 12 \(bytes\)
- 0x00000009 \(RELAENT\) 12 \(bytes\)
- 0x00000016 \(TEXTREL\) 0x0
0x00000000 \(NULL\) 0x0
diff --git a/ld/testsuite/ld-x86-64/ilp32-4.s b/ld/testsuite/ld-x86-64/ilp32-4.s
new file mode 100644
index 0000000..5f270c7
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/ilp32-4.s
@@ -0,0 +1,3 @@
+ .globl _start
+_start:
+ ret
diff --git a/ld/testsuite/ld-x86-64/ilp32-5.d b/ld/testsuite/ld-x86-64/ilp32-5.d
index e4673e5..4870c2b 100644
--- a/ld/testsuite/ld-x86-64/ilp32-5.d
+++ b/ld/testsuite/ld-x86-64/ilp32-5.d
@@ -4,5 +4,5 @@
#...
[0-9a-f]+ +[0-9a-f]+ +R_X86_64_RELATIVE +[0-9a-f]+
-[0-9a-f]+ +[0-9a-f]+ +R_X86_64_PC32 +[0-9a-f]+ +foo - 4
+[0-9a-f]+ +[0-9a-f]+ +R_X86_64_GLOB_DAT +[0-9a-f]+ +foo \+ 0
[0-9a-f]+ +[0-9a-f]+ +R_X86_64_32 +[0-9a-f]+ +foo \+ 0
diff --git a/ld/testsuite/ld-x86-64/ilp32-5.s b/ld/testsuite/ld-x86-64/ilp32-5.s
index 0d97807..ef0c60e 100644
--- a/ld/testsuite/ld-x86-64/ilp32-5.s
+++ b/ld/testsuite/ld-x86-64/ilp32-5.s
@@ -1,6 +1,6 @@
.globl bar
bar:
- mov foo(%rip), %rax
+ mov foo@GOTPCREL(%rip), %rax
.data
xxx:
diff --git a/ld/testsuite/ld-x86-64/x86-64.exp b/ld/testsuite/ld-x86-64/x86-64.exp
index 77b081b..44d3e07 100644
--- a/ld/testsuite/ld-x86-64/x86-64.exp
+++ b/ld/testsuite/ld-x86-64/x86-64.exp
@@ -207,6 +207,7 @@ run_dump_test "ilp32-6"
run_dump_test "ilp32-7"
run_dump_test "ilp32-8"
run_dump_test "ilp32-9"
+run_dump_test "ilp32-10"
run_dump_test "ia32-1"
run_dump_test "ia32-2"
run_dump_test "ia32-3"
--
1.7.9.5

View File

@ -1,48 +0,0 @@
Upstream-Status: Backport
From dcf0cb6bb406708020efe2db44f53af0fe822773 Mon Sep 17 00:00:00 2001
From: Nick Clifton <nickc@redhat.com>
Date: Mon, 30 Jan 2012 11:35:37 +0000
Subject: [PATCH 078/262] PR binutils/13622 * readelf.c
(process_section_groups): If there are no section
headers do not scan for section groups.
(process_note_sections): Likewise for note
sections.
---
binutils/ChangeLog | 7 +++++++
binutils/readelf.c | 5 +++--
2 files changed, 10 insertions(+), 2 deletions(-)
2012-01-26 Nick Clifton <nickc@redhat.com>
PR binutils/13622
* readelf.c (process_section_groups): If there are no section
headers do not scan for section groups.
(process_note_sections): Likewise for note sections.
diff --git a/binutils/readelf.c b/binutils/readelf.c
index 9e13190..bf053d9 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -4937,7 +4937,8 @@ process_section_groups (FILE * file)
if (section_headers == NULL)
{
error (_("Section headers are not available!\n"));
- abort ();
+ /* PR 13622: This can happen with a corrupt ELF header. */
+ return 0;
}
section_headers_groups = (struct group **) calloc (elf_header.e_shnum,
@@ -12942,7 +12943,7 @@ process_note_sections (FILE * file)
int res = 1;
for (i = 0, section = section_headers;
- i < elf_header.e_shnum;
+ i < elf_header.e_shnum && section != NULL;
i++, section++)
if (section->sh_type == SHT_NOTE)
res &= process_corefile_note_segment (file,
--
1.7.9.5

View File

@ -1,32 +0,0 @@
Upstream-Status: Backport
From b7578c6b7bd966b63ab1b2682fd90ed4f3a92e71 Mon Sep 17 00:00:00 2001
From: Ian Lance Taylor <ian@airs.com>
Date: Fri, 6 Apr 2012 17:23:58 +0000
Subject: [PATCH 144/262] * timer.cc: #include <unistd.h>.
---
gold/ChangeLog | 4 ++++
gold/timer.cc | 2 ++
2 files changed, 6 insertions(+)
2012-04-06 Ian Lance Taylor <iant@google.com>
* timer.cc: #include <unistd.h>.
diff --git a/gold/timer.cc b/gold/timer.cc
index d9b8874..44e19f5 100644
--- a/gold/timer.cc
+++ b/gold/timer.cc
@@ -22,6 +22,8 @@
#include "gold.h"
+#include <unistd.h>
+
#ifdef HAVE_TIMES
#include <sys/times.h>
#endif
--
1.7.9.5

View File

@ -1,169 +0,0 @@
Upstream-Status: Backport
From b6db4b7975d21ec53da5975ddac021098da13bf3 Mon Sep 17 00:00:00 2001
From: Doug Kwan <dougkwan@google.com>
Date: Thu, 26 Apr 2012 18:08:19 +0000
Subject: [PATCH 166/262] 2012-04-27 Doug Kwan <dougkwan@google.com>
Backport from mainline:
2012-03-16 Doug Kwan <dougkwan@google.com>
* testsuite/Makefile.am: Disable test initpri3b.
* testsuite/Makefile.in: Regenerate.
2012-03-14 Doug Kwan <dougkwan@google.com>
* gold/arm.cc (Target_arm::Scan::global): Generate
R_ARM_GLOB_DAT dynamic relocations for protected symbols in
shared objects.
---
gold/ChangeLog | 15 +++++++++++++++
gold/arm.cc | 4 +++-
gold/testsuite/Makefile.am | 15 ++++++++++-----
gold/testsuite/Makefile.in | 32 +++++++++++++-------------------
4 files changed, 41 insertions(+), 25 deletions(-)
diff --git a/gold/arm.cc b/gold/arm.cc
index 72c3670..a1e8e4c 100644
--- a/gold/arm.cc
+++ b/gold/arm.cc
@@ -8374,7 +8374,9 @@ Target_arm<big_endian>::Scan::global(Symbol_table* symtab,
Reloc_section* rel_dyn = target->rel_dyn_section(layout);
if (gsym->is_from_dynobj()
|| gsym->is_undefined()
- || gsym->is_preemptible())
+ || gsym->is_preemptible()
+ || (gsym->visibility() == elfcpp::STV_PROTECTED
+ && parameters->options().shared()))
got->add_global_with_rel(gsym, GOT_TYPE_STANDARD,
rel_dyn, elfcpp::R_ARM_GLOB_DAT);
else
diff --git a/gold/testsuite/Makefile.am b/gold/testsuite/Makefile.am
index 9b8605b..97d6457 100644
--- a/gold/testsuite/Makefile.am
+++ b/gold/testsuite/Makefile.am
@@ -870,11 +870,16 @@ initpri3a_DEPENDENCIES = gcctestdir/ld
initpri3a_LDFLAGS = -Bgcctestdir/
initpri3a_LDADD =
-check_PROGRAMS += initpri3b
-initpri3b_SOURCES = initpri3.c
-initpri3b_DEPENDENCIES = gcctestdir/ld
-initpri3b_LDFLAGS = -Bgcctestdir/ -Wl,--no-ctors-in-init-array
-initpri3b_LDADD =
+# This test fails on targets not using .ctors and .dtors sections (e.g. ARM
+# EABI). Given that gcc is moving towards using .init_array in all cases,
+# this test is commented out. A better fix would be checking whether gcc
+# uses .ctors or .init_array sections in configure.
+
+# check_PROGRAMS += initpri3b
+# initpri3b_SOURCES = initpri3.c
+# initpri3b_DEPENDENCIES = gcctestdir/ld
+# initpri3b_LDFLAGS = -Bgcctestdir/ -Wl,--no-ctors-in-init-array
+# initpri3b_LDADD =
# Test --detect-odr-violations
check_SCRIPTS += debug_msg.sh
diff --git a/gold/testsuite/Makefile.in b/gold/testsuite/Makefile.in
index 785dcdd..518d32b 100644
--- a/gold/testsuite/Makefile.in
+++ b/gold/testsuite/Makefile.in
@@ -56,6 +56,17 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_3) \
@NATIVE_OR_CROSS_LINKER_TRUE@am__append_1 = object_unittest \
@NATIVE_OR_CROSS_LINKER_TRUE@ binary_unittest
+# This test fails on targets not using .ctors and .dtors sections (e.g. ARM
+# EABI). Given that gcc is moving towards using .init_array in all cases,
+# this test is commented out. A better fix would be checking whether gcc
+# uses .ctors or .init_array sections in configure.
+
+# check_PROGRAMS += initpri3b
+# initpri3b_SOURCES = initpri3.c
+# initpri3b_DEPENDENCIES = gcctestdir/ld
+# initpri3b_LDFLAGS = -Bgcctestdir/ -Wl,--no-ctors-in-init-array
+# initpri3b_LDADD =
+
# Test --detect-odr-violations
# Similar to --detect-odr-violations: check for undefined symbols in .so's
@@ -189,7 +200,7 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_3) \
# Test -o when emitting to a special file (such as something in /dev).
@GCC_TRUE@@NATIVE_LINKER_TRUE@am__append_24 = many_sections_test \
@GCC_TRUE@@NATIVE_LINKER_TRUE@ many_sections_r_test initpri1 \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ initpri2 initpri3a initpri3b \
+@GCC_TRUE@@NATIVE_LINKER_TRUE@ initpri2 initpri3a \
@GCC_TRUE@@NATIVE_LINKER_TRUE@ flagstest_o_specialfile
@GCC_FALSE@many_sections_test_DEPENDENCIES =
@NATIVE_LINKER_FALSE@many_sections_test_DEPENDENCIES =
@@ -204,8 +215,6 @@ check_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_3) \
@NATIVE_LINKER_FALSE@initpri2_DEPENDENCIES =
@GCC_FALSE@initpri3a_DEPENDENCIES =
@NATIVE_LINKER_FALSE@initpri3a_DEPENDENCIES =
-@GCC_FALSE@initpri3b_DEPENDENCIES =
-@NATIVE_LINKER_FALSE@initpri3b_DEPENDENCIES =
# Check that --detect-odr-violations works with compressed debug sections.
@GCC_TRUE@@HAVE_ZLIB_TRUE@@NATIVE_LINKER_TRUE@am__append_27 = debug_msg_cdebug.err
@@ -712,7 +721,6 @@ libgoldtest_a_OBJECTS = $(am_libgoldtest_a_OBJECTS)
@GCC_TRUE@@NATIVE_LINKER_TRUE@ initpri1$(EXEEXT) \
@GCC_TRUE@@NATIVE_LINKER_TRUE@ initpri2$(EXEEXT) \
@GCC_TRUE@@NATIVE_LINKER_TRUE@ initpri3a$(EXEEXT) \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ initpri3b$(EXEEXT) \
@GCC_TRUE@@NATIVE_LINKER_TRUE@ flagstest_o_specialfile$(EXEEXT)
@GCC_TRUE@@HAVE_ZLIB_TRUE@@NATIVE_LINKER_TRUE@am__EXEEXT_21 = flagstest_compress_debug_sections$(EXEEXT) \
@GCC_TRUE@@HAVE_ZLIB_TRUE@@NATIVE_LINKER_TRUE@ flagstest_o_specialfile_and_compress_debug_sections$(EXEEXT)
@@ -1200,11 +1208,6 @@ initpri2_LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(initpri2_LDFLAGS) \
initpri3a_OBJECTS = $(am_initpri3a_OBJECTS)
initpri3a_LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(initpri3a_LDFLAGS) \
$(LDFLAGS) -o $@
-@GCC_TRUE@@NATIVE_LINKER_TRUE@am_initpri3b_OBJECTS = \
-@GCC_TRUE@@NATIVE_LINKER_TRUE@ initpri3.$(OBJEXT)
-initpri3b_OBJECTS = $(am_initpri3b_OBJECTS)
-initpri3b_LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(initpri3b_LDFLAGS) \
- $(LDFLAGS) -o $@
@GCC_TRUE@@NATIVE_LINKER_TRUE@am_justsyms_OBJECTS = \
@GCC_TRUE@@NATIVE_LINKER_TRUE@ justsyms_1.$(OBJEXT)
justsyms_OBJECTS = $(am_justsyms_OBJECTS)
@@ -1698,7 +1701,7 @@ SOURCES = $(libgoldtest_a_SOURCES) basic_pic_test.c basic_pie_test.c \
incremental_copy_test.c incremental_test_2.c \
incremental_test_3.c incremental_test_4.c incremental_test_5.c \
incremental_test_6.c $(initpri1_SOURCES) $(initpri2_SOURCES) \
- $(initpri3a_SOURCES) $(initpri3b_SOURCES) $(justsyms_SOURCES) \
+ $(initpri3a_SOURCES) $(justsyms_SOURCES) \
$(justsyms_exec_SOURCES) $(large_SOURCES) local_labels_test.c \
many_sections_r_test.c $(many_sections_test_SOURCES) \
$(object_unittest_SOURCES) permission_test.c plugin_test_1.c \
@@ -2281,10 +2284,6 @@ LDADD = libgoldtest.a ../libgold.a ../../libiberty/libiberty.a $(LIBINTL) \
@GCC_TRUE@@NATIVE_LINKER_TRUE@initpri3a_DEPENDENCIES = gcctestdir/ld
@GCC_TRUE@@NATIVE_LINKER_TRUE@initpri3a_LDFLAGS = -Bgcctestdir/
@GCC_TRUE@@NATIVE_LINKER_TRUE@initpri3a_LDADD =
-@GCC_TRUE@@NATIVE_LINKER_TRUE@initpri3b_SOURCES = initpri3.c
-@GCC_TRUE@@NATIVE_LINKER_TRUE@initpri3b_DEPENDENCIES = gcctestdir/ld
-@GCC_TRUE@@NATIVE_LINKER_TRUE@initpri3b_LDFLAGS = -Bgcctestdir/ -Wl,--no-ctors-in-init-array
-@GCC_TRUE@@NATIVE_LINKER_TRUE@initpri3b_LDADD =
@GCC_TRUE@@NATIVE_LINKER_TRUE@ver_test_SOURCES = ver_test_main.cc
@GCC_TRUE@@NATIVE_LINKER_TRUE@ver_test_DEPENDENCIES = gcctestdir/ld ver_test_1.so ver_test_2.so ver_test_4.so
@GCC_TRUE@@NATIVE_LINKER_TRUE@ver_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
@@ -2928,9 +2927,6 @@ initpri2$(EXEEXT): $(initpri2_OBJECTS) $(initpri2_DEPENDENCIES)
initpri3a$(EXEEXT): $(initpri3a_OBJECTS) $(initpri3a_DEPENDENCIES)
@rm -f initpri3a$(EXEEXT)
$(initpri3a_LINK) $(initpri3a_OBJECTS) $(initpri3a_LDADD) $(LIBS)
-initpri3b$(EXEEXT): $(initpri3b_OBJECTS) $(initpri3b_DEPENDENCIES)
- @rm -f initpri3b$(EXEEXT)
- $(initpri3b_LINK) $(initpri3b_OBJECTS) $(initpri3b_LDADD) $(LIBS)
justsyms$(EXEEXT): $(justsyms_OBJECTS) $(justsyms_DEPENDENCIES)
@rm -f justsyms$(EXEEXT)
$(justsyms_LINK) $(justsyms_OBJECTS) $(justsyms_LDADD) $(LIBS)
@@ -3869,8 +3865,6 @@ initpri2.log: initpri2$(EXEEXT)
@p='initpri2$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
initpri3a.log: initpri3a$(EXEEXT)
@p='initpri3a$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
-initpri3b.log: initpri3b$(EXEEXT)
- @p='initpri3b$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
flagstest_o_specialfile.log: flagstest_o_specialfile$(EXEEXT)
@p='flagstest_o_specialfile$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
flagstest_compress_debug_sections.log: flagstest_compress_debug_sections$(EXEEXT)
--
1.7.9.5

File diff suppressed because it is too large Load Diff

View File

@ -1,39 +0,0 @@
Upstream-Status: Pending
http://sourceware.org/bugzilla/show_bug.cgi?id=10340
Signed-off-by: Sven Rebhan <odinshorse@googlemail.com>
Always try to prepend the sysroot prefix to absolute filenames first.
Index: binutils-2.22/ld/ldfile.c
===================================================================
--- binutils-2.22.orig/ld/ldfile.c
+++ binutils-2.22/ld/ldfile.c
@@ -351,18 +351,24 @@ ldfile_open_file_search (const char *arc
directory first. */
if (! entry->maybe_archive)
{
- if (entry->sysrooted && IS_ABSOLUTE_PATH (entry->filename))
+ /* For absolute pathnames, try to always open the file in the
+ sysroot first. If this fails, try to open the file at the
+ given location. */
+ entry->sysrooted = is_sysrooted_pathname(entry->filename, FALSE);
+ if (IS_ABSOLUTE_PATH (entry->filename) && ld_sysroot && ! entry->sysrooted)
{
char *name = concat (ld_sysroot, entry->filename,
(const char *) NULL);
if (ldfile_try_open_bfd (name, entry))
{
entry->filename = name;
+ entry->sysrooted = TRUE;
return TRUE;
}
free (name);
}
- else if (ldfile_try_open_bfd (entry->filename, entry))
+
+ if (ldfile_try_open_bfd (entry->filename, entry))
{
entry->sysrooted = IS_ABSOLUTE_PATH (entry->filename)
&& is_sysrooted_pathname (entry->filename, TRUE);

View File

@ -1,24 +0,0 @@
Add the armv5e architecture to binutils
Binutils has a comment that indicates it is supposed to match gcc for all of
the support "-march=" settings, but it was lacking the armv5e setting. This
was a simple way to add it, as thumb instructions shouldn't be generated by
the compiler anyway.
Upstream-Status: Denied
Upstream maintainer indicated that we should not be using armv5e, even though
it is a legal archicture defined by our gcc.
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
diff -urN binutils-2.22.orig/gas/config/tc-arm.c binutils-2.22/gas/config/tc-arm.c
--- binutils-2.22.orig/gas/config/tc-arm.c 2011-11-21 03:29:31.000000000 -0600
+++ binutils-2.22/gas/config/tc-arm.c 2012-04-03 12:07:42.230158760 -0500
@@ -22990,6 +22990,7 @@
{"armv4t", ARM_ARCH_V4T, FPU_ARCH_FPA},
{"armv4txm", ARM_ARCH_V4TxM, FPU_ARCH_FPA},
{"armv5", ARM_ARCH_V5, FPU_ARCH_VFP},
+ {"armv5e", ARM_ARCH_V5TE, FPU_ARCH_VFP},
{"armv5t", ARM_ARCH_V5T, FPU_ARCH_VFP},
{"armv5txm", ARM_ARCH_V5TxM, FPU_ARCH_VFP},
{"armv5te", ARM_ARCH_V5TE, FPU_ARCH_VFP},

View File

@ -1,255 +0,0 @@
Upstream-Status: Inappropriate [distribution: codesourcery]
Patch originally created by Mark Hatle, forward-ported to
binutils 2.21 by Scott Garman.
purpose: warn for uses of system directories when cross linking
Code Merged from Sourcery G++ binutils 2.19 - 4.4-277
2008-07-02 Joseph Myers <joseph@codesourcery.com>
ld/
* ld.h (args_type): Add error_poison_system_directories.
* ld.texinfo (--error-poison-system-directories): Document.
* ldfile.c (ldfile_add_library_path): Check
command_line.error_poison_system_directories.
* ldmain.c (main): Initialize
command_line.error_poison_system_directories.
* lexsup.c (enum option_values): Add
OPTION_ERROR_POISON_SYSTEM_DIRECTORIES.
(ld_options): Add --error-poison-system-directories.
(parse_args): Handle new option.
2007-06-13 Joseph Myers <joseph@codesourcery.com>
ld/
* config.in: Regenerate.
* ld.h (args_type): Add poison_system_directories.
* ld.texinfo (--no-poison-system-directories): Document.
* ldfile.c (ldfile_add_library_path): Check
command_line.poison_system_directories.
* ldmain.c (main): Initialize
command_line.poison_system_directories.
* lexsup.c (enum option_values): Add
OPTION_NO_POISON_SYSTEM_DIRECTORIES.
(ld_options): Add --no-poison-system-directories.
(parse_args): Handle new option.
2007-04-20 Joseph Myers <joseph@codesourcery.com>
Merge from Sourcery G++ binutils 2.17:
2007-03-20 Joseph Myers <joseph@codesourcery.com>
Based on patch by Mark Hatle <mark.hatle@windriver.com>.
ld/
* configure.in (--enable-poison-system-directories): New option.
* configure, config.in: Regenerate.
* ldfile.c (ldfile_add_library_path): If
ENABLE_POISON_SYSTEM_DIRECTORIES defined, warn for use of /lib,
/usr/lib, /usr/local/lib or /usr/X11R6/lib.
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Scott Garman <scott.a.garman@intel.com>
Index: binutils-2.22/ld/config.in
===================================================================
--- binutils-2.22.orig/ld/config.in
+++ binutils-2.22/ld/config.in
@@ -4,6 +4,9 @@
language is requested. */
#undef ENABLE_NLS
+/* Define to warn for use of native system library directories */
+#undef ENABLE_POISON_SYSTEM_DIRECTORIES
+
/* Additional extension a shared object might have. */
#undef EXTRA_SHLIB_EXTENSION
Index: binutils-2.22/ld/configure
===================================================================
--- binutils-2.22.orig/ld/configure
+++ binutils-2.22/ld/configure
@@ -776,6 +776,7 @@ with_lib_path
enable_targets
enable_64_bit_bfd
with_sysroot
+enable_poison_system_directories
enable_gold
enable_got
enable_werror
@@ -1431,6 +1432,8 @@ Optional Features:
(and sometimes confusing) to the casual installer
--enable-targets alternative target configurations
--enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes)
+ --enable-poison-system-directories
+ warn for use of native system library directories
--enable-gold[=ARG] build gold [ARG={default,yes,no}]
--enable-got=<type> GOT handling scheme (target, single, negative,
multigot)
@@ -4342,7 +4345,18 @@ else
fi
+# Check whether --enable-poison-system-directories was given.
+if test "${enable_poison_system_directories+set}" = set; then :
+ enableval=$enable_poison_system_directories;
+else
+ enable_poison_system_directories=no
+fi
+
+if test "x${enable_poison_system_directories}" = "xyes"; then
+$as_echo "#define ENABLE_POISON_SYSTEM_DIRECTORIES 1" >>confdefs.h
+
+fi
# Check whether --enable-got was given.
if test "${enable_got+set}" = set; then :
Index: binutils-2.22/ld/configure.in
===================================================================
--- binutils-2.22.orig/ld/configure.in
+++ binutils-2.22/ld/configure.in
@@ -70,6 +70,16 @@ AC_SUBST(use_sysroot)
AC_SUBST(TARGET_SYSTEM_ROOT)
AC_SUBST(TARGET_SYSTEM_ROOT_DEFINE)
+AC_ARG_ENABLE([poison-system-directories],
+ AS_HELP_STRING([--enable-poison-system-directories],
+ [warn for use of native system library directories]),,
+ [enable_poison_system_directories=no])
+if test "x${enable_poison_system_directories}" = "xyes"; then
+ AC_DEFINE([ENABLE_POISON_SYSTEM_DIRECTORIES],
+ [1],
+ [Define to warn for use of native system library directories])
+fi
+
dnl Use --enable-gold to decide if this linker should be the default.
dnl "install_as_default" is set to false if gold is the default linker.
dnl "installed_linker" is the installed BFD linker name.
Index: binutils-2.22/ld/ldfile.c
===================================================================
--- binutils-2.22.orig/ld/ldfile.c
+++ binutils-2.22/ld/ldfile.c
@@ -125,6 +125,23 @@ ldfile_add_library_path (const char *nam
{
new_dirs->name = xstrdup (name);
new_dirs->sysrooted = is_sysrooted_pathname (name, FALSE);
+
+#ifdef ENABLE_POISON_SYSTEM_DIRECTORIES
+ if (command_line.poison_system_directories
+ && ((!strncmp (name, "/lib", 4))
+ || (!strncmp (name, "/usr/lib", 8))
+ || (!strncmp (name, "/usr/local/lib", 14))
+ || (!strncmp (name, "/usr/X11R6/lib", 14))))
+ {
+ if (command_line.error_poison_system_directories)
+ einfo (_("%X%P: error: library search path \"%s\" is unsafe for "
+ "cross-compilation\n"), name);
+ else
+ einfo (_("%P: warning: library search path \"%s\" is unsafe for "
+ "cross-compilation\n"), name);
+ }
+#endif
+
}
}
Index: binutils-2.22/ld/ld.h
===================================================================
--- binutils-2.22.orig/ld/ld.h
+++ binutils-2.22/ld/ld.h
@@ -203,6 +203,14 @@ typedef struct {
/* If TRUE we'll just print the default output on stdout. */
bfd_boolean print_output_format;
+ /* If TRUE (the default) warn for uses of system directories when
+ cross linking. */
+ bfd_boolean poison_system_directories;
+
+ /* If TRUE (default FALSE) give an error for uses of system
+ directories when cross linking instead of a warning. */
+ bfd_boolean error_poison_system_directories;
+
/* Big or little endian as set on command line. */
enum endian_enum endian;
Index: binutils-2.22/ld/ldmain.c
===================================================================
--- binutils-2.22.orig/ld/ldmain.c
+++ binutils-2.22/ld/ldmain.c
@@ -259,6 +259,8 @@ main (int argc, char **argv)
command_line.warn_search_mismatch = TRUE;
command_line.check_section_addresses = -1;
command_line.disable_target_specific_optimizations = -1;
+ command_line.poison_system_directories = TRUE;
+ command_line.error_poison_system_directories = FALSE;
/* We initialize DEMANGLING based on the environment variable
COLLECT_NO_DEMANGLE. The gcc collect2 program will demangle the
Index: binutils-2.22/ld/ld.texinfo
===================================================================
--- binutils-2.22.orig/ld/ld.texinfo
+++ binutils-2.22/ld/ld.texinfo
@@ -2147,6 +2147,18 @@ string identifying the original linked f
Passing @code{none} for @var{style} disables the setting from any
@code{--build-id} options earlier on the command line.
+
+@kindex --no-poison-system-directories
+@item --no-poison-system-directories
+Do not warn for @option{-L} options using system directories such as
+@file{/usr/lib} when cross linking. This option is intended for use
+in chroot environments when such directories contain the correct
+libraries for the target system rather than the host.
+
+@kindex --error-poison-system-directories
+@item --error-poison-system-directories
+Give an error instead of a warning for @option{-L} options using
+system directories when cross linking.
@end table
@c man end
Index: binutils-2.22/ld/lexsup.c
===================================================================
--- binutils-2.22.orig/ld/lexsup.c
+++ binutils-2.22/ld/lexsup.c
@@ -176,6 +176,8 @@ enum option_values
#endif /* ENABLE_PLUGINS */
OPTION_DEFAULT_SCRIPT,
OPTION_PRINT_OUTPUT_FORMAT,
+ OPTION_NO_POISON_SYSTEM_DIRECTORIES,
+ OPTION_ERROR_POISON_SYSTEM_DIRECTORIES
};
/* The long options. This structure is used for both the option
@@ -612,6 +614,14 @@ static const struct ld_option ld_options
TWO_DASHES },
{ {"wrap", required_argument, NULL, OPTION_WRAP},
'\0', N_("SYMBOL"), N_("Use wrapper functions for SYMBOL"), TWO_DASHES },
+ { {"no-poison-system-directories", no_argument, NULL,
+ OPTION_NO_POISON_SYSTEM_DIRECTORIES},
+ '\0', NULL, N_("Do not warn for -L options using system directories"),
+ TWO_DASHES },
+ { {"error-poison-system-directories", no_argument, NULL,
+ OPTION_ERROR_POISON_SYSTEM_DIRECTORIES},
+ '\0', NULL, N_("Give an error for -L options using system directories"),
+ TWO_DASHES },
};
#define OPTION_COUNT ARRAY_SIZE (ld_options)
@@ -1541,6 +1551,14 @@ parse_args (unsigned argc, char **argv)
einfo (_("%P%X: --hash-size needs a numeric argument\n"));
}
break;
+
+ case OPTION_NO_POISON_SYSTEM_DIRECTORIES:
+ command_line.poison_system_directories = FALSE;
+ break;
+
+ case OPTION_ERROR_POISON_SYSTEM_DIRECTORIES:
+ command_line.error_poison_system_directories = TRUE;
+ break;
}
}

View File

@ -1,936 +0,0 @@
Upstream-Status: Backport
Signed-off- by: Khem Raj <raj.khem@gmail.com>
From 4f017a6dfe0c3e84c21431c85e82ce2af0941ac1 Mon Sep 17 00:00:00 2001
From: Alan Modra <amodra@bigpond.net.au>
Date: Fri, 9 Mar 2012 23:39:02 +0000
Subject: [PATCH] include/opcode/ * ppc.h: Add PPC_OPCODE_ALTIVEC2,
PPC_OPCODE_E6500, PPC_OPCODE_TMR. opcodes/ * ppc-dis.c
(ppc_opts): Add entries for "e5500" and "e6500". *
ppc-opc.c (insert_ls, TMR, ESYNC, XSYNCLE_MASK): New.
(PPCVEC2, PPCTMR, E6500): New short names.
(powerpc_opcodes): Add vabsdub, vabsduh, vabsduw, dni,
mvidsplt, mviwsplt, icblq., mftmr, mttmr, dcblq.,
miso, lvexbx, lvexhx, lvexwx, stvexbx, stvexhx, stvexwx,
lvepx, lvepxl, stvepx, stvepxl, lvtrx, lvtrxl,
lvtlx, lvtlxl, stvfrx, stvfrxl, stvflx, stvflxl,
lvswx, lvswxl, stvswx, stvswxl, lvsm mnemonics. Accept LS,
ESYNC optional operands on sync instruction for E6500
target. bfd/ * archures.c: Add bfd_mach_ppc_e5500 and
bfd_mach_ppc_e6500. * bfd-in2.h: Regenerate. *
cpu-powerpc.c (bfd_powerpc_archs): Add entryies for
bfd_mach_ppc_e5500 and bfd_mach_ppc_e6500. gas/ *
config/tc-ppc.c (md_show_usage): Document -me5500 and
-me6500. (ppc_handle_align): Add termination nop
opcode for e500mc family. * doc/as.texinfo: Document
options -me5500 and -me6500. * doc/c-ppc.texi: Likewise.
gas/testsuite/ * gas/ppc/e500mc64_nop.s: New test
case for e500mc family termination nops. *
gas/ppc/e500mc64_nop.d: Likewise. *
gas/ppc/e5500_nop.s: Likewise. *
gas/ppc/e5500_nop.d: Likewise. *
gas/ppc/e6500_nop.s: Likewise. *
gas/ppc/e6500_nop.d: Likewise. * gas/ppc/e6500.s:
New. * gas/ppc/e6500.d: Likewise. * gas/ppc/ppc.exp:
Run e6500, e500mc64_nop, e5500_nop, and e6500_nop.
---
bfd/ChangeLog | 7 +++
bfd/archures.c | 6 +-
bfd/bfd-in2.h | 2 +
bfd/cpu-powerpc.c | 34 ++++++++++-
gas/ChangeLog | 7 +++
gas/config/tc-ppc.c | 14 ++++-
gas/doc/as.texinfo | 6 +-
gas/doc/c-ppc.texi | 8 ++-
gas/testsuite/ChangeLog | 13 ++++
gas/testsuite/gas/ppc/e500mc64_nop.d | 13 ++++
gas/testsuite/gas/ppc/e500mc64_nop.s | 5 ++
gas/testsuite/gas/ppc/e5500_nop.d | 13 ++++
gas/testsuite/gas/ppc/e5500_nop.s | 5 ++
gas/testsuite/gas/ppc/e6500.d | 75 +++++++++++++++++++++++
gas/testsuite/gas/ppc/e6500.s | 69 +++++++++++++++++++++
gas/testsuite/gas/ppc/e6500_nop.d | 13 ++++
gas/testsuite/gas/ppc/e6500_nop.s | 5 ++
gas/testsuite/gas/ppc/ppc.exp | 4 ++
include/opcode/ChangeLog | 4 ++
include/opcode/ppc.h | 11 +++-
opcodes/ChangeLog | 12 ++++
opcodes/ppc-dis.c | 14 ++++-
opcodes/ppc-opc.c | 112 +++++++++++++++++++++++++++++++---
23 files changed, 432 insertions(+), 20 deletions(-)
create mode 100644 gas/testsuite/gas/ppc/e500mc64_nop.d
create mode 100644 gas/testsuite/gas/ppc/e500mc64_nop.s
create mode 100644 gas/testsuite/gas/ppc/e5500_nop.d
create mode 100644 gas/testsuite/gas/ppc/e5500_nop.s
create mode 100644 gas/testsuite/gas/ppc/e6500.d
create mode 100644 gas/testsuite/gas/ppc/e6500.s
create mode 100644 gas/testsuite/gas/ppc/e6500_nop.d
create mode 100644 gas/testsuite/gas/ppc/e6500_nop.s
Index: binutils-2.22/bfd/archures.c
===================================================================
--- binutils-2.22.orig/bfd/archures.c 2012-07-06 20:40:40.000000000 -0700
+++ binutils-2.22/bfd/archures.c 2012-07-06 20:41:27.822780001 -0700
@@ -1,7 +1,7 @@
/* BFD library support routines for architectures.
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
- Free Software Foundation, Inc.
+ 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
+ 2012 Free Software Foundation, Inc.
Hacked by John Gilmore and Steve Chamberlain of Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -239,6 +239,8 @@
.#define bfd_mach_ppc_e500 500
.#define bfd_mach_ppc_e500mc 5001
.#define bfd_mach_ppc_e500mc64 5005
+.#define bfd_mach_ppc_e5500 5006
+.#define bfd_mach_ppc_e6500 5007
.#define bfd_mach_ppc_titan 83
. bfd_arch_rs6000, {* IBM RS/6000 *}
.#define bfd_mach_rs6k 6000
Index: binutils-2.22/bfd/bfd-in2.h
===================================================================
--- binutils-2.22.orig/bfd/bfd-in2.h 2012-07-06 20:40:40.000000000 -0700
+++ binutils-2.22/bfd/bfd-in2.h 2012-07-06 20:41:27.822780001 -0700
@@ -1946,6 +1946,8 @@
#define bfd_mach_ppc_e500 500
#define bfd_mach_ppc_e500mc 5001
#define bfd_mach_ppc_e500mc64 5005
+#define bfd_mach_ppc_e5500 5006
+#define bfd_mach_ppc_e6500 5007
#define bfd_mach_ppc_titan 83
bfd_arch_rs6000, /* IBM RS/6000 */
#define bfd_mach_rs6k 6000
Index: binutils-2.22/bfd/cpu-powerpc.c
===================================================================
--- binutils-2.22.orig/bfd/cpu-powerpc.c 2012-07-06 20:40:40.000000000 -0700
+++ binutils-2.22/bfd/cpu-powerpc.c 2012-07-06 20:41:27.822780001 -0700
@@ -1,6 +1,6 @@
/* BFD PowerPC CPU definition
- Copyright 1994, 1995, 1996, 2000, 2001, 2002, 2003, 2005, 2007, 2008, 2010
- Free Software Foundation, Inc.
+ Copyright 1994, 1995, 1996, 2000, 2001, 2002, 2003, 2005, 2007, 2008,
+ 2010, 2012 Free Software Foundation, Inc.
Contributed by Ian Lance Taylor, Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
Index: binutils-2.22/gas/config/tc-ppc.c
===================================================================
--- binutils-2.22.orig/gas/config/tc-ppc.c 2012-07-06 20:40:40.000000000 -0700
+++ binutils-2.22/gas/config/tc-ppc.c 2012-07-06 20:41:27.826780001 -0700
@@ -1,6 +1,6 @@
/* tc-ppc.c -- Assemble for the PowerPC or POWER (RS/6000)
Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
- 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
+ 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
Free Software Foundation, Inc.
Written by Ian Lance Taylor, Cygnus Support.
@@ -1265,6 +1265,8 @@
-me500, -me500x2 generate code for Motorola e500 core complex\n\
-me500mc, generate code for Freescale e500mc core complex\n\
-me500mc64, generate code for Freescale e500mc64 core complex\n\
+-me5500, generate code for Freescale e5500 core complex\n\
+-me6500, generate code for Freescale e6500 core complex\n\
-mspe generate code for Motorola SPE instructions\n\
-mtitan generate code for AppliedMicro Titan core complex\n\
-mregnames Allow symbolic names for registers\n\
@@ -6012,8 +6014,14 @@
}
if ((ppc_cpu & PPC_OPCODE_POWER7) != 0)
- /* power7 group terminating nop: "ori 2,2,0". */
- md_number_to_chars (dest, 0x60420000, 4);
+ {
+ if (ppc_cpu & PPC_OPCODE_E500MC)
+ /* e500mc group terminating nop: "ori 0,0,0". */
+ md_number_to_chars (dest, 0x60000000, 4);
+ else
+ /* power7 group terminating nop: "ori 2,2,0". */
+ md_number_to_chars (dest, 0x60420000, 4);
+ }
else
/* power6 group terminating nop: "ori 1,1,0". */
md_number_to_chars (dest, 0x60210000, 4);
Index: binutils-2.22/gas/doc/as.texinfo
===================================================================
--- binutils-2.22.orig/gas/doc/as.texinfo 2012-07-06 20:40:40.000000000 -0700
+++ binutils-2.22/gas/doc/as.texinfo 2012-07-06 20:41:27.826780001 -0700
@@ -1,6 +1,6 @@
\input texinfo @c -*-Texinfo-*-
@c Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-@c 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
+@c 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
@c Free Software Foundation, Inc.
@c UPDATE!! On future updates--
@c (1) check for new machine-dep cmdline options in
@@ -434,8 +434,8 @@
[@b{-a32}|@b{-a64}]
[@b{-mpwrx}|@b{-mpwr2}|@b{-mpwr}|@b{-m601}|@b{-mppc}|@b{-mppc32}|@b{-m603}|@b{-m604}|@b{-m403}|@b{-m405}|
@b{-m440}|@b{-m464}|@b{-m476}|@b{-m7400}|@b{-m7410}|@b{-m7450}|@b{-m7455}|@b{-m750cl}|@b{-mppc64}|
- @b{-m620}|@b{-me500}|@b{-e500x2}|@b{-me500mc}|@b{-me500mc64}|@b{-mppc64bridge}|@b{-mbooke}|
- @b{-mpower4}|@b{-mpr4}|@b{-mpower5}|@b{-mpwr5}|@b{-mpwr5x}|@b{-mpower6}|@b{-mpwr6}|
+ @b{-m620}|@b{-me500}|@b{-e500x2}|@b{-me500mc}|@b{-me500mc64}|@b{-me5500}|@b{-me6500}|@b{-mppc64bridge}|
+ @b{-mbooke}|@b{-mpower4}|@b{-mpr4}|@b{-mpower5}|@b{-mpwr5}|@b{-mpwr5x}|@b{-mpower6}|@b{-mpwr6}|
@b{-mpower7}|@b{-mpw7}|@b{-ma2}|@b{-mcell}|@b{-mspe}|@b{-mtitan}|@b{-me300}|@b{-mcom}]
[@b{-many}] [@b{-maltivec}|@b{-mvsx}]
[@b{-mregnames}|@b{-mno-regnames}]
Index: binutils-2.22/gas/doc/c-ppc.texi
===================================================================
--- binutils-2.22.orig/gas/doc/c-ppc.texi 2012-07-06 20:40:40.000000000 -0700
+++ binutils-2.22/gas/doc/c-ppc.texi 2012-07-06 20:41:27.826780001 -0700
@@ -1,5 +1,5 @@
@c Copyright 2001, 2002, 2003, 2005, 2006, 2007, 2008, 2009, 2010, 2011
-@c Free Software Foundation, Inc.
+@c 2012 Free Software Foundation, Inc.
@c This is part of the GAS manual.
@c For copying conditions, see the file as.texinfo.
@c man end
@@ -88,6 +88,12 @@
@item -me500mc64
Generate code for Freescale e500mc64 core complex.
+@item -me5500
+Generate code for Freescale e5500 core complex.
+
+@item -me6500
+Generate code for Freescale e6500 core complex.
+
@item -mspe
Generate code for Motorola SPE instructions.
Index: binutils-2.22/gas/testsuite/gas/ppc/e500mc64_nop.d
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils-2.22/gas/testsuite/gas/ppc/e500mc64_nop.d 2012-07-06 20:41:27.826780001 -0700
@@ -0,0 +1,13 @@
+#as: -mppc -me500mc64
+#objdump: -dr -Me500mc64
+#name: Power E500MC64 nop tests
+
+.*: +file format elf(32)?(64)?-powerpc.*
+
+Disassembly of section \.text:
+
+0+00 <start>:
+ 0: 60 00 00 00 nop
+ 4: 60 00 00 00 nop
+ 8: 60 00 00 00 nop
+ c: 60 00 00 00 nop
Index: binutils-2.22/gas/testsuite/gas/ppc/e500mc64_nop.s
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils-2.22/gas/testsuite/gas/ppc/e500mc64_nop.s 2012-07-06 20:41:27.826780001 -0700
@@ -0,0 +1,5 @@
+# Power E500MC64 nop tests
+ .section ".text"
+start:
+ nop
+ .p2align 4,,15
Index: binutils-2.22/gas/testsuite/gas/ppc/e5500_nop.d
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils-2.22/gas/testsuite/gas/ppc/e5500_nop.d 2012-07-06 20:41:27.826780001 -0700
@@ -0,0 +1,13 @@
+#as: -mppc -me5500
+#objdump: -dr -Me5500
+#name: Power E5500 nop tests
+
+.*: +file format elf(32)?(64)?-powerpc.*
+
+Disassembly of section \.text:
+
+0+00 <start>:
+ 0: 60 00 00 00 nop
+ 4: 60 00 00 00 nop
+ 8: 60 00 00 00 nop
+ c: 60 00 00 00 nop
Index: binutils-2.22/gas/testsuite/gas/ppc/e5500_nop.s
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils-2.22/gas/testsuite/gas/ppc/e5500_nop.s 2012-07-06 20:41:27.826780001 -0700
@@ -0,0 +1,5 @@
+# Power E5500 nop tests
+ .section ".text"
+start:
+ nop
+ .p2align 4,,15
Index: binutils-2.22/gas/testsuite/gas/ppc/e6500.d
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils-2.22/gas/testsuite/gas/ppc/e6500.d 2012-07-06 20:41:27.826780001 -0700
@@ -0,0 +1,75 @@
+#as: -mppc -me6500
+#objdump: -dr -Me6500
+#name: Power E6500 tests
+
+.*: +file format elf(32)?(64)?-powerpc.*
+
+Disassembly of section \.text:
+
+0+00 <start>:
+ 0: 10 01 10 c0 vabsdub v0,v1,v2
+ 4: 10 01 11 00 vabsduh v0,v1,v2
+ 8: 10 01 11 40 vabsduw v0,v1,v2
+ c: 7c 01 10 dc mvidsplt v0,r1,r2
+ 10: 7c 01 11 1c mviwsplt v0,r1,r2
+ 14: 7c 00 12 0a lvexbx v0,0,r2
+ 18: 7c 01 12 0a lvexbx v0,r1,r2
+ 1c: 7c 00 12 4a lvexhx v0,0,r2
+ 20: 7c 01 12 4a lvexhx v0,r1,r2
+ 24: 7c 00 12 8a lvexwx v0,0,r2
+ 28: 7c 01 12 8a lvexwx v0,r1,r2
+ 2c: 7c 00 13 0a stvexbx v0,0,r2
+ 30: 7c 01 13 0a stvexbx v0,r1,r2
+ 34: 7c 00 13 4a stvexhx v0,0,r2
+ 38: 7c 01 13 4a stvexhx v0,r1,r2
+ 3c: 7c 00 13 8a stvexwx v0,0,r2
+ 40: 7c 01 13 8a stvexwx v0,r1,r2
+ 44: 7c 00 12 4e lvepx v0,0,r2
+ 48: 7c 01 12 4e lvepx v0,r1,r2
+ 4c: 7c 00 12 0e lvepxl v0,0,r2
+ 50: 7c 01 12 0e lvepxl v0,r1,r2
+ 54: 7c 00 16 4e stvepx v0,0,r2
+ 58: 7c 01 16 4e stvepx v0,r1,r2
+ 5c: 7c 00 16 0e stvepxl v0,0,r2
+ 60: 7c 01 16 0e stvepxl v0,r1,r2
+ 64: 7c 00 14 8a lvtlx v0,0,r2
+ 68: 7c 01 14 8a lvtlx v0,r1,r2
+ 6c: 7c 00 16 8a lvtlxl v0,0,r2
+ 70: 7c 01 16 8a lvtlxl v0,r1,r2
+ 74: 7c 00 14 4a lvtrx v0,0,r2
+ 78: 7c 01 14 4a lvtrx v0,r1,r2
+ 7c: 7c 00 16 4a lvtrxl v0,0,r2
+ 80: 7c 01 16 4a lvtrxl v0,r1,r2
+ 84: 7c 00 15 8a stvflx v0,0,r2
+ 88: 7c 01 15 8a stvflx v0,r1,r2
+ 8c: 7c 00 17 8a stvflxl v0,0,r2
+ 90: 7c 01 17 8a stvflxl v0,r1,r2
+ 94: 7c 00 15 4a stvfrx v0,0,r2
+ 98: 7c 01 15 4a stvfrx v0,r1,r2
+ 9c: 7c 00 17 4a stvfrxl v0,0,r2
+ a0: 7c 01 17 4a stvfrxl v0,r1,r2
+ a4: 7c 00 14 ca lvswx v0,0,r2
+ a8: 7c 01 14 ca lvswx v0,r1,r2
+ ac: 7c 00 16 ca lvswxl v0,0,r2
+ b0: 7c 01 16 ca lvswxl v0,r1,r2
+ b4: 7c 00 15 ca stvswx v0,0,r2
+ b8: 7c 01 15 ca stvswx v0,r1,r2
+ bc: 7c 00 17 ca stvswxl v0,0,r2
+ c0: 7c 01 17 ca stvswxl v0,r1,r2
+ c4: 7c 00 16 0a lvsm v0,0,r2
+ c8: 7c 01 16 0a lvsm v0,r1,r2
+ cc: 7f 5a d3 78 miso
+ d0: 7c 00 04 ac sync
+ d4: 7c 00 04 ac sync
+ d8: 7c 20 04 ac lwsync
+ dc: 7c 00 04 ac sync
+ e0: 7c 07 04 ac sync 0,7
+ e4: 7c 28 04 ac sync 1,8
+ e8: 7c 00 00 c3 dni 0,0
+ ec: 7f ff 00 c3 dni 31,31
+ f0: 7c 40 0b 4d dcblq. 2,0,r1
+ f4: 7c 43 0b 4d dcblq. 2,r3,r1
+ f8: 7c 40 09 8d icblq. 2,0,r1
+ fc: 7c 43 09 8d icblq. 2,r3,r1
+ 100: 7c 10 02 dc mftmr r0,16
+ 104: 7c 10 03 dc mttmr 16,r0
Index: binutils-2.22/gas/testsuite/gas/ppc/e6500.s
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils-2.22/gas/testsuite/gas/ppc/e6500.s 2012-07-06 20:41:27.830780001 -0700
@@ -0,0 +1,69 @@
+# Power E6500 tests
+ .section ".text"
+start:
+ vabsdub 0, 1, 2
+ vabsduh 0, 1, 2
+ vabsduw 0, 1, 2
+ mvidsplt 0, 1, 2
+ mviwsplt 0, 1, 2
+ lvexbx 0, 0, 2
+ lvexbx 0, 1, 2
+ lvexhx 0, 0, 2
+ lvexhx 0, 1, 2
+ lvexwx 0, 0, 2
+ lvexwx 0, 1, 2
+ stvexbx 0, 0, 2
+ stvexbx 0, 1, 2
+ stvexhx 0, 0, 2
+ stvexhx 0, 1, 2
+ stvexwx 0, 0, 2
+ stvexwx 0, 1, 2
+ lvepx 0, 0, 2
+ lvepx 0, 1, 2
+ lvepxl 0, 0, 2
+ lvepxl 0, 1, 2
+ stvepx 0, 0, 2
+ stvepx 0, 1, 2
+ stvepxl 0, 0, 2
+ stvepxl 0, 1, 2
+ lvtlx 0, 0, 2
+ lvtlx 0, 1, 2
+ lvtlxl 0, 0, 2
+ lvtlxl 0, 1, 2
+ lvtrx 0, 0, 2
+ lvtrx 0, 1, 2
+ lvtrxl 0, 0, 2
+ lvtrxl 0, 1, 2
+ stvflx 0, 0, 2
+ stvflx 0, 1, 2
+ stvflxl 0, 0, 2
+ stvflxl 0, 1, 2
+ stvfrx 0, 0, 2
+ stvfrx 0, 1, 2
+ stvfrxl 0, 0, 2
+ stvfrxl 0, 1, 2
+ lvswx 0, 0, 2
+ lvswx 0, 1, 2
+ lvswxl 0, 0, 2
+ lvswxl 0, 1, 2
+ stvswx 0, 0, 2
+ stvswx 0, 1, 2
+ stvswxl 0, 0, 2
+ stvswxl 0, 1, 2
+ lvsm 0, 0, 2
+ lvsm 0, 1, 2
+ miso
+ sync
+ sync 0,0
+ sync 1,0
+ sync 2,0
+ sync 3,7
+ sync 3,8
+ dni 0,0
+ dni 31,31
+ dcblq. 2,0,1
+ dcblq. 2,3,1
+ icblq. 2,0,1
+ icblq. 2,3,1
+ mftmr 0,16
+ mttmr 16,0
Index: binutils-2.22/gas/testsuite/gas/ppc/e6500_nop.d
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils-2.22/gas/testsuite/gas/ppc/e6500_nop.d 2012-07-06 20:41:27.830780001 -0700
@@ -0,0 +1,13 @@
+#as: -mppc -me6500
+#objdump: -dr -Me6500
+#name: Power E6500 nop tests
+
+.*: +file format elf(32)?(64)?-powerpc.*
+
+Disassembly of section \.text:
+
+0+00 <start>:
+ 0: 60 00 00 00 nop
+ 4: 60 00 00 00 nop
+ 8: 60 00 00 00 nop
+ c: 60 00 00 00 nop
Index: binutils-2.22/gas/testsuite/gas/ppc/e6500_nop.s
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils-2.22/gas/testsuite/gas/ppc/e6500_nop.s 2012-07-06 20:41:27.830780001 -0700
@@ -0,0 +1,5 @@
+# Power E6500 nop tests
+ .section ".text"
+start:
+ nop
+ .p2align 4,,15
Index: binutils-2.22/gas/testsuite/gas/ppc/ppc.exp
===================================================================
--- binutils-2.22.orig/gas/testsuite/gas/ppc/ppc.exp 2010-02-07 17:59:38.000000000 -0800
+++ binutils-2.22/gas/testsuite/gas/ppc/ppc.exp 2012-07-06 20:41:27.830780001 -0700
@@ -42,6 +42,10 @@
run_list_test "range" "-a32"
run_dump_test "ppc750ps"
run_dump_test "e500mc"
+ run_dump_test "e6500"
+ run_dump_test "e500mc64_nop"
+ run_dump_test "e5500_nop"
+ run_dump_test "e6500_nop"
run_dump_test "a2"
run_dump_test "cell"
run_dump_test "common"
Index: binutils-2.22/include/opcode/ppc.h
===================================================================
--- binutils-2.22.orig/include/opcode/ppc.h 2010-07-02 23:51:53.000000000 -0700
+++ binutils-2.22/include/opcode/ppc.h 2012-07-06 20:41:27.830780001 -0700
@@ -1,6 +1,6 @@
/* ppc.h -- Header file for PowerPC opcode table
Copyright 1994, 1995, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
- 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+ 2007, 2008, 2009, 2010, 2012 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Cygnus Support
This file is part of GDB, GAS, and the GNU binutils.
@@ -174,6 +174,15 @@
/* Opcode which is supported by the e500 family */
#define PPC_OPCODE_E500 0x100000000ull
+/* Opcode is supported by Extended Altivec Vector Unit */
+#define PPC_OPCODE_ALTIVEC2 0x200000000ull
+
+/* Opcode is supported by Power E6500 */
+#define PPC_OPCODE_E6500 0x400000000ull
+
+/* Opcode is supported by Thread management APU */
+#define PPC_OPCODE_TMR 0x800000000ull
+
/* A macro to extract the major opcode from an instruction. */
#define PPC_OP(i) (((i) >> 26) & 0x3f)
Index: binutils-2.22/opcodes/ppc-dis.c
===================================================================
--- binutils-2.22.orig/opcodes/ppc-dis.c 2012-07-06 20:40:40.000000000 -0700
+++ binutils-2.22/opcodes/ppc-dis.c 2012-07-06 20:41:27.830780001 -0700
@@ -1,6 +1,6 @@
/* ppc-dis.c -- Disassemble PowerPC instructions
Copyright 1994, 1995, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
- 2008, 2009, 2010 Free Software Foundation, Inc.
+ 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Cygnus Support
This file is part of the GNU opcodes library.
@@ -114,6 +114,18 @@
| PPC_OPCODE_E500MC | PPC_OPCODE_64 | PPC_OPCODE_POWER5
| PPC_OPCODE_POWER6 | PPC_OPCODE_POWER7),
0 },
+ { "e5500", (PPC_OPCODE_PPC | PPC_OPCODE_BOOKE | PPC_OPCODE_ISEL
+ | PPC_OPCODE_PMR | PPC_OPCODE_CACHELCK | PPC_OPCODE_RFMCI
+ | PPC_OPCODE_E500MC | PPC_OPCODE_64 | PPC_OPCODE_POWER4
+ | PPC_OPCODE_POWER5 | PPC_OPCODE_POWER6
+ | PPC_OPCODE_POWER7),
+ 0 },
+ { "e6500", (PPC_OPCODE_PPC | PPC_OPCODE_BOOKE | PPC_OPCODE_ISEL
+ | PPC_OPCODE_PMR | PPC_OPCODE_CACHELCK | PPC_OPCODE_RFMCI
+ | PPC_OPCODE_E500MC | PPC_OPCODE_64 | PPC_OPCODE_ALTIVEC
+ | PPC_OPCODE_ALTIVEC2 | PPC_OPCODE_E6500 | PPC_OPCODE_POWER4
+ | PPC_OPCODE_POWER5 | PPC_OPCODE_POWER6 | PPC_OPCODE_POWER7),
+ 0 },
{ "e500x2", (PPC_OPCODE_PPC | PPC_OPCODE_BOOKE | PPC_OPCODE_SPE
| PPC_OPCODE_ISEL | PPC_OPCODE_EFS | PPC_OPCODE_BRLOCK
| PPC_OPCODE_PMR | PPC_OPCODE_CACHELCK | PPC_OPCODE_RFMCI
Index: binutils-2.22/opcodes/ppc-opc.c
===================================================================
--- binutils-2.22.orig/opcodes/ppc-opc.c 2011-11-21 01:29:40.000000000 -0800
+++ binutils-2.22/opcodes/ppc-opc.c 2012-07-06 20:41:27.834780001 -0700
@@ -1,6 +1,6 @@
/* ppc-opc.c -- PowerPC opcode list
Copyright 1994, 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2004,
- 2005, 2006, 2007, 2008, 2009, 2010, 2011
+ 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
Free Software Foundation, Inc.
Written by Ian Lance Taylor, Cygnus Support
@@ -53,6 +53,7 @@
static long extract_boe (unsigned long, ppc_cpu_t, int *);
static unsigned long insert_fxm (unsigned long, long, ppc_cpu_t, const char **);
static long extract_fxm (unsigned long, ppc_cpu_t, int *);
+static unsigned long insert_ls (unsigned long, long, ppc_cpu_t, const char **);
static unsigned long insert_mbe (unsigned long, long, ppc_cpu_t, const char **);
static long extract_mbe (unsigned long, ppc_cpu_t, int *);
static unsigned long insert_mb6 (unsigned long, long, ppc_cpu_t, const char **);
@@ -477,6 +478,7 @@
lower 5 bits are stored in the upper 5 and vice- versa. */
#define SPR SISIGNOPT + 1
#define PMR SPR
+#define TMR SPR
#define SPR_MASK (0x3ff << 11)
{ 0x3ff, 11, insert_spr, extract_spr, 0 },
@@ -499,8 +501,12 @@
#define T STRM
{ 0x3, 21, NULL, NULL, 0 },
+ /* The ESYNC field in an X (sync) form instruction. */
+#define ESYNC STRM + 1
+ { 0xf, 16, insert_ls, NULL, PPC_OPERAND_OPTIONAL },
+
/* The SV field in a POWER SC form instruction. */
-#define SV STRM + 1
+#define SV ESYNC + 1
{ 0x3fff, 2, NULL, NULL, 0 },
/* The TBR field in an XFX form instruction. This is like the SPR
@@ -542,6 +548,7 @@
/* The UIMM field in a VX form instruction. */
#define UIMM SIMM + 1
+#define DCTL UIMM
{ 0x1f, 16, NULL, NULL, 0 },
/* The SHB field in a VA form instruction. */
@@ -1027,6 +1034,32 @@
return mask;
}
+/* The LS field in a sync instruction that accepts 2 operands
+ Values 2 and 3 are reserved,
+ must be treated as 0 for future compatibility
+ Values 0 and 1 can be accepted, if field ESYNC is zero
+ Otherwise L = complement of ESYNC-bit2 (1<<18) */
+
+static unsigned long
+insert_ls (unsigned long insn,
+ long value,
+ ppc_cpu_t dialect ATTRIBUTE_UNUSED,
+ const char **errmsg ATTRIBUTE_UNUSED)
+{
+ unsigned long ls;
+
+ ls = (insn >> 21) & 0x03;
+ if (value == 0)
+ {
+ if (ls > 1)
+ return insn & ~(0x3 << 21);
+ return insn;
+ }
+ if ((value & 0x2) != 0)
+ return (insn & ~(0x3 << 21)) | ((value & 0xf) << 16);
+ return (insn & ~(0x3 << 21)) | (0x1 << 21) | ((value & 0xf) << 16);
+}
+
/* The MB and ME fields in an M form instruction expressed as a single
operand which is itself a bitmask. The extraction function always
marks it as invalid, since we never want to recognize an
@@ -1795,6 +1828,9 @@
/* An X form sync instruction with everything filled in except the LS field. */
#define XSYNC_MASK (0xff9fffff)
+/* An X form sync instruction with everything filled in except the L and E fields. */
+#define XSYNCLE_MASK (0xff90ffff)
+
/* An X_MASK, but with the EH bit clear. */
#define XEH_MASK (X_MASK & ~((unsigned long )1))
@@ -1989,6 +2025,7 @@
#define PPC860 PPC
#define PPCPS PPC_OPCODE_PPCPS
#define PPCVEC PPC_OPCODE_ALTIVEC
+#define PPCVEC2 PPC_OPCODE_ALTIVEC2
#define PPCVSX PPC_OPCODE_VSX
#define POWER PPC_OPCODE_POWER
#define POWER2 PPC_OPCODE_POWER | PPC_OPCODE_POWER2
@@ -2007,6 +2044,7 @@
#define PPCEFS PPC_OPCODE_EFS
#define PPCBRLK PPC_OPCODE_BRLOCK
#define PPCPMR PPC_OPCODE_PMR
+#define PPCTMR PPC_OPCODE_TMR
#define PPCCHLK PPC_OPCODE_CACHELCK
#define PPCRFMCI PPC_OPCODE_RFMCI
#define E500MC PPC_OPCODE_E500MC
@@ -2014,6 +2052,7 @@
#define TITAN PPC_OPCODE_TITAN
#define MULHW PPC_OPCODE_405 | PPC_OPCODE_440 | TITAN
#define E500 PPC_OPCODE_E500
+#define E6500 PPC_OPCODE_E6500
/* The opcode table.
@@ -2179,12 +2218,14 @@
{"machhwsu", XO (4, 76,0,0),XO_MASK, MULHW, PPCNONE, {RT, RA, RB}},
{"machhwsu.", XO (4, 76,0,1),XO_MASK, MULHW, PPCNONE, {RT, RA, RB}},
{"ps_cmpo1", X (4, 96), X_MASK|(3<<21), PPCPS, PPCNONE, {BF, FRA, FRB}},
+{"vabsdub", VX (4, 192), VX_MASK, PPCVEC2, PPCNONE, {VD, VA, VB}},
{"vcmpeqfp", VXR(4, 198,0), VXR_MASK, PPCVEC, PPCNONE, {VD, VA, VB}},
{"vpkuwus", VX (4, 206), VX_MASK, PPCVEC, PPCNONE, {VD, VA, VB}},
{"machhws", XO (4, 108,0,0),XO_MASK, MULHW, PPCNONE, {RT, RA, RB}},
{"machhws.", XO (4, 108,0,1),XO_MASK, MULHW, PPCNONE, {RT, RA, RB}},
{"nmachhws", XO (4, 110,0,0),XO_MASK, MULHW, PPCNONE, {RT, RA, RB}},
{"nmachhws.", XO (4, 110,0,1),XO_MASK, MULHW, PPCNONE, {RT, RA, RB}},
+{"vabsduh", VX (4, 256), VX_MASK, PPCVEC2, PPCNONE, {VD, VA, VB}},
{"vmaxsb", VX (4, 258), VX_MASK, PPCVEC, PPCNONE, {VD, VA, VB}},
{"vslb", VX (4, 260), VX_MASK, PPCVEC, PPCNONE, {VD, VA, VB}},
{"vmulosb", VX (4, 264), VX_MASK, PPCVEC, PPCNONE, {VD, VA, VB}},
@@ -2197,6 +2238,7 @@
{"mulchwu.", XRC(4, 136,1), X_MASK, MULHW, PPCNONE, {RT, RA, RB}},
{"macchwu", XO (4, 140,0,0),XO_MASK, MULHW, PPCNONE, {RT, RA, RB}},
{"macchwu.", XO (4, 140,0,1),XO_MASK, MULHW, PPCNONE, {RT, RA, RB}},
+{"vabsduw", VX (4, 320), VX_MASK, PPCVEC2, PPCNONE, {VD, VA, VB}},
{"vmaxsh", VX (4, 322), VX_MASK, PPCVEC, PPCNONE, {VD, VA, VB}},
{"vslh", VX (4, 324), VX_MASK, PPCVEC, PPCNONE, {VD, VA, VB}},
{"vmulosh", VX (4, 328), VX_MASK, PPCVEC, PPCNONE, {VD, VA, VB}},
@@ -3680,6 +3722,8 @@
{"lbepx", X(31,95), X_MASK, E500MC|PPCA2, PPCNONE, {RT, RA, RB}},
+{"dni", XRC(31,97,1), XRB_MASK, E6500, PPCNONE, {DUI, DCTL}},
+
{"lvx", X(31,103), X_MASK, PPCVEC, PPCNONE, {VD, RA, RB}},
{"lqfcmx", APU(31,103,0), APU_MASK, PPC405, PPCNONE, {FCRT, RA, RB}},
@@ -3689,6 +3733,8 @@
{"mul", XO(31,107,0,0), XO_MASK, M601, PPCNONE, {RT, RA, RB}},
{"mul.", XO(31,107,0,1), XO_MASK, M601, PPCNONE, {RT, RA, RB}},
+{"mvidsplt", X(31,110), X_MASK, PPCVEC2, PPCNONE, {VD, RA, RB}},
+
{"mtsrdin", X(31,114), XRA_MASK, PPC64, PPCNONE, {RS, RB}},
{"lharx", X(31,116), XEH_MASK, POWER7, PPCNONE, {RT, RA0, RB, EH}},
@@ -3723,7 +3769,9 @@
{"adde.", XO(31,138,0,1), XO_MASK, PPCCOM, PPCNONE, {RT, RA, RB}},
{"ae.", XO(31,138,0,1), XO_MASK, PWRCOM, PPCNONE, {RT, RA, RB}},
-{"dcbtstlse", X(31,142), X_MASK, PPCCHLK, PPCNONE, {CT, RA, RB}},
+{"mviwsplt", X(31,142), X_MASK, PPCVEC2, PPCNONE, {VD, RA, RB}},
+
+{"dcbtstlse", X(31,142), X_MASK, PPCCHLK, E500MC, {CT, RA, RB}},
{"mtcr", XFXM(31,144,0xff,0), XRARB_MASK, COM, PPCNONE, {RS}},
{"mtcrf", XFXM(31,144,0,0), XFXFXM_MASK, COM, PPCNONE, {FXM, RS}},
@@ -3760,7 +3808,7 @@
{"stvehx", X(31,167), X_MASK, PPCVEC, PPCNONE, {VS, RA, RB}},
{"sthfcmx", APU(31,167,0), APU_MASK, PPC405, PPCNONE, {FCRT, RA, RB}},
-{"dcbtlse", X(31,174), X_MASK, PPCCHLK, PPCNONE, {CT, RA, RB}},
+{"dcbtlse", X(31,174), X_MASK, PPCCHLK, E500MC, {CT, RA, RB}},
{"mtmsrd", X(31,178), XRLARB_MASK, PPC64, PPCNONE, {RS, A_L}},
@@ -3778,6 +3826,8 @@
{"prtyd", X(31,186), XRB_MASK, POWER6|PPCA2, PPCNONE, {RA, RS}},
+{"icblq.", XRC(31,198,1), X_MASK, E6500, PPCNONE, {CT, RA0, RB}},
+
{"stvewx", X(31,199), X_MASK, PPCVEC, PPCNONE, {VS, RA, RB}},
{"stwfcmx", APU(31,199,0), APU_MASK, PPC405, PPCNONE, {FCRT, RA, RB}},
@@ -3855,8 +3905,12 @@
{"mfdcrx", X(31,259), X_MASK, BOOKE|PPCA2|PPC476, TITAN, {RS, RA}},
{"mfdcrx.", XRC(31,259,1), X_MASK, PPCA2, PPCNONE, {RS, RA}},
+{"lvexbx", X(31,261), X_MASK, PPCVEC2, PPCNONE, {VD, RA0, RB}},
+
{"icbt", X(31,262), XRT_MASK, PPC403, PPCNONE, {RA, RB}},
+{"lvepxl", X(31,263), X_MASK, PPCVEC2, PPCNONE, {VD, RA0, RB}},
+
{"ldfcmx", APU(31,263,0), APU_MASK, PPC405, PPCNONE, {FCRT, RA, RB}},
{"doz", XO(31,264,0,0), XO_MASK, M601, PPCNONE, {RT, RA, RB}},
{"doz.", XO(31,264,0,1), XO_MASK, M601, PPCNONE, {RT, RA, RB}},
@@ -3890,6 +3944,9 @@
{"mfdcrux", X(31,291), X_MASK, PPC464, PPCNONE, {RS, RA}},
+{"lvexhx", X(31,293), X_MASK, PPCVEC2, PPCNONE, {VD, RA0, RB}},
+{"lvepx", X(31,295), X_MASK, PPCVEC2, PPCNONE, {VD, RA0, RB}},
+
{"tlbie", X(31,306), XRTLRA_MASK, PPC, TITAN, {RB, L}},
{"tlbi", X(31,306), XRT_MASK, POWER, PPCNONE, {RA0, RB}},
@@ -3941,6 +3998,8 @@
{"mfdcr", X(31,323), X_MASK, PPC403|BOOKE|PPCA2|PPC476, TITAN, {RT, SPR}},
{"mfdcr.", XRC(31,323,1), X_MASK, PPCA2, PPCNONE, {RT, SPR}},
+{"lvexwx", X(31,325), X_MASK, PPCVEC2, PPCNONE, {VD, RA0, RB}},
+
{"dcread", X(31,326), X_MASK, PPC476|TITAN, PPCNONE, {RT, RA, RB}},
{"div", XO(31,331,0,0), XO_MASK, M601, PPCNONE, {RT, RA, RB}},
@@ -3949,6 +4008,7 @@
{"lxvdsx", X(31,332), XX1_MASK, PPCVSX, PPCNONE, {XT6, RA, RB}},
{"mfpmr", X(31,334), X_MASK, PPCPMR|PPCE300, PPCNONE, {RT, PMR}},
+{"mftmr", X(31,366), X_MASK, PPCTMR|E6500, PPCNONE, {RT, TMR}},
{"mfmq", XSPR(31,339, 0), XSPR_MASK, M601, PPCNONE, {RT}},
{"mfxer", XSPR(31,339, 1), XSPR_MASK, COM, PPCNONE, {RT}},
@@ -4179,6 +4239,8 @@
{"mtdcrx", X(31,387), X_MASK, BOOKE|PPCA2|PPC476, TITAN, {RA, RS}},
{"mtdcrx.", XRC(31,387,1), X_MASK, PPCA2, PPCNONE, {RA, RS}},
+{"stvexbx", X(31,389), X_MASK, PPCVEC2, PPCNONE, {VS, RA0, RB}},
+
{"dcblc", X(31,390), X_MASK, PPCCHLK|PPC476|TITAN, PPCNONE, {CT, RA, RB}},
{"stdfcmx", APU(31,391,0), APU_MASK, PPC405, PPCNONE, {FCRT, RA, RB}},
@@ -4187,7 +4249,7 @@
{"divweu", XO(31,395,0,0), XO_MASK, POWER7|PPCA2, PPCNONE, {RT, RA, RB}},
{"divweu.", XO(31,395,0,1), XO_MASK, POWER7|PPCA2, PPCNONE, {RT, RA, RB}},
-{"dcblce", X(31,398), X_MASK, PPCCHLK, PPCNONE, {CT, RA, RB}},
+{"dcblce", X(31,398), X_MASK, PPCCHLK, E500MC, {CT, RA, RB}},
{"slbmte", X(31,402), XRA_MASK, PPC64, PPCNONE, {RS, RB}},
@@ -4203,6 +4265,10 @@
{"mtdcrux", X(31,419), X_MASK, PPC464, PPCNONE, {RA, RS}},
+{"stvexhx", X(31,421), X_MASK, PPCVEC2, PPCNONE, {VS, RA0, RB}},
+
+{"dcblq.", XRC(31,422,1), X_MASK, E6500, PPCNONE, {CT, RA0, RB}},
+
{"divde", XO(31,425,0,0), XO_MASK, POWER7|PPCA2, PPCNONE, {RT, RA, RB}},
{"divde.", XO(31,425,0,1), XO_MASK, POWER7|PPCA2, PPCNONE, {RT, RA, RB}},
{"divwe", XO(31,427,0,0), XO_MASK, POWER7|PPCA2, PPCNONE, {RT, RA, RB}},
@@ -4216,6 +4282,8 @@
{"mdors", 0x7f9ce378, 0xffffffff, E500MC, PPCNONE, {0}},
+{"miso", 0x7f5ad378, 0xffffffff, E6500, PPCNONE, {0}},
+
{"mr", XRC(31,444,0), X_MASK, COM, PPCNONE, {RA, RS, RBS}},
{"or", XRC(31,444,0), X_MASK, COM, PPCNONE, {RA, RS, RB}},
{"mr.", XRC(31,444,1), X_MASK, COM, PPCNONE, {RA, RS, RBS}},
@@ -4258,6 +4326,8 @@
{"mtdcr", X(31,451), X_MASK, PPC403|BOOKE|PPCA2|PPC476, TITAN, {SPR, RS}},
{"mtdcr.", XRC(31,451,1), X_MASK, PPCA2, PPCNONE, {SPR, RS}},
+{"stvexwx", X(31,453), X_MASK, PPCVEC2, PPCNONE, {VS, RA0, RB}},
+
{"dccci", X(31,454), XRT_MASK, PPC403|PPC440|TITAN|PPCA2, PPCNONE, {RAOPT, RBOPT}},
{"dci", X(31,454), XRARB_MASK, PPCA2|PPC476, PPCNONE, {CT}},
@@ -4268,6 +4338,7 @@
{"divwu.", XO(31,459,0,1), XO_MASK, PPC, PPCNONE, {RT, RA, RB}},
{"mtpmr", X(31,462), X_MASK, PPCPMR|PPCE300, PPCNONE, {PMR, RS}},
+{"mttmr", X(31,494), X_MASK, PPCTMR|E6500, PPCNONE, {TMR, RS}},
{"mtmq", XSPR(31,467, 0), XSPR_MASK, M601, PPCNONE, {RS}},
{"mtxer", XSPR(31,467, 1), XSPR_MASK, COM, PPCNONE, {RS}},
@@ -4453,7 +4524,7 @@
{"divw", XO(31,491,0,0), XO_MASK, PPC, PPCNONE, {RT, RA, RB}},
{"divw.", XO(31,491,0,1), XO_MASK, PPC, PPCNONE, {RT, RA, RB}},
-{"icbtlse", X(31,494), X_MASK, PPCCHLK, PPCNONE, {CT, RA, RB}},
+{"icbtlse", X(31,494), X_MASK, PPCCHLK, E500MC, {CT, RA, RB}},
{"slbia", X(31,498), 0xffffffff, PPC64, PPCNONE, {0}},
@@ -4512,6 +4583,8 @@
{"lhdx", X(31,547), X_MASK, E500MC, PPCNONE, {RT, RA, RB}},
+{"lvtrx", X(31,549), X_MASK, PPCVEC2, PPCNONE, {VD, RA0, RB}},
+
{"bbelr", X(31,550), X_MASK, PPCBRLK, PPCNONE, {0}},
{"lvrx", X(31,551), X_MASK, CELL, PPCNONE, {VD, RA0, RB}},
@@ -4528,6 +4601,8 @@
{"lwdx", X(31,579), X_MASK, E500MC, PPCNONE, {RT, RA, RB}},
+{"lvtlx", X(31,581), X_MASK, PPCVEC2, PPCNONE, {VD, RA0, RB}},
+
{"lwfcmux", APU(31,583,0), APU_MASK, PPC405, PPCNONE, {FCRT, RA, RB}},
{"lxsdx", X(31,588), XX1_MASK, PPCVSX, PPCNONE, {XT6, RA, RB}},
@@ -4539,9 +4614,10 @@
{"lwsync", XSYNC(31,598,1), 0xffffffff, PPC, E500, {0}},
{"ptesync", XSYNC(31,598,2), 0xffffffff, PPC64, PPCNONE, {0}},
+{"sync", X(31,598), XSYNCLE_MASK,E6500, PPCNONE, {LS, ESYNC}},
{"sync", X(31,598), XSYNC_MASK, PPCCOM, BOOKE|PPC476, {LS}},
{"msync", X(31,598), 0xffffffff, BOOKE|PPCA2|PPC476, PPCNONE, {0}},
-{"sync", X(31,598), 0xffffffff, BOOKE|PPC476, PPCNONE, {0}},
+{"sync", X(31,598), 0xffffffff, BOOKE|PPC476, E6500, {0}},
{"lwsync", X(31,598), 0xffffffff, E500, PPCNONE, {0}},
{"dcs", X(31,598), 0xffffffff, PWRCOM, PPCNONE, {0}},
@@ -4552,6 +4628,8 @@
{"lddx", X(31,611), X_MASK, E500MC, PPCNONE, {RT, RA, RB}},
+{"lvswx", X(31,613), X_MASK, PPCVEC2, PPCNONE, {VD, RA0, RB}},
+
{"lqfcmux", APU(31,615,0), APU_MASK, PPC405, PPCNONE, {FCRT, RA, RB}},
{"nego", XO(31,104,1,0), XORB_MASK, COM, PPCNONE, {RT, RA}},
@@ -4601,6 +4679,8 @@
{"sthdx", X(31,675), X_MASK, E500MC, PPCNONE, {RS, RA, RB}},
+{"stvfrx", X(31,677), X_MASK, PPCVEC2, PPCNONE, {VS, RA0, RB}},
+
{"stvrx", X(31,679), X_MASK, CELL, PPCNONE, {VS, RA0, RB}},
{"sthfcmux", APU(31,679,0), APU_MASK, PPC405, PPCNONE, {FCRT, RA, RB}},
@@ -4613,6 +4693,8 @@
{"stwdx", X(31,707), X_MASK, E500MC, PPCNONE, {RS, RA, RB}},
+{"stvflx", X(31,709), X_MASK, PPCVEC2, PPCNONE, {VS, RA0, RB}},
+
{"stwfcmux", APU(31,711,0), APU_MASK, PPC405, PPCNONE, {FCRT, RA, RB}},
{"stxsdx", X(31,716), XX1_MASK, PPCVSX, PPCNONE, {XS6, RA, RB}},
@@ -4645,6 +4727,8 @@
{"stddx", X(31,739), X_MASK, E500MC, PPCNONE, {RS, RA, RB}},
+{"stvswx", X(31,741), X_MASK, PPCVEC2, PPCNONE, {VS, RA0, RB}},
+
{"stqfcmux", APU(31,743,0), APU_MASK, PPC405, PPCNONE, {FCRT, RA, RB}},
{"subfmeo", XO(31,232,1,0), XORB_MASK, PPCCOM, PPCNONE, {RT, RA}},
@@ -4673,6 +4757,8 @@
{"srliq", XRC(31,760,0), X_MASK, M601, PPCNONE, {RA, RS, SH}},
{"srliq.", XRC(31,760,1), X_MASK, M601, PPCNONE, {RA, RS, SH}},
+{"lvsm", X(31,773), X_MASK, PPCVEC2, PPCNONE, {VD, RA0, RB}},
+{"stvepxl", X(31,775), X_MASK, PPCVEC2, PPCNONE, {VS, RA0, RB}},
{"lvlxl", X(31,775), X_MASK, CELL, PPCNONE, {VD, RA0, RB}},
{"ldfcmux", APU(31,775,0), APU_MASK, PPC405, PPCNONE, {FCRT, RA, RB}},
@@ -4705,6 +4791,8 @@
{"lfddx", X(31,803), X_MASK, E500MC, PPCNONE, {FRT, RA, RB}},
+{"lvtrxl", X(31,805), X_MASK, PPCVEC2, PPCNONE, {VD, RA0, RB}},
+{"stvepx", X(31,807), X_MASK, PPCVEC2, PPCNONE, {VS, RA0, RB}},
{"lvrxl", X(31,807), X_MASK, CELL, PPCNONE, {VD, RA0, RB}},
{"rac", X(31,818), X_MASK, M601, PPCNONE, {RT, RA, RB}},
@@ -4725,6 +4813,8 @@
{"sradi", XS(31,413,0), XS_MASK, PPC64, PPCNONE, {RA, RS, SH6}},
{"sradi.", XS(31,413,1), XS_MASK, PPC64, PPCNONE, {RA, RS, SH6}},
+{"lvtlxl", X(31,837), X_MASK, PPCVEC2, PPCNONE, {VD, RA0, RB}},
+
{"divo", XO(31,331,1,0), XO_MASK, M601, PPCNONE, {RT, RA, RB}},
{"divo.", XO(31,331,1,1), XO_MASK, M601, PPCNONE, {RT, RA, RB}},
@@ -4743,6 +4833,8 @@
{"lfiwax", X(31,855), X_MASK, POWER6|PPCA2|PPC476, PPCNONE, {FRT, RA0, RB}},
+{"lvswxl", X(31,869), X_MASK, PPCVEC2, PPCNONE, {VD, RA0, RB}},
+
{"abso", XO(31,360,1,0), XORB_MASK, M601, PPCNONE, {RT, RA}},
{"abso.", XO(31,360,1,1), XORB_MASK, M601, PPCNONE, {RT, RA}},
@@ -4788,6 +4880,8 @@
{"stfddx", X(31,931), X_MASK, E500MC, PPCNONE, {FRS, RA, RB}},
+{"stvfrxl", X(31,933), X_MASK, PPCVEC2, PPCNONE, {VS, RA0, RB}},
+
{"wclrone", XOPL2(31,934,2),XRT_MASK, PPCA2, PPCNONE, {RA0, RB}},
{"wclrall", X(31,934), XRARB_MASK, PPCA2, PPCNONE, {L}},
{"wclr", X(31,934), X_MASK, PPCA2, PPCNONE, {L, RA0, RB}},
@@ -4816,6 +4910,8 @@
{"extsb", XRC(31,954,0), XRB_MASK, PPC, PPCNONE, {RA, RS}},
{"extsb.", XRC(31,954,1), XRB_MASK, PPC, PPCNONE, {RA, RS}},
+{"stvflxl", X(31,965), X_MASK, PPCVEC2, PPCNONE, {VS, RA0, RB}},
+
{"iccci", X(31,966), XRT_MASK, PPC403|PPC440|TITAN|PPCA2, PPCNONE, {RAOPT, RBOPT}},
{"ici", X(31,966), XRARB_MASK, PPCA2|PPC476, PPCNONE, {CT}},
@@ -4843,6 +4939,8 @@
{"icbiep", XRT(31,991,0), XRT_MASK, E500MC|PPCA2, PPCNONE, {RA, RB}},
+{"stvswxl", X(31,997), X_MASK, PPCVEC2, PPCNONE, {VS, RA0, RB}},
+
{"icread", X(31,998), XRT_MASK, PPC403|PPC440|PPC476|TITAN, PPCNONE, {RA, RB}},
{"nabso", XO(31,488,1,0), XORB_MASK, M601, PPCNONE, {RT, RA}},

View File

@ -1,428 +0,0 @@
This is backport from 2.21 branch
Upstream-Status: Backport
Signed-off-by: Khem Raj <raj.khem@gmail.com>
commit 946593d19f203b02efd45b5102dd2787d9418e24
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Wed May 25 17:41:32 2011 +0000
Handle STT_GNU_IFUNC symols when building shared library.
bfd/
2012-05-25 H.J. Lu <hongjiu.lu@intel.com>
Backport from mainline
2012-01-06 H.J. Lu <hongjiu.lu@intel.com>
PR ld/12366
PR ld/12371
* elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Properly
handle symbols marked with regular reference, but not non-GOT
reference when building shared library.
* elf32-i386.c (elf_i386_gc_sweep_hook): Properly handle
local and global STT_GNU_IFUNC symols when building shared
library.
* elf64-x86-64.c (elf_x86_64_gc_sweep_hook): Likewise.
ld/testsuite/
2012-05-25 H.J. Lu <hongjiu.lu@intel.com>
Backport from mainline
2012-01-06 H.J. Lu <hongjiu.lu@intel.com>
PR ld/12366
PR ld/12371
* ld-ifunc/ifunc-10-i386.s: Add more tests.
* ld-ifunc/ifunc-10-x86-64.s: Likewise.
* ld-ifunc/ifunc-11-i386.s: Likewise.
* ld-ifunc/ifunc-11-x86-64.s: Likewise.
* ld-ifunc/ifunc-12-i386.d: New.
* ld-ifunc/ifunc-12-i386.s: Likewise.
* ld-ifunc/ifunc-12-x86-64.d: Likewise.
* ld-ifunc/ifunc-12-x86-64.s: Likewise.
* ld-ifunc/ifunc-13-i386.d: Likewise.
* ld-ifunc/ifunc-13-x86-64.d: Likewise.
* ld-ifunc/ifunc-13a-i386.s: Likewise.
* ld-ifunc/ifunc-13a-x86-64.s: Likewise.
* ld-ifunc/ifunc-13b-i386.s: Likewise.
* ld-ifunc/ifunc-13b-x86-64.s: Likewise.
Index: binutils-2.21/bfd/elf-ifunc.c
===================================================================
--- binutils-2.21.orig/bfd/elf-ifunc.c 2010-07-13 09:59:10.000000000 -0700
+++ binutils-2.21/bfd/elf-ifunc.c 2011-06-21 16:33:40.751884107 -0700
@@ -190,10 +190,29 @@
/* Support garbage collection against STT_GNU_IFUNC symbols. */
if (h->plt.refcount <= 0 && h->got.refcount <= 0)
{
- h->got = htab->init_got_offset;
- h->plt = htab->init_plt_offset;
- *head = NULL;
- return TRUE;
+ /* When building shared library, we need to handle the case
+ where it is marked with regular reference, but not non-GOT
+ reference. It may happen if we didn't see STT_GNU_IFUNC
+ symbol at the time when checking relocations. */
+ bfd_size_type count = 0;
+
+ if (info->shared
+ && !h->non_got_ref
+ && h->ref_regular)
+ {
+ for (p = *head; p != NULL; p = p->next)
+ count += p->count;
+ if (count != 0)
+ h->non_got_ref = 1;
+ }
+
+ if (count == 0)
+ {
+ h->got = htab->init_got_offset;
+ h->plt = htab->init_plt_offset;
+ *head = NULL;
+ return TRUE;
+ }
}
/* Return and discard space for dynamic relocations against it if
Index: binutils-2.21/bfd/elf32-i386.c
===================================================================
--- binutils-2.21.orig/bfd/elf32-i386.c 2010-10-21 05:29:02.000000000 -0700
+++ binutils-2.21/bfd/elf32-i386.c 2011-06-21 16:33:40.761884138 -0700
@@ -1807,23 +1807,10 @@
r_symndx = ELF32_R_SYM (rel->r_info);
if (r_symndx >= symtab_hdr->sh_info)
{
- struct elf_i386_link_hash_entry *eh;
- struct elf_dyn_relocs **pp;
- struct elf_dyn_relocs *p;
-
h = sym_hashes[r_symndx - symtab_hdr->sh_info];
while (h->root.type == bfd_link_hash_indirect
|| h->root.type == bfd_link_hash_warning)
h = (struct elf_link_hash_entry *) h->root.u.i.link;
- eh = (struct elf_i386_link_hash_entry *) h;
-
- for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next)
- if (p->sec == sec)
- {
- /* Everything must go for SEC. */
- *pp = p->next;
- break;
- }
}
else
{
@@ -1843,6 +1830,22 @@
}
}
+ if (h)
+ {
+ struct elf_i386_link_hash_entry *eh;
+ struct elf_dyn_relocs **pp;
+ struct elf_dyn_relocs *p;
+
+ eh = (struct elf_i386_link_hash_entry *) h;
+ for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next)
+ if (p->sec == sec)
+ {
+ /* Everything must go for SEC. */
+ *pp = p->next;
+ break;
+ }
+ }
+
r_type = ELF32_R_TYPE (rel->r_info);
if (! elf_i386_tls_transition (info, abfd, sec, NULL,
symtab_hdr, sym_hashes,
@@ -1883,7 +1886,8 @@
case R_386_32:
case R_386_PC32:
- if (info->shared)
+ if (info->shared
+ && (h == NULL || h->type != STT_GNU_IFUNC))
break;
/* Fall through */
Index: binutils-2.21/bfd/elf64-x86-64.c
===================================================================
--- binutils-2.21.orig/bfd/elf64-x86-64.c 2010-10-21 05:29:02.000000000 -0700
+++ binutils-2.21/bfd/elf64-x86-64.c 2011-06-21 16:33:40.761884138 -0700
@@ -1645,23 +1645,10 @@
r_symndx = ELF64_R_SYM (rel->r_info);
if (r_symndx >= symtab_hdr->sh_info)
{
- struct elf64_x86_64_link_hash_entry *eh;
- struct elf_dyn_relocs **pp;
- struct elf_dyn_relocs *p;
-
h = sym_hashes[r_symndx - symtab_hdr->sh_info];
while (h->root.type == bfd_link_hash_indirect
|| h->root.type == bfd_link_hash_warning)
h = (struct elf_link_hash_entry *) h->root.u.i.link;
- eh = (struct elf64_x86_64_link_hash_entry *) h;
-
- for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next)
- if (p->sec == sec)
- {
- /* Everything must go for SEC. */
- *pp = p->next;
- break;
- }
}
else
{
@@ -1682,7 +1669,24 @@
}
}
- r_type = ELF64_R_TYPE (rel->r_info);
+ if (h)
+ {
+ struct elf64_x86_64_link_hash_entry *eh;
+ struct elf_dyn_relocs **pp;
+ struct elf_dyn_relocs *p;
+
+ eh = (struct elf64_x86_64_link_hash_entry *) h;
+
+ for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next)
+ if (p->sec == sec)
+ {
+ /* Everything must go for SEC. */
+ *pp = p->next;
+ break;
+ }
+ }
+
+ r_type = ELF32_R_TYPE (rel->r_info);
if (! elf64_x86_64_tls_transition (info, abfd, sec, NULL,
symtab_hdr, sym_hashes,
&r_type, GOT_UNKNOWN,
@@ -1733,7 +1737,8 @@
case R_X86_64_PC16:
case R_X86_64_PC32:
case R_X86_64_PC64:
- if (info->shared)
+ if (info->shared
+ && (h == NULL || h->type != STT_GNU_IFUNC))
break;
/* Fall thru */
Index: binutils-2.21/ld/testsuite/ld-ifunc/ifunc-10-i386.s
===================================================================
--- binutils-2.21.orig/ld/testsuite/ld-ifunc/ifunc-10-i386.s 2010-07-13 09:59:14.000000000 -0700
+++ binutils-2.21/ld/testsuite/ld-ifunc/ifunc-10-i386.s 2011-06-21 16:36:36.832142380 -0700
@@ -6,6 +6,8 @@
movl ifunc@GOTOFF(%ecx), %eax
call ifunc@PLT
call ifunc
+ movl xxx@GOT(%ecx), %eax
+ movl xxx, %eax
ret
.section .text.bar,"ax",@progbits
@@ -18,3 +20,7 @@
.type ifunc, @gnu_indirect_function
ifunc:
ret
+
+ .section .data.foo,"aw",@progbits
+xxx:
+ .long ifunc
Index: binutils-2.21/ld/testsuite/ld-ifunc/ifunc-10-x86-64.s
===================================================================
--- binutils-2.21.orig/ld/testsuite/ld-ifunc/ifunc-10-x86-64.s 2010-07-13 09:59:14.000000000 -0700
+++ binutils-2.21/ld/testsuite/ld-ifunc/ifunc-10-x86-64.s 2011-06-21 16:36:36.822142371 -0700
@@ -6,6 +6,7 @@
movl ifunc(%rip), %eax
call ifunc@PLT
call ifunc
+ movl xxx(%rip), %eax
ret
.section .text.bar,"ax",@progbits
@@ -18,3 +19,7 @@
.type ifunc, @gnu_indirect_function
ifunc:
ret
+
+ .section .data.foo,"aw",@progbits
+xxx:
+ .quad ifunc
Index: binutils-2.21/ld/testsuite/ld-ifunc/ifunc-11-i386.s
===================================================================
--- binutils-2.21.orig/ld/testsuite/ld-ifunc/ifunc-11-i386.s 2010-07-13 09:59:14.000000000 -0700
+++ binutils-2.21/ld/testsuite/ld-ifunc/ifunc-11-i386.s 2011-06-21 16:36:36.832142380 -0700
@@ -3,9 +3,11 @@
foo:
.global foo
movl ifunc@GOT(%ecx), %eax
- movl ifunc@GOTOFF(%ecx), %eax
+ movl ifunc@GOTOFF(%ecx), %eax
call ifunc@PLT
call ifunc
+ movl xxx@GOT(%ecx), %eax
+ movl xxx, %eax
ret
.section .text.bar,"ax",@progbits
@@ -16,6 +18,10 @@
.section .text.ifunc,"ax",@progbits
.type ifunc, @gnu_indirect_function
- .global ifunc
+ .global ifunc
ifunc:
ret
+
+ .section .data.foo,"aw",@progbits
+xxx:
+ .long ifunc
Index: binutils-2.21/ld/testsuite/ld-ifunc/ifunc-11-x86-64.s
===================================================================
--- binutils-2.21.orig/ld/testsuite/ld-ifunc/ifunc-11-x86-64.s 2010-07-13 09:59:14.000000000 -0700
+++ binutils-2.21/ld/testsuite/ld-ifunc/ifunc-11-x86-64.s 2011-06-21 16:36:36.822142371 -0700
@@ -6,6 +6,7 @@
movl ifunc(%rip), %eax
call ifunc@PLT
call ifunc
+ movl xxx(%rip), %eax
ret
.section .text.bar,"ax",@progbits
@@ -19,3 +20,7 @@
.global ifunc
ifunc:
ret
+
+ .section .data.foo,"aw",@progbits
+xxx:
+ .quad ifunc
Index: binutils-2.21/ld/testsuite/ld-ifunc/ifunc-12-i386.d
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils-2.21/ld/testsuite/ld-ifunc/ifunc-12-i386.d 2011-06-21 16:33:40.761884138 -0700
@@ -0,0 +1,6 @@
+#ld: -shared -m elf_i386 -e bar --gc-sections
+#as: --32
+#readelf: -r --wide
+#target: x86_64-*-* i?86-*-*
+
+There are no relocations in this file.
Index: binutils-2.21/ld/testsuite/ld-ifunc/ifunc-12-x86-64.d
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils-2.21/ld/testsuite/ld-ifunc/ifunc-12-x86-64.d 2011-06-21 16:33:40.761884138 -0700
@@ -0,0 +1,6 @@
+#ld: -shared -m elf_x86_64 -e bar --gc-sections
+#as: --64
+#readelf: -r --wide
+#target: x86_64-*-*
+
+There are no relocations in this file.
Index: binutils-2.21/ld/testsuite/ld-ifunc/ifunc-13-i386.d
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils-2.21/ld/testsuite/ld-ifunc/ifunc-13-i386.d 2011-06-21 16:33:40.761884138 -0700
@@ -0,0 +1,19 @@
+#source: ifunc-13a-i386.s
+#source: ifunc-13b-i386.s
+#ld: -shared -m elf_i386 -z nocombreloc
+#as: --32
+#readelf: -r --wide
+#target: x86_64-*-* i?86-*-*
+
+Relocation section '.rel.got' at .*
+[ ]+Offset[ ]+Info[ ]+Type[ ]+.*
+#...
+[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_386_GLOB_DAT[ ]+ifunc\(\)[ ]+ifunc
+#...
+Relocation section '.rel.ifunc' at .*
+[ ]+Offset[ ]+Info[ ]+Type[ ]+.*
+[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_386_32[ ]+ifunc\(\)[ ]+ifunc
+#...
+Relocation section '.rel.plt' at .*
+[ ]+Offset[ ]+Info[ ]+Type[ ]+.*
+[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_386_JUMP_SLOT[ ]+ifunc\(\)[ ]+ifunc
Index: binutils-2.21/ld/testsuite/ld-ifunc/ifunc-13-x86-64.d
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils-2.21/ld/testsuite/ld-ifunc/ifunc-13-x86-64.d 2011-06-21 16:33:40.761884138 -0700
@@ -0,0 +1,18 @@
+#source: ifunc-13a-x86-64.s
+#source: ifunc-13b-x86-64.s
+#ld: -shared -m elf_x86_64 -z nocombreloc
+#as: --64
+#readelf: -r --wide
+#target: x86_64-*-*
+
+Relocation section '.rela.got' at .*
+[ ]+Offset[ ]+Info[ ]+Type[ ]+.*
+[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_X86_64_GLOB_DAT[ ]+ifunc\(\)[ ]+ifunc \+ 0
+#...
+Relocation section '.rela.ifunc' at .*
+[ ]+Offset[ ]+Info[ ]+Type[ ]+.*
+[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_X86_64_64[ ]+ifunc\(\)[ ]+ifunc \+ 0
+#...
+Relocation section '.rela.plt' at .*
+[ ]+Offset[ ]+Info[ ]+Type[ ]+.*
+[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_X86_64_JUMP_SLOT[ ]+ifunc\(\)[ ]+ifunc \+ 0
Index: binutils-2.21/ld/testsuite/ld-ifunc/ifunc-13a-i386.s
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils-2.21/ld/testsuite/ld-ifunc/ifunc-13a-i386.s 2011-06-21 16:36:36.822142371 -0700
@@ -0,0 +1,10 @@
+ .text
+ .type foo, @function
+ .global
+foo:
+ movl xxx@GOT(%ebx), %eax
+ ret
+
+ .data
+xxx:
+ .long ifunc
Index: binutils-2.21/ld/testsuite/ld-ifunc/ifunc-13a-x86-64.s
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils-2.21/ld/testsuite/ld-ifunc/ifunc-13a-x86-64.s 2011-06-21 16:36:36.822142371 -0700
@@ -0,0 +1,10 @@
+ .text
+ .type foo, @function
+ .global
+foo:
+ movl xxx(%rip), %eax
+ ret
+
+ .data
+xxx:
+ .quad ifunc
Index: binutils-2.21/ld/testsuite/ld-ifunc/ifunc-13b-i386.s
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils-2.21/ld/testsuite/ld-ifunc/ifunc-13b-i386.s 2011-06-21 16:33:40.761884138 -0700
@@ -0,0 +1,5 @@
+ .text
+ .type ifunc, @gnu_indirect_function
+ .globl ifunc
+ifunc:
+ ret
Index: binutils-2.21/ld/testsuite/ld-ifunc/ifunc-13b-x86-64.s
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ binutils-2.21/ld/testsuite/ld-ifunc/ifunc-13b-x86-64.s 2011-06-21 16:33:40.761884138 -0700
@@ -0,0 +1,5 @@
+ .text
+ .type ifunc, @gnu_indirect_function
+ .globl ifunc
+ifunc:
+ ret

View File

@ -1,40 +0,0 @@
Upstream-Status: Pending
Index: binutils-2.22/configure
===================================================================
--- binutils-2.22.orig/configure
+++ binutils-2.22/configure
@@ -3130,7 +3130,7 @@ case "${target}" in
;;
s390-*-* | s390x-*-*)
;;
- sh-*-* | sh[34]*-*-*)
+ sh*-*-* | sh[34]*-*-*)
;;
sh64-*-* | sh5*-*-*)
;;
@@ -3570,7 +3570,7 @@ case "${target}" in
mips*-*-*)
noconfigdirs="$noconfigdirs gprof"
;;
- sh-*-* | sh64-*-*)
+ sh*-*-* | sh64-*-*)
case "${target}" in
sh*-*-elf)
;;
Index: binutils-2.22/gprof/configure
===================================================================
--- binutils-2.22.orig/gprof/configure
+++ binutils-2.22/gprof/configure
@@ -6103,6 +6103,11 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu)
lt_cv_deplibs_check_method=pass_all
;;
+linux-uclibc*)
+ lt_cv_deplibs_check_method=pass_all
+ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
+ ;;
+
netbsd*)
if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'

View File

@ -1,55 +0,0 @@
#!/bin/sh -e
## 001_ld_makefile_patch.dpatch
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Description: correct where ld scripts are installed
## DP: Author: Chris Chimelis <chris@debian.org>
## DP: Upstream status: N/A
## DP: Date: ??
if [ $# -ne 1 ]; then
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
exit 1
fi
[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
patch_opts="${patch_opts:--f --no-backup-if-mismatch}"
case "$1" in
-patch) patch $patch_opts -p1 < $0;;
-unpatch) patch $patch_opts -p1 -R < $0;;
*)
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
exit 1;;
esac
exit 0
Upstream-Status: Inappropriate [debian patch]
@DPATCH@
Index: binutils-2.22/ld/Makefile.am
===================================================================
--- binutils-2.22.orig/ld/Makefile.am
+++ binutils-2.22/ld/Makefile.am
@@ -37,7 +37,7 @@ endif
# We put the scripts in the directory $(scriptdir)/ldscripts.
# We can't put the scripts in $(datadir) because the SEARCH_DIR
# directives need to be different for native and cross linkers.
-scriptdir = $(tooldir)/lib
+scriptdir = $(libdir)
EMUL = @EMUL@
EMULATION_OFILES = @EMULATION_OFILES@
Index: binutils-2.22/ld/Makefile.in
===================================================================
--- binutils-2.22.orig/ld/Makefile.in
+++ binutils-2.22/ld/Makefile.in
@@ -366,7 +366,7 @@ AM_CFLAGS = $(WARN_CFLAGS)
# We put the scripts in the directory $(scriptdir)/ldscripts.
# We can't put the scripts in $(datadir) because the SEARCH_DIR
# directives need to be different for native and cross linkers.
-scriptdir = $(tooldir)/lib
+scriptdir = $(libdir)
BASEDIR = $(srcdir)/..
BFDDIR = $(BASEDIR)/bfd
INCDIR = $(BASEDIR)/include

View File

@ -1,45 +0,0 @@
#!/bin/sh -e
## 006_better_file_error.dpatch by David Kimdon <dwhedon@gordian.com>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Specify which filename is causing an error if the filename is a
## DP: directory. (#45832)
if [ $# -ne 1 ]; then
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
exit 1
fi
[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
patch_opts="${patch_opts:--f --no-backup-if-mismatch}"
case "$1" in
-patch) patch $patch_opts -p1 < $0;;
-unpatch) patch $patch_opts -p1 -R < $0;;
*)
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
exit 1;;
esac
exit 0
Upstream-Status: Inappropriate [debian patch]
@DPATCH@
Index: binutils-2.22/bfd/opncls.c
===================================================================
--- binutils-2.22.orig/bfd/opncls.c
+++ binutils-2.22/bfd/opncls.c
@@ -197,6 +197,13 @@ bfd_fopen (const char *filename, const c
{
bfd *nbfd;
const bfd_target *target_vec;
+ struct stat s;
+
+ if (stat (filename, &s) == 0)
+ if (S_ISDIR(s.st_mode)) {
+ bfd_set_error (bfd_error_file_not_recognized);
+ return NULL;
+ }
nbfd = _bfd_new_bfd ();
if (nbfd == NULL)

View File

@ -1,49 +0,0 @@
#!/bin/sh -e
## 012_check_ldrunpath_length.dpatch by Chris Chimelis <chris@debian.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Only generate an RPATH entry if LD_RUN_PATH is not empty, for
## DP: cases where -rpath isn't specified. (#151024)
if [ $# -ne 1 ]; then
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
exit 1
fi
[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
patch_opts="${patch_opts:--f --no-backup-if-mismatch}"
case "$1" in
-patch) patch $patch_opts -p1 < $0;;
-unpatch) patch $patch_opts -p1 -R < $0;;
*)
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
exit 1;;
esac
exit 0
Upstream-Status: Inappropriate [debian patch]
@DPATCH@
Index: binutils-2.22/ld/emultempl/elf32.em
===================================================================
--- binutils-2.22.orig/ld/emultempl/elf32.em
+++ binutils-2.22/ld/emultempl/elf32.em
@@ -1273,6 +1273,8 @@ fragment <<EOF
&& command_line.rpath == NULL)
{
lib_path = (const char *) getenv ("LD_RUN_PATH");
+ if ((lib_path) && (strlen (lib_path) == 0))
+ lib_path = NULL;
if (gld${EMULATION_NAME}_search_needed (lib_path, &n,
force))
break;
@@ -1500,6 +1502,8 @@ gld${EMULATION_NAME}_before_allocation (
rpath = command_line.rpath;
if (rpath == NULL)
rpath = (const char *) getenv ("LD_RUN_PATH");
+ if ((rpath) && (strlen (rpath) == 0))
+ rpath = NULL;
for (abfd = link_info.input_bfds; abfd; abfd = abfd->link_next)
if (bfd_get_flavour (abfd) == bfd_target_elf_flavour)

View File

@ -1,38 +0,0 @@
Source: Khem Raj <raj.khem@gmail.com>
Disposition: submit upstream.
Upstream-Status: Pending
Description:
We do not need to have the libtool patch anymore for binutils after
libtool has been updated upstream it include support for it. However
for building gas natively on uclibc systems we have to link it with
-lm so that it picks up missing symbols.
/local/build_area/BUILD/arm_v5t_le_uclibc/binutils-2.17.50/objdir/libiberty/pic/libiberty.a(floatformat.o): In function `floatformat_from_double':
floatformat.c:(.text+0x1ec): undefined reference to `frexp'
floatformat.c:(.text+0x2f8): undefined reference to `ldexp'
/local/build_area/BUILD/arm_v5t_le_uclibc/binutils-2.17.50/objdir/libiberty/pic/libiberty.a(floatformat.o): In function `floatformat_to_double':
floatformat.c:(.text+0x38a): undefined reference to `ldexp'
floatformat.c:(.text+0x3d2): undefined reference to `ldexp'
floatformat.c:(.text+0x43e): undefined reference to `ldexp' floatformat.c:(.text+0x4e2): undefined reference to `ldexp'
collect2: ld returned 1 exit status
make[4]: *** [as-new] Error 1
Index: binutils-2.22/gas/configure.tgt
===================================================================
--- binutils-2.22.orig/gas/configure.tgt
+++ binutils-2.22/gas/configure.tgt
@@ -428,6 +428,12 @@ case ${generic_target} in
*-*-netware) fmt=elf em=netware ;;
esac
+case ${generic_target} in
+ arm-*-*uclibc*)
+ need_libm=yes
+ ;;
+esac
+
case ${cpu_type} in
alpha | arm | i386 | ia64 | microblaze | mips | ns32k | pdp11 | ppc | sparc | z80 | z8k)
bfd_gas=yes

View File

@ -1,29 +0,0 @@
#!/bin/sh -e
## 127_x86_64_i386_biarch.dpatch
##
## DP: Description: Add (/usr)/lib32 to the search paths on x86_64.
## DP: Author: Aurelien Jarno <aurel32.debian.org>
## DP: Upstream status: Debian specific
#
# Hacked to apply with quilt
# Adapted to binutils 2.18.50.0.7
Upstream-Status: Inappropriate [embedded specific]
Index: binutils-2.22/ld/emulparams/elf_i386.sh
===================================================================
--- binutils-2.22.orig/ld/emulparams/elf_i386.sh
+++ binutils-2.22/ld/emulparams/elf_i386.sh
@@ -14,3 +14,13 @@ GENERATE_PIE_SCRIPT=yes
NO_SMALL_DATA=yes
SEPARATE_GOTPLT=12
IREL_IN_PLT=
+
+# Linux modify the default library search path to first include
+# a 32-bit specific directory.
+case "$target" in
+ x86_64*-linux* | i[3-7]86*-linux* | x86_64*-kfreebsd*-gnu | i[3-7]86*-kfreebsd*-gnu)
+ case "$EMULATION_NAME" in
+ *i386*) LIBPATH_SUFFIX=32 ;;
+ esac
+ ;;
+esac

View File

@ -1,79 +0,0 @@
This fixes a global shadow warning. The warning is treated as error hence breaks the build of target
binutils.
/b/openembedded-core/build/tmp-uclibc/work/armv5te-oe-linux-uclibceabi/binutils-2.21.1-r1/binutils-2.21.1/gas/config/obj-elf.c: In function 'obj_elf_parse_section_letters':
| /b/openembedded-core/build/tmp-uclibc/work/armv5te-oe-linux-uclibceabi/binutils-2.21.1-r1/binutils-2.21.1/gas/config/obj-elf.c:744:68: error: declaration of 'clone' shadows a global declaration [-Werror=shadow]
| /b/openembedded-core/build/tmp-uclibc/work/armv5te-oe-linux-uclibceabi/binutils-2.21.1-r1/binutils-2.21.1/gas/config/obj-elf.c: In function 'obj_elf_section':
| /b/openembedded-core/build/tmp-uclibc/work/armv5te-oe-linux-uclibceabi/binutils-2.21.1-r1/binutils-2.21.1/gas/config/obj-elf.c:981:16: error: declaration of 'clone' shadows a global declaration [-Werror=shadow]
| cc1: all warnings being treated as errors
|
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Index: binutils-2.22/gas/config/obj-elf.c
===================================================================
--- binutils-2.22.orig/gas/config/obj-elf.c
+++ binutils-2.22/gas/config/obj-elf.c
@@ -741,10 +741,10 @@ obj_elf_change_section (const char *name
}
static bfd_vma
-obj_elf_parse_section_letters (char *str, size_t len, bfd_boolean *clone)
+obj_elf_parse_section_letters (char *str, size_t len, bfd_boolean *cloneit)
{
bfd_vma attr = 0;
- *clone = FALSE;
+ *cloneit = FALSE;
while (len > 0)
{
@@ -775,7 +775,7 @@ obj_elf_parse_section_letters (char *str
attr |= SHF_TLS;
break;
case '?':
- *clone = TRUE;
+ *cloneit = TRUE;
break;
/* Compatibility. */
case 'm':
@@ -978,7 +978,7 @@ obj_elf_section (int push)
if (*input_line_pointer == '"')
{
- bfd_boolean clone;
+ bfd_boolean cloneit;
beg = demand_copy_C_string (&dummy);
if (beg == NULL)
@@ -986,7 +986,7 @@ obj_elf_section (int push)
ignore_rest_of_line ();
return;
}
- attr |= obj_elf_parse_section_letters (beg, strlen (beg), &clone);
+ attr |= obj_elf_parse_section_letters (beg, strlen (beg), &cloneit);
SKIP_WHITESPACE ();
if (*input_line_pointer == ',')
@@ -1038,10 +1038,10 @@ obj_elf_section (int push)
attr &= ~SHF_MERGE;
}
- if ((attr & SHF_GROUP) != 0 && clone)
+ if ((attr & SHF_GROUP) != 0 && cloneit)
{
as_warn (_("? section flag ignored with G present"));
- clone = FALSE;
+ cloneit = FALSE;
}
if ((attr & SHF_GROUP) != 0 && *input_line_pointer == ',')
{
@@ -1063,7 +1063,7 @@ obj_elf_section (int push)
attr &= ~SHF_GROUP;
}
- if (clone)
+ if (cloneit)
{
const char *now_group = elf_group_name (now_seg);
if (now_group != NULL)

View File

@ -1,22 +0,0 @@
Upstream-Status: Inappropriate [embedded specific]
don't let the distro compiler point to the wrong installation location
Thanks to RP for helping find the source code causing the issue.
2010/08/13
Nitin A Kamble <nitin.a.kamble@intel.com>
Index: binutils-2.22/libiberty/Makefile.in
===================================================================
--- binutils-2.22.orig/libiberty/Makefile.in
+++ binutils-2.22/libiberty/Makefile.in
@@ -350,7 +350,8 @@ install-strip: install
# multilib-specific flags, it's overridden by FLAGS_TO_PASS from the
# default multilib, so we have to take CFLAGS into account as well,
# since it will be passed the multilib flags.
-MULTIOSDIR = `$(CC) $(CFLAGS) -print-multi-os-directory`
+#MULTIOSDIR = `$(CC) $(CFLAGS) -print-multi-os-directory`
+MULTIOSDIR = ""
install_to_libdir: all
${mkinstalldirs} $(DESTDIR)$(libdir)/$(MULTIOSDIR)
$(INSTALL_DATA) $(TARGETLIB) $(DESTDIR)$(libdir)/$(MULTIOSDIR)/$(TARGETLIB)n

File diff suppressed because it is too large Load Diff

View File

@ -1,39 +0,0 @@
Upstream-Status: Inappropriate [embedded specific]
Enabling sysroot support in libtool exposed a bug where the final
library had an RPATH encoded into it which still pointed to the
sysroot. This works around the issue until it gets sorted out
upstream.
Fix suggested by Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Scott Garman <scott.a.garman@intel.com>
Index: binutils-2.22/ltmain.sh
===================================================================
--- binutils-2.22.orig/ltmain.sh
+++ binutils-2.22/ltmain.sh
@@ -8035,9 +8035,11 @@ EOF
test "$opt_mode" != relink && rpath="$compile_rpath$rpath"
for libdir in $rpath; do
if test -n "$hardcode_libdir_flag_spec"; then
+ func_replace_sysroot "$libdir"
+ libdir=$func_replace_sysroot_result
+ func_stripname '=' '' "$libdir"
+ libdir=$func_stripname_result
if test -n "$hardcode_libdir_separator"; then
- func_replace_sysroot "$libdir"
- libdir=$func_replace_sysroot_result
if test -z "$hardcode_libdirs"; then
hardcode_libdirs="$libdir"
else
@@ -8770,6 +8772,10 @@ EOF
hardcode_libdirs=
for libdir in $compile_rpath $finalize_rpath; do
if test -n "$hardcode_libdir_flag_spec"; then
+ func_replace_sysroot "$libdir"
+ libdir=$func_replace_sysroot_result
+ func_stripname '=' '' "$libdir"
+ libdir=$func_stripname_result
if test -n "$hardcode_libdir_separator"; then
if test -z "$hardcode_libdirs"; then
hardcode_libdirs="$libdir"

View File

@ -1,49 +0,0 @@
for mips64*-*-linux we change the default emulations to be
N64 instead of N32
Upstream-Status: Inappropriate [ OE configuration Specific]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Index: binutils-2.22/bfd/config.bfd
===================================================================
--- binutils-2.22.orig/bfd/config.bfd 2011-07-28 15:35:13.000000000 -0700
+++ binutils-2.22/bfd/config.bfd 2012-04-23 21:07:44.151578222 -0700
@@ -970,13 +970,13 @@
;;
#ifdef BFD64
mips64*el-*-linux*)
- targ_defvec=bfd_elf32_ntradlittlemips_vec
- targ_selvecs="bfd_elf32_ntradbigmips_vec bfd_elf32_tradlittlemips_vec bfd_elf32_tradbigmips_vec bfd_elf64_tradlittlemips_vec bfd_elf64_tradbigmips_vec"
+ targ_defvec=bfd_elf64_tradlittlemips_vec
+ targ_selvecs="bfd_elf32_ntradbigmips_vec bfd_elf32_ntradlittlemips_vec bfd_elf32_tradlittlemips_vec bfd_elf32_tradbigmips_vec bfd_elf64_tradbigmips_vec"
want64=true
;;
mips64*-*-linux*)
- targ_defvec=bfd_elf32_ntradbigmips_vec
- targ_selvecs="bfd_elf32_ntradlittlemips_vec bfd_elf32_tradbigmips_vec bfd_elf32_tradlittlemips_vec bfd_elf64_tradbigmips_vec bfd_elf64_tradlittlemips_vec"
+ targ_defvec=bfd_elf64_tradbigmips_vec
+ targ_selvecs="bfd_elf32_ntradbigmips_vec bfd_elf32_ntradlittlemips_vec bfd_elf32_tradbigmips_vec bfd_elf32_tradlittlemips_vec bfd_elf64_tradlittlemips_vec"
want64=true
;;
#endif
Index: binutils-2.22/ld/configure.tgt
===================================================================
--- binutils-2.22.orig/ld/configure.tgt 2011-11-21 01:29:37.000000000 -0800
+++ binutils-2.22/ld/configure.tgt 2012-04-23 21:05:34.183571931 -0700
@@ -395,11 +395,11 @@
mips*-*-vxworks*) targ_emul=elf32ebmipvxworks
targ_extra_emuls="elf32elmipvxworks" ;;
mips*-*-windiss) targ_emul=elf32mipswindiss ;;
-mips64*el-*-linux-*) targ_emul=elf32ltsmipn32
- targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip"
+mips64*el-*-linux-*) targ_emul=elf64ltsmip
+ targ_extra_emuls="elf32btsmipn32 elf32ltsmipn32 elf32ltsmip elf32btsmip elf64btsmip"
targ_extra_libpath=$targ_extra_emuls ;;
-mips64*-*-linux-*) targ_emul=elf32btsmipn32
- targ_extra_emuls="elf32ltsmipn32 elf32btsmip elf32ltsmip elf64btsmip elf64ltsmip"
+mips64*-*-linux-*) targ_emul=elf64btsmip
+ targ_extra_emuls="elf32btsmipn32 elf32ltsmipn32 elf32btsmip elf32ltsmip elf64ltsmip"
targ_extra_libpath=$targ_extra_emuls ;;
mips*el-*-linux-*) targ_emul=elf32ltsmip
targ_extra_emuls="elf32btsmip elf32ltsmipn32 elf64ltsmip elf32btsmipn32 elf64btsmip"

View File

@ -1,49 +0,0 @@
Upstream-Status: Inappropriate [SDK specific]
This patch will modify the ELF linker scripts so that the crosssdk linker will
generate binaries with a 4096 bytes PT_INTERP section. When the binaries will
be relocated, at SDK install time, the interpreter path can be easily changed
by the relocating script.
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Index: binutils_git/ld/genscripts.sh
===================================================================
--- binutils_git.orig/ld/genscripts.sh 2012-11-21 11:58:23.325441925 +0200
+++ binutils_git/ld/genscripts.sh 2012-11-21 12:03:42.106815400 +0200
@@ -290,6 +290,7 @@
LD_FLAG=r
DATA_ALIGNMENT=${DATA_ALIGNMENT_r}
DEFAULT_DATA_ALIGNMENT="ALIGN(${SEGMENT_SIZE})"
+PARTIAL_LINKING=" "
( echo "/* Script for ld -r: link without relocation */"
. ${CUSTOMIZER_SCRIPT}
. ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
@@ -298,10 +299,12 @@
LD_FLAG=u
DATA_ALIGNMENT=${DATA_ALIGNMENT_u}
CONSTRUCTING=" "
+PARTIAL_LINKING=" "
( echo "/* Script for ld -Ur: link w/out relocation, do create constructors */"
. ${CUSTOMIZER_SCRIPT}
. ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
) | sed -e '/^ *$/d;s/[ ]*$//' > ldscripts/${EMULATION_NAME}.xu
+unset PARTIAL_LINKING
LD_FLAG=
DATA_ALIGNMENT=${DATA_ALIGNMENT_}
Index: binutils_git/ld/scripttempl/elf.sc
===================================================================
--- binutils_git.orig/ld/scripttempl/elf.sc 2012-11-21 12:02:26.800377384 +0200
+++ binutils_git/ld/scripttempl/elf.sc 2012-11-21 12:04:16.166109621 +0200
@@ -124,8 +124,8 @@
DATA_SEGMENT_END=". = DATA_SEGMENT_END (.);"
DATA_SEGMENT_RELRO_END=". = DATA_SEGMENT_RELRO_END (${SEPARATE_GOTPLT-0}, .);"
fi
-if test -z "${INITIAL_READONLY_SECTIONS}${CREATE_SHLIB}"; then
- INITIAL_READONLY_SECTIONS=".interp ${RELOCATING-0} : { *(.interp) }"
+if test -z "${INITIAL_READONLY_SECTIONS}${CREATE_SHLIB}${PARTIAL_LINKING}"; then
+ INITIAL_READONLY_SECTIONS=".interp ${RELOCATING-0} : { *(.interp); . = 0x1000; }"
fi
if test -z "$PLT"; then
IPLT=".iplt ${RELOCATING-0} : { *(.iplt) }"

View File

@ -1,38 +0,0 @@
ld: -rpath must search under sysroot
The -rpath argument would search the host filesystem for libraries,
even when a sysroot was defined. For cross toolchains with targets
compatible with the host architecture this can find incorrect
libraries. Leave -rpath-link unmodified, as build systems in the wild
are already using this to point to host directories.
Signed-off-by: Andy Ross <andy.ross@windriver.com>
Upstream-Status: submitted (binutils@sourceware.org 2012-08-22)
---
ld/emultempl/elf32.em | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em
index de51050..35e0e7e 100644
--- a/ld/emultempl/elf32.em
+++ b/ld/emultempl/elf32.em
@@ -1263,9 +1263,13 @@ fragment <<EOF
EOF
if [ "x${USE_LIBPATH}" = xyes ] ; then
fragment <<EOF
- if (gld${EMULATION_NAME}_search_needed (command_line.rpath,
- &n, force))
- break;
+ if (command_line.rpath) {
+ char *tmprp = gld${EMULATION_NAME}_add_sysroot (command_line.rpath);
+ found = gld${EMULATION_NAME}_search_needed (tmprp, &n, force);
+ free(tmprp);
+ if (found)
+ break;
+ }
EOF
fi
if [ "x${NATIVE}" = xyes ] ; then
--
1.7.11.2

View File

@ -1,35 +0,0 @@
require binutils.inc
require binutils-${PV}.inc
DEPENDS += "flex bison zlib"
EXTRA_OECONF += "--with-sysroot=/ \
--enable-install-libbfd \
--enable-shared \
"
EXTRA_OECONF_class-native = "--enable-targets=all --enable-64-bit-bfd --enable-install-libbfd"
do_install_class-native () {
autotools_do_install
# Install the libiberty header
install -d ${D}${includedir}
install -m 644 ${S}/include/ansidecl.h ${D}${includedir}
install -m 644 ${S}/include/libiberty.h ${D}${includedir}
# We only want libiberty, libbfd and libopcodes
rm -rf ${D}${bindir}
rm -rf ${D}${prefix}/${TARGET_SYS}
rm -rf ${D}${prefix}/lib/ldscripts
rm -rf ${D}${prefix}/share/info
rm -rf ${D}${prefix}/share/locale
rm -rf ${D}${prefix}/share/man
rmdir ${D}${prefix}/share || :
rmdir ${D}/${libdir}/gcc-lib || :
rmdir ${D}/${libdir}64/gcc-lib || :
rmdir ${D}/${libdir} || :
rmdir ${D}/${libdir}64 || :
}
BBCLASSEXTEND = "native"