binutils-2.23.1: Add recipes

backport non regressing patches from 2.23 branch after 2.23.1
release.

(From OE-Core rev: df9b304f7a43c798223606eb5f0e13f7250393fe)

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 2012-08-08 07:57:09 -07:00 committed by Richard Purdie
parent 30ce005e3f
commit 74c1731163
29 changed files with 21094 additions and 0 deletions

View File

@ -0,0 +1,46 @@
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://libiberty_path_fix.patch \
file://binutils-poison.patch \
file://libtool-rpath-fix.patch \
file://binutils-armv5e.patch \
file://mips64-default-ld-emulation.patch \
${BACKPORT} \
"
BACKPORT = "\
file://backport/0001-bfd.patch \
file://backport/0003-Assemble-all-sources-files-in-each-test.patch \
file://backport/0005-bfd.patch \
file://backport/0010-bfd-ChangeLog.patch \
file://backport/0012-Fix-TLS-LD-to-LE-optimization-for-x32.patch \
file://backport/0013-gas-ChangeLog.patch \
file://backport/0014-Fix-opcode-for-64-bit-jecxz.patch \
file://backport/0017-ld-elf-comm-data.exp-Add-XFAIL-for-arm-targets-refer.patch \
file://backport/0018-bfd.patch \
file://backport/0024-bfd.patch \
file://backport/0026-ld-testsuite.patch \
"
SRC_URI[md5sum] = "33adb18c3048d057ac58d07a3f1adb38"
SRC_URI[sha256sum] = "2ab2e5b03e086d12c6295f831adad46b3e1410a3a234933a2e8fac66cb2e7a19"

View File

@ -0,0 +1,58 @@
From 7dbb7d8db8003ff73d80956bd3271f9588437aa7 Mon Sep 17 00:00:00 2001
From: Tristan Gingold <gingold@adacore.com>
Date: Tue, 13 Nov 2012 15:22:45 +0000
Subject: [PATCH 01/27] bfd/ 2012-11-13 Tristan Gingold
<gingold@adacore.com>
* Makefile.am (RELEASE): Unset.
* Makefile.in: Regenerate.
---
bfd/ChangeLog | 5 +++++
bfd/Makefile.am | 2 +-
bfd/Makefile.in | 2 +-
3 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index bed5dca..7aa83bf 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,10 @@
2012-11-13 Tristan Gingold <gingold@adacore.com>
+ * Makefile.am (RELEASE): Unset.
+ * Makefile.in: Regenerate.
+
+2012-11-13 Tristan Gingold <gingold@adacore.com>
+
* configure.in: Bump version to 2.23.1
* Makefile.am (RELEASE): Set.
* configure, Makefile.in: Regenerate.
diff --git a/bfd/Makefile.am b/bfd/Makefile.am
index 9ab2aa9..49f9662 100644
--- a/bfd/Makefile.am
+++ b/bfd/Makefile.am
@@ -4,7 +4,7 @@ AUTOMAKE_OPTIONS = 1.11 no-dist foreign
ACLOCAL_AMFLAGS = -I . -I .. -I ../config
# Uncomment the following line when doing a release.
-RELEASE=y
+# RELEASE=y
INCDIR = $(srcdir)/../include
CSEARCH = -I. -I$(srcdir) -I$(INCDIR)
diff --git a/bfd/Makefile.in b/bfd/Makefile.in
index 9990275..5718fab 100644
--- a/bfd/Makefile.in
+++ b/bfd/Makefile.in
@@ -320,7 +320,7 @@ AUTOMAKE_OPTIONS = 1.11 no-dist foreign
ACLOCAL_AMFLAGS = -I . -I .. -I ../config
# Uncomment the following line when doing a release.
-RELEASE = y
+# RELEASE=y
INCDIR = $(srcdir)/../include
CSEARCH = -I. -I$(srcdir) -I$(INCDIR)
SUBDIRS = doc po
--
1.7.9.5

View File

@ -0,0 +1,187 @@
From 80b672d804357f2a1be04ac4e5a4d4c7d0d3b348 Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Wed, 14 Nov 2012 15:54:04 +0000
Subject: [PATCH 03/27] Assemble all sources files in each test
* ld-elf/shared.exp (build_cxx_tests): Move out the commented out
test.
* lib/ld-lib.exp (run_ld_link_exec_tests): Assemble all sources
files in each test.
---
ld/testsuite/ChangeLog | 8 ++++
ld/testsuite/ld-elf/shared.exp | 8 ++--
ld/testsuite/lib/ld-lib.exp | 97 ++++++++++++++++++++--------------------
3 files changed, 60 insertions(+), 53 deletions(-)
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index ffcfa7e..e02432f 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,11 @@
+2012-11-14 H.J. Lu <hongjiu.lu@intel.com>
+
+ * ld-elf/shared.exp (build_cxx_tests): Move out the commented out
+ test.
+
+ * lib/ld-lib.exp (run_ld_link_exec_tests): Assemble all sources
+ files in each test.
+
2012-10-16 Sofiane Naci <sofiane.naci@arm.com>
* ld-aarch64/tlsle-symbol-offset.s: New file.
diff --git a/ld/testsuite/ld-elf/shared.exp b/ld/testsuite/ld-elf/shared.exp
index c00f3e5..c9f2056 100644
--- a/ld/testsuite/ld-elf/shared.exp
+++ b/ld/testsuite/ld-elf/shared.exp
@@ -336,14 +336,14 @@ set build_cxx_tests {
{del.cc new.cc} {} "libnew1b.so" "c++"}
}
-set run_cxx_tests {
- {"Run with libdl3a.so"
- "-Wl,--no-as-needed tmpdir/libdl3a.so" ""
- {dl3main.cc} "dl3a" "dl3a.out" "" "c++"}
# "-shared -Bsymbolic" only works with gcc 4.5.0 and newer.
# {"Run with libdl3b.so"
# "tmpdir/libdl3b.so" ""
# {dl3main.cc} "dl3b" "dl3b.out" "" "c++"}
+set run_cxx_tests {
+ {"Run with libdl3a.so"
+ "-Wl,--no-as-needed tmpdir/libdl3a.so" ""
+ {dl3main.cc} "dl3a" "dl3a.out" "" "c++"}
{"Run with libdl3c.so"
"-Wl,--no-as-needed tmpdir/libdl3c.so" ""
{dl3main.cc} "dl3c" "dl3a.out" "" "c++"}
diff --git a/ld/testsuite/lib/ld-lib.exp b/ld/testsuite/lib/ld-lib.exp
index bb4cb0d..49837dd 100644
--- a/ld/testsuite/lib/ld-lib.exp
+++ b/ld/testsuite/lib/ld-lib.exp
@@ -1244,7 +1244,6 @@ proc run_ld_link_exec_tests { targets_to_xfail ldtests } {
# verbose -log "ld_options is $ld_options"
# verbose -log "as_options is $as_options"
# verbose -log "src_files is $src_files"
-# verbose -log "actions is $actions"
# verbose -log "binfile is $binfile"
# Assemble each file in the test.
@@ -1261,68 +1260,68 @@ proc run_ld_link_exec_tests { targets_to_xfail ldtests } {
} else {
ld_compile "$CC -c $CFLAGS $cflags" $srcdir/$subdir/$src_file $objfile
}
+ }
- # We have to use $CC to build PIE and shared library.
- if { [ string match "c" $lang ] } {
- set link_proc ld_simple_link
- set link_cmd $CC
- } elseif { [ string match "c++" $lang ] } {
- set link_proc ld_simple_link
- set link_cmd $CXX
- } elseif { [ string match "-shared" $ld_options ] \
- || [ string match "-pie" $ld_options ] } {
- set link_proc ld_simple_link
- set link_cmd $CC
- } else {
- set link_proc ld_link
- set link_cmd $ld
- }
+ # We have to use $CC to build PIE and shared library.
+ if { [ string match "c" $lang ] } {
+ set link_proc ld_simple_link
+ set link_cmd $CC
+ } elseif { [ string match "c++" $lang ] } {
+ set link_proc ld_simple_link
+ set link_cmd $CXX
+ } elseif { [ string match "-shared" $ld_options ] \
+ || [ string match "-pie" $ld_options ] } {
+ set link_proc ld_simple_link
+ set link_cmd $CC
+ } else {
+ set link_proc ld_link
+ set link_cmd $ld
+ }
- if ![$link_proc $link_cmd $binfile "-L$srcdir/$subdir $ld_options $objfiles"] {
- set failed 1
- } else {
+ if ![$link_proc $link_cmd $binfile "-L$srcdir/$subdir $ld_options $objfiles"] {
+ set failed 1
+ } else {
+ set failed 0
+ }
+
+ # Check if exec_output is expected.
+ if { $warning != "" } then {
+ verbose -log "returned with: <$exec_output>, expected: <$warning>"
+ if { [regexp $warning $exec_output] } then {
set failed 0
+ } else {
+ set failed 1
}
+ }
- # Check if exec_output is expected.
- if { $warning != "" } then {
- verbose -log "returned with: <$exec_output>, expected: <$warning>"
- if { [regexp $warning $exec_output] } then {
- set failed 0
- } else {
- set failed 1
- }
- }
+ if { $failed == 0 } {
+ send_log "Running: $binfile > $binfile.out\n"
+ verbose "Running: $binfile > $binfile.out"
+ catch "exec $binfile > $binfile.out" exec_output
- if { $failed == 0 } {
- send_log "Running: $binfile > $binfile.out\n"
- verbose "Running: $binfile > $binfile.out"
- catch "exec $binfile > $binfile.out" exec_output
+ if ![string match "" $exec_output] then {
+ send_log "$exec_output\n"
+ verbose "$exec_output" 1
+ set failed 1
+ } else {
+ send_log "diff $binfile.out $srcdir/$subdir/$expfile\n"
+ verbose "diff $binfile.out $srcdir/$subdir/$expfile"
+ catch "exec diff $binfile.out $srcdir/$subdir/$expfile" exec_output
+ set exec_output [prune_warnings $exec_output]
if ![string match "" $exec_output] then {
send_log "$exec_output\n"
verbose "$exec_output" 1
set failed 1
- } else {
- send_log "diff $binfile.out $srcdir/$subdir/$expfile\n"
- verbose "diff $binfile.out $srcdir/$subdir/$expfile"
- catch "exec diff $binfile.out $srcdir/$subdir/$expfile" exec_output
- set exec_output [prune_warnings $exec_output]
-
- if ![string match "" $exec_output] then {
- send_log "$exec_output\n"
- verbose "$exec_output" 1
- set failed 1
- }
}
}
+ }
- if { $failed != 0 } {
- fail $testname
- } else {
- set errcnt 0
- pass $testname
- }
+ if { $failed != 0 } {
+ fail $testname
+ } else {
+ set errcnt 0
+ pass $testname
}
}
}
--
1.7.9.5

View File

@ -0,0 +1,103 @@
From e4b6d90dbcbf56c959eca8dcdf846fbe21c822e3 Mon Sep 17 00:00:00 2001
From: Roland McGrath <roland@gnu.org>
Date: Thu, 15 Nov 2012 00:33:27 +0000
Subject: [PATCH 05/27] bfd/ * elf32-arm.c (elf32_arm_nacl_plt0_entry): Use
bic rather than bfc instruction for data
sandboxing.
gold/
* arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
than bfc instruction for data sandboxing.
---
bfd/ChangeLog | 5 +++++
bfd/elf32-arm.c | 18 +++++++++---------
gold/ChangeLog | 5 +++++
gold/arm.cc | 4 ++--
4 files changed, 21 insertions(+), 11 deletions(-)
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 7aa83bf..981e05a 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2012-11-14 Roland McGrath <mcgrathr@google.com>
+
+ * elf32-arm.c (elf32_arm_nacl_plt0_entry): Use bic rather than bfc
+ instruction for data sandboxing.
+
2012-11-13 Tristan Gingold <gingold@adacore.com>
* Makefile.am (RELEASE): Unset.
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index a287fbb..3c541ca 100644
--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -2209,21 +2209,21 @@ static const bfd_vma elf32_arm_nacl_plt0_entry [] =
0xe08cc00f, /* add ip, ip, pc */
0xe52dc008, /* str ip, [sp, #-8]! */
/* Second bundle: */
- 0xe7dfcf1f, /* bfc ip, #30, #2 */
- 0xe59cc000, /* ldr ip, [ip] */
+ 0xe3ccc103, /* bic ip, ip, #0xc0000000 */
+ 0xe59cc000, /* ldr ip, [ip] */
0xe3ccc13f, /* bic ip, ip, #0xc000000f */
- 0xe12fff1c, /* bx ip */
+ 0xe12fff1c, /* bx ip */
/* Third bundle: */
- 0xe320f000, /* nop */
- 0xe320f000, /* nop */
- 0xe320f000, /* nop */
+ 0xe320f000, /* nop */
+ 0xe320f000, /* nop */
+ 0xe320f000, /* nop */
/* .Lplt_tail: */
0xe50dc004, /* str ip, [sp, #-4] */
/* Fourth bundle: */
- 0xe7dfcf1f, /* bfc ip, #30, #2 */
- 0xe59cc000, /* ldr ip, [ip] */
+ 0xe3ccc103, /* bic ip, ip, #0xc0000000 */
+ 0xe59cc000, /* ldr ip, [ip] */
0xe3ccc13f, /* bic ip, ip, #0xc000000f */
- 0xe12fff1c, /* bx ip */
+ 0xe12fff1c, /* bx ip */
};
#define ARM_NACL_PLT_TAIL_OFFSET (11 * 4)
diff --git a/gold/ChangeLog b/gold/ChangeLog
index 0d3074a..9a1a9d3 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -1,3 +1,8 @@
+2012-11-14 Roland McGrath <mcgrathr@google.com>
+
+ * arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
+ than bfc instruction for data sandboxing.
+
2012-11-07 Roland McGrath <mcgrathr@google.com>
* i386.cc (Target_i386::relocate_for_relocatable): Remove extraneous
diff --git a/gold/arm.cc b/gold/arm.cc
index d434c9d..238cf32 100644
--- a/gold/arm.cc
+++ b/gold/arm.cc
@@ -12196,7 +12196,7 @@ const uint32_t Output_data_plt_arm_nacl<big_endian>::first_plt_entry[16] =
0xe08cc00f, // add ip, ip, pc
0xe52dc008, // str ip, [sp, #-8]!
// Second bundle:
- 0xe7dfcf1f, // bfc ip, #30, #2
+ 0xe3ccc103, // bic ip, ip, #0xc0000000
0xe59cc000, // ldr ip, [ip]
0xe3ccc13f, // bic ip, ip, #0xc000000f
0xe12fff1c, // bx ip
@@ -12207,7 +12207,7 @@ const uint32_t Output_data_plt_arm_nacl<big_endian>::first_plt_entry[16] =
// .Lplt_tail:
0xe50dc004, // str ip, [sp, #-4]
// Fourth bundle:
- 0xe7dfcf1f, // bfc ip, #30, #2
+ 0xe3ccc103, // bic ip, ip, #0xc0000000
0xe59cc000, // ldr ip, [ip]
0xe3ccc13f, // bic ip, ip, #0xc000000f
0xe12fff1c, // bx ip
--
1.7.9.5

View File

@ -0,0 +1,95 @@
From c49a2d2d8ff625b17699c44a703f217de5b4fa2f Mon Sep 17 00:00:00 2001
From: Yufeng Zhang <yufeng.zhang@arm.com>
Date: Mon, 19 Nov 2012 18:46:01 +0000
Subject: [PATCH 10/27] bfd/ChangeLog
2012-11-19 Joey Ye <joey.ye@arm.com>
* elf32-arm.c (elf32_arm_final_link_relocate,
case R_ARM_THM_ALU_PREL_11_0, case R_ARM_THM_PC12): Align address of
the place being relocated.
(elf32_arm_final_link_relocate, case R_ARM_THM_PC8): Align address
of the place being relocated and truncate addend.
(Pa): New macro.
---
bfd/ChangeLog | 9 +++++++++
bfd/elf32-arm.c | 23 +++++++++++++----------
2 files changed, 22 insertions(+), 10 deletions(-)
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 981e05a..59c36a7 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,12 @@
+2012-11-19 Joey Ye <joey.ye@arm.com>
+
+ * elf32-arm.c (elf32_arm_final_link_relocate,
+ case R_ARM_THM_ALU_PREL_11_0, case R_ARM_THM_PC12): Align address of
+ the place being relocated.
+ (elf32_arm_final_link_relocate, case R_ARM_THM_PC8): Align address
+ of the place being relocated and truncate addend.
+ (Pa): New macro.
+
2012-11-14 Roland McGrath <mcgrathr@google.com>
* elf32-arm.c (elf32_arm_nacl_plt0_entry): Use bic rather than bfc
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index 3c541ca..01ca11b 100644
--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -63,6 +63,9 @@
#define ARM_ELF_ABI_VERSION 0
#define ARM_ELF_OS_ABI_VERSION ELFOSABI_ARM
+/* The Adjusted Place, as defined by AAELF. */
+#define Pa(X) ((X) & 0xfffffffc)
+
static bfd_boolean elf32_arm_write_section (bfd *output_bfd,
struct bfd_link_info *link_info,
asection *sec,
@@ -8619,9 +8622,9 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto,
}
relocation = value + signed_addend;
- relocation -= (input_section->output_section->vma
- + input_section->output_offset
- + rel->r_offset);
+ relocation -= Pa (input_section->output_section->vma
+ + input_section->output_offset
+ + rel->r_offset);
value = abs (relocation);
@@ -8651,12 +8654,12 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto,
insn = bfd_get_16 (input_bfd, hit_data);
if (globals->use_rel)
- addend = (insn & 0x00ff) << 2;
+ addend = ((((insn & 0x00ff) << 2) + 4) & 0x3ff) -4;
relocation = value + addend;
- relocation -= (input_section->output_section->vma
- + input_section->output_offset
- + rel->r_offset);
+ relocation -= Pa (input_section->output_section->vma
+ + input_section->output_offset
+ + rel->r_offset);
value = abs (relocation);
@@ -8691,9 +8694,9 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto,
}
relocation = value + signed_addend;
- relocation -= (input_section->output_section->vma
- + input_section->output_offset
- + rel->r_offset);
+ relocation -= Pa (input_section->output_section->vma
+ + input_section->output_offset
+ + rel->r_offset);
value = abs (relocation);
--
1.7.9.5

View File

@ -0,0 +1,57 @@
From 0c6a475b99dc06a49549d81059f290b23b86c62d Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Tue, 20 Nov 2012 05:57:53 +0000
Subject: [PATCH 12/27] Fix TLS LD to LE optimization for x32
PR gold/14858
* x86_64.cc (Relocate::tls_ld_to_le): Support x32.
---
gold/ChangeLog | 5 +++++
gold/x86_64.cc | 9 ++++++++-
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/gold/ChangeLog b/gold/ChangeLog
index 9a1a9d3..b31d11f 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -1,3 +1,8 @@
+2012-11-19 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR gold/14858
+ * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
+
2012-11-14 Roland McGrath <mcgrathr@google.com>
* arm.cc (Output_data_plt_arm_nacl::first_plt_entry): Use bic rather
diff --git a/gold/x86_64.cc b/gold/x86_64.cc
index b5b616f..8ddf4f2 100644
--- a/gold/x86_64.cc
+++ b/gold/x86_64.cc
@@ -3959,8 +3959,12 @@ Target_x86_64<size>::Relocate::tls_ld_to_le(
section_size_type view_size)
{
// leaq foo@tlsld(%rip),%rdi; call __tls_get_addr@plt;
+ // For SIZE == 64:
// ... leq foo@dtpoff(%rax),%reg
// ==> .word 0x6666; .byte 0x66; movq %fs:0,%rax ... leaq x@tpoff(%rax),%rdx
+ // For SIZE == 32:
+ // ... leq foo@dtpoff(%rax),%reg
+ // ==> nopl 0x0(%rax); movl %fs:0,%eax ... leaq x@tpoff(%rax),%rdx
tls::check_range(relinfo, relnum, rela.get_r_offset(), view_size, -3);
tls::check_range(relinfo, relnum, rela.get_r_offset(), view_size, 9);
@@ -3970,7 +3974,10 @@ Target_x86_64<size>::Relocate::tls_ld_to_le(
tls::check_tls(relinfo, relnum, rela.get_r_offset(), view[4] == 0xe8);
- memcpy(view - 3, "\x66\x66\x66\x64\x48\x8b\x04\x25\0\0\0\0", 12);
+ if (size == 64)
+ memcpy(view - 3, "\x66\x66\x66\x64\x48\x8b\x04\x25\0\0\0\0", 12);
+ else
+ memcpy(view - 3, "\x0f\x1f\x40\x00\x64\x8b\x04\x25\0\0\0\0", 12);
// The next reloc should be a PLT32 reloc against __tls_get_addr.
// We can skip it.
--
1.7.9.5

View File

@ -0,0 +1,43 @@
From d4d8d22c6d0a859f617cf7d0a2e31056893c1d98 Mon Sep 17 00:00:00 2001
From: Yufeng Zhang <yufeng.zhang@arm.com>
Date: Tue, 20 Nov 2012 10:41:54 +0000
Subject: [PATCH 13/27] gas/ChangeLog
2012-11-20 Yufeng Zhang <yufeng.zhang@arm.com>
* config/tc-aarch64.c (first_error_fmt): Add ATTRIBUTE_UNUSED to the
local variable "ret".
---
gas/ChangeLog | 5 +++++
gas/config/tc-aarch64.c | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 219c27e..bb9ef1c 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,8 @@
+2012-11-20 Yufeng Zhang <yufeng.zhang@arm.com>
+
+ * config/tc-aarch64.c (first_error_fmt): Add ATTRIBUTE_UNUSED to the
+ local variable "ret".
+
2012-11-07 James Murray <jsm@jsm-net.demon.co.uk>
* config/tc-m68hc11.c: Fix R_M68HC12_16B relocation for movb/w
diff --git a/gas/config/tc-aarch64.c b/gas/config/tc-aarch64.c
index 843923b..a83a62e 100644
--- a/gas/config/tc-aarch64.c
+++ b/gas/config/tc-aarch64.c
@@ -643,7 +643,7 @@ first_error_fmt (const char *format, ...)
if (! error_p ())
{
- int ret;
+ int ret ATTRIBUTE_UNUSED;
va_start (args, format);
ret = vsnprintf (buffer, size, format, args);
know (ret <= size - 1 && ret >= 0);
--
1.7.9.5

View File

@ -0,0 +1,112 @@
From adef1e82d241e22139c5edbba1efe9734cfdcace Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Tue, 20 Nov 2012 14:30:48 +0000
Subject: [PATCH 14/27] Fix opcode for 64-bit jecxz
gas/testsuite/
PR gas/14859
* gas/i386/x86-64-opcode.s: Add jecxz.
* gas/i386/x86-64-opcode.d: Updated.
opcodes/
PR gas/14859
* i386-opc.tbl: Fix opcode for 64-bit jecxz.
* i386-tbl.h: Regenerated.
---
gas/ChangeLog | 6 ++++++
gas/testsuite/gas/i386/x86-64-opcode.d | 1 +
gas/testsuite/gas/i386/x86-64-opcode.s | 2 ++
opcodes/ChangeLog | 9 ++++++++-
opcodes/i386-opc.tbl | 2 +-
opcodes/i386-tbl.h | 2 +-
6 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/gas/ChangeLog b/gas/ChangeLog
index bb9ef1c..8a950ec 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,9 @@
+2012-11-20 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR gas/14859
+ * gas/i386/x86-64-opcode.s: Add jecxz.
+ * gas/i386/x86-64-opcode.d: Updated.
+
2012-11-20 Yufeng Zhang <yufeng.zhang@arm.com>
* config/tc-aarch64.c (first_error_fmt): Add ATTRIBUTE_UNUSED to the
diff --git a/gas/testsuite/gas/i386/x86-64-opcode.d b/gas/testsuite/gas/i386/x86-64-opcode.d
index 7c6dd03..4b3003a 100644
--- a/gas/testsuite/gas/i386/x86-64-opcode.d
+++ b/gas/testsuite/gas/i386/x86-64-opcode.d
@@ -296,4 +296,5 @@ Disassembly of section .text:
[ ]*[a-f0-9]+: 0f 07 sysret
[ ]*[a-f0-9]+: 0f 01 f8 swapgs
[ ]*[a-f0-9]+: 66 68 22 22 pushw \$0x2222
+[ ]*[a-f0-9]+: 67 e3 ff jecxz 0x49d
#pass
diff --git a/gas/testsuite/gas/i386/x86-64-opcode.s b/gas/testsuite/gas/i386/x86-64-opcode.s
index cb9bbc1..96f624d 100644
--- a/gas/testsuite/gas/i386/x86-64-opcode.s
+++ b/gas/testsuite/gas/i386/x86-64-opcode.s
@@ -424,3 +424,5 @@
swapgs # -- -- -- -- 0F 01 f8
pushw $0x2222
+
+ jecxz .+2
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index ca0f49b..98450f9 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,3 +1,10 @@
+2012-11-20 Kirill Yukhin <kirill.yukhin@intel.com>
+ H.J. Lu <hongjiu.lu@intel.com>
+
+ PR gas/14859
+ * i386-opc.tbl: Fix opcode for 64-bit jecxz.
+ * i386-tbl.h: Regenerated.
+
2012-10-09 Nagajyothi Eggone <nagajyothi.eggone@amd.com>
* i386-gen.c (cpu_flag_init): Add CPU_BDVER3_FLAGS.
@@ -9,7 +16,7 @@
2012-09-18 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
- * arm-dis.c: Changed ldra and strl-form mnemonics
+ * arm-dis.c: Changed ldra and strl-form mnemonics
to lda and stl-form.
2012-09-18 Chao-ying Fu <fu@mips.com>
diff --git a/opcodes/i386-opc.tbl b/opcodes/i386-opc.tbl
index 8b08edc..482bd7b 100644
--- a/opcodes/i386-opc.tbl
+++ b/opcodes/i386-opc.tbl
@@ -390,7 +390,7 @@ jg, 1, 0x7f, None, 1, 0, Jump|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_ldSuf,
// jcxz vs. jecxz is chosen on the basis of the address size prefix.
jcxz, 1, 0xe3, None, 1, CpuNo64, JumpByte|Size16|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_ldSuf, { Disp8|Disp16|Disp32 }
jecxz, 1, 0xe3, None, 1, CpuNo64, JumpByte|Size32|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_ldSuf, { Disp8|Disp16|Disp32 }
-jecxz, 1, 0x67e3, None, 2, Cpu64, JumpByte|Size32|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_ldSuf, { Disp8|Disp32|Disp32S }
+jecxz, 1, 0xe3, None, 1, Cpu64, JumpByte|Size32|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_ldSuf, { Disp8|Disp32|Disp32S }
jrcxz, 1, 0xe3, None, 1, Cpu64, JumpByte|Size64|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_ldSuf|NoRex64, { Disp8|Disp32|Disp32S }
// The loop instructions also use the address size prefix to select
diff --git a/opcodes/i386-tbl.h b/opcodes/i386-tbl.h
index 001a966..a3a3e64 100644
--- a/opcodes/i386-tbl.h
+++ b/opcodes/i386-tbl.h
@@ -3417,7 +3417,7 @@ const insn_template i386_optab[] =
{ { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0 } } } },
- { "jecxz", 1, 0x67e3, None, 2,
+ { "jecxz", 1, 0xe3, None, 1,
{ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
--
1.7.9.5

View File

@ -0,0 +1,40 @@
From b15bb9c9dc6875a2fe08feba6f31cce6a9468cf7 Mon Sep 17 00:00:00 2001
From: Roland McGrath <roland@gnu.org>
Date: Wed, 21 Nov 2012 19:32:32 +0000
Subject: [PATCH 17/27] * ld-elf/comm-data.exp: Add XFAIL for arm*-*-*
targets, referring to PR ld/13802.
---
ld/testsuite/ChangeLog | 5 +++++
ld/testsuite/ld-elf/comm-data.exp | 2 ++
2 files changed, 7 insertions(+)
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index e02432f..aada077 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2012-11-21 Roland McGrath <mcgrathr@google.com>
+
+ * ld-elf/comm-data.exp: Add XFAIL for arm*-*-* targets, referring
+ to PR ld/13802.
+
2012-11-14 H.J. Lu <hongjiu.lu@intel.com>
* ld-elf/shared.exp (build_cxx_tests): Move out the commented out
diff --git a/ld/testsuite/ld-elf/comm-data.exp b/ld/testsuite/ld-elf/comm-data.exp
index 1c75f55..71b856d 100644
--- a/ld/testsuite/ld-elf/comm-data.exp
+++ b/ld/testsuite/ld-elf/comm-data.exp
@@ -59,6 +59,8 @@ if [is_elf64 "tmpdir/libcomm-data.so"] {
append AFLAGS " --defsym ELF64=1"
}
+setup_xfail "arm*-*-*" "ld/13802"
+
# Verify that a common symbol has been converted to an undefined
# reference to the global symbol of the same name defined above
# and that the debug reference has been dropped.
--
1.7.9.5

View File

@ -0,0 +1,78 @@
From 6a7ec91db1a2a7d60d225ee613c9ebaf1e222acd Mon Sep 17 00:00:00 2001
From: Roland McGrath <roland@gnu.org>
Date: Wed, 21 Nov 2012 20:14:41 +0000
Subject: [PATCH 18/27] bfd/ * elf-nacl.c
(segment_nonexecutable_and_has_contents): Renamed to
... (segment_eligible_for_headers): ... this.
Take new arguments MAXPAGESIZE and
SIZEOF_HEADERS. Return false if the first section's
start address doesn't leave space for the headers.
(nacl_modify_segment_map): Update caller.
---
bfd/ChangeLog | 8 ++++++++
bfd/elf-nacl.c | 14 ++++++++++++--
2 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 59c36a7..cf65838 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,11 @@
+2012-11-21 Roland McGrath <mcgrathr@google.com>
+
+ * elf-nacl.c (segment_nonexecutable_and_has_contents): Renamed to ...
+ (segment_eligible_for_headers): ... this. Take new arguments
+ MAXPAGESIZE and SIZEOF_HEADERS. Return false if the first section's
+ start address doesn't leave space for the headers.
+ (nacl_modify_segment_map): Update caller.
+
2012-11-19 Joey Ye <joey.ye@arm.com>
* elf32-arm.c (elf32_arm_final_link_relocate,
diff --git a/bfd/elf-nacl.c b/bfd/elf-nacl.c
index 842e367..04659e7 100644
--- a/bfd/elf-nacl.c
+++ b/bfd/elf-nacl.c
@@ -42,11 +42,18 @@ segment_executable (struct elf_segment_map *seg)
return FALSE;
}
+/* Determine if this segment is eligible to receive the file and program
+ headers. It must be non-executable and have contents. Its first
+ section must start far enough past the page boundary to allow space
+ for the headers. */
static bfd_boolean
-segment_nonexecutable_and_has_contents (struct elf_segment_map *seg)
+segment_eligible_for_headers (struct elf_segment_map *seg,
+ bfd_vma maxpagesize, bfd_vma sizeof_headers)
{
bfd_boolean any_contents = FALSE;
unsigned int i;
+ if (seg->count == 0 || seg->sections[0]->lma % maxpagesize < sizeof_headers)
+ return FALSE;
for (i = 0; i < seg->count; ++i)
{
if (seg->sections[i]->flags & SEC_CODE)
@@ -68,6 +75,8 @@ nacl_modify_segment_map (bfd *abfd, struct bfd_link_info *info)
struct elf_segment_map **first_load = NULL;
struct elf_segment_map **last_load = NULL;
bfd_boolean moved_headers = FALSE;
+ int sizeof_headers = bfd_sizeof_headers (abfd, info);
+ bfd_vma maxpagesize = get_elf_backend_data (abfd)->maxpagesize;
if (info != NULL && info->user_phdrs)
/* The linker script used PHDRS explicitly, so don't change what the
@@ -93,7 +102,8 @@ nacl_modify_segment_map (bfd *abfd, struct bfd_link_info *info)
/* Now that we've noted the first PT_LOAD, we're looking for
the first non-executable PT_LOAD with a nonempty p_filesz. */
else if (!moved_headers
- && segment_nonexecutable_and_has_contents (seg))
+ && segment_eligible_for_headers (seg, maxpagesize,
+ sizeof_headers))
{
/* This is the one we were looking for!
--
1.7.9.5

View File

@ -0,0 +1,49 @@
From f9fd8f72b070bfdc49c957f3968e6fcec34b57fc Mon Sep 17 00:00:00 2001
From: Roland McGrath <roland@gnu.org>
Date: Mon, 26 Nov 2012 17:50:04 +0000
Subject: [PATCH 24/27] bfd/ * elf-nacl.c (nacl_modify_segment_map): Don't
crash when INFO is null.
---
bfd/ChangeLog | 4 ++++
bfd/elf-nacl.c | 5 ++---
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index cf65838..5500b36 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,7 @@
+2012-11-26 Roland McGrath <mcgrathr@google.com>
+
+ * elf-nacl.c (nacl_modify_segment_map): Don't crash when INFO is null.
+
2012-11-21 Roland McGrath <mcgrathr@google.com>
* elf-nacl.c (segment_nonexecutable_and_has_contents): Renamed to ...
diff --git a/bfd/elf-nacl.c b/bfd/elf-nacl.c
index 04659e7..ce401fa 100644
--- a/bfd/elf-nacl.c
+++ b/bfd/elf-nacl.c
@@ -75,7 +75,7 @@ nacl_modify_segment_map (bfd *abfd, struct bfd_link_info *info)
struct elf_segment_map **first_load = NULL;
struct elf_segment_map **last_load = NULL;
bfd_boolean moved_headers = FALSE;
- int sizeof_headers = bfd_sizeof_headers (abfd, info);
+ int sizeof_headers = info == NULL ? 0 : bfd_sizeof_headers (abfd, info);
bfd_vma maxpagesize = get_elf_backend_data (abfd)->maxpagesize;
if (info != NULL && info->user_phdrs)
@@ -149,8 +149,7 @@ nacl_modify_segment_map (bfd *abfd, struct bfd_link_info *info)
proper order for the ELF rule that they must appear in ascending address
order. So find the two segments we swapped before, and swap them back. */
bfd_boolean
-nacl_modify_program_headers (bfd *abfd,
- struct bfd_link_info *info ATTRIBUTE_UNUSED)
+nacl_modify_program_headers (bfd *abfd, struct bfd_link_info *info)
{
struct elf_segment_map **m = &elf_tdata (abfd)->segment_map;
Elf_Internal_Phdr *phdr = elf_tdata (abfd)->phdr;
--
1.7.9.5

View File

@ -0,0 +1,65 @@
From fdf71da8350a7c2b4050e09c5a08e7d42b7a4a4a Mon Sep 17 00:00:00 2001
From: Roland McGrath <roland@gnu.org>
Date: Tue, 27 Nov 2012 17:23:31 +0000
Subject: [PATCH 26/27] ld/testsuite/ * ld-elf/flags1.d: Add *-*-nacl* to
xfail list. * ld-elf/orphan-region.d: Likewise.
---
ld/testsuite/ChangeLog | 5 +++++
ld/testsuite/ld-elf/flags1.d | 7 ++++---
ld/testsuite/ld-elf/orphan-region.d | 5 +++--
3 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index aada077..c0558ac 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2012-11-27 Roland McGrath <mcgrathr@google.com>
+
+ * ld-elf/flags1.d: Add *-*-nacl* to xfail list.
+ * ld-elf/orphan-region.d: Likewise.
+
2012-11-21 Roland McGrath <mcgrathr@google.com>
* ld-elf/comm-data.exp: Add XFAIL for arm*-*-* targets, referring
diff --git a/ld/testsuite/ld-elf/flags1.d b/ld/testsuite/ld-elf/flags1.d
index e6bb001..ab8facc 100644
--- a/ld/testsuite/ld-elf/flags1.d
+++ b/ld/testsuite/ld-elf/flags1.d
@@ -1,11 +1,12 @@
#name: --set-section-flags test 1 (sections)
#ld: -Tflags1.ld
-#objcopy_linked_file: --set-section-flags .post_text_reserve=contents,alloc,load,readonly,code
+#objcopy_linked_file: --set-section-flags .post_text_reserve=contents,alloc,load,readonly,code
#readelf: -l --wide
#xfail: "avr-*-*" "dlx-*-*" "h8300-*-*" "i960-*-*" "ip2k-*-*" "m32r-*-*"
-#xfail: "moxie-*-*" "mt-*-*" "msp430-*-*"
+#xfail: "moxie-*-*" "mt-*-*" "msp430-*-*" "*-*-nacl*"
#xfail: "*-*-hpux*" "hppa*64*-*-*"
-# Fails on the AVR, DLX, H8300, I960, IP2K, M32R, MOXIE, MT, and MSP430
+# Fails on the AVR, DLX, H8300, I960, IP2K, M32R, MOXIE, MT, and MSP430,
+# and all NaCl targets,
# because the two sections are not merged into one segment.
# (There is no good reason why they have to be).
# Fails on HPUX systems because the .type pseudo-op behaves differently.
diff --git a/ld/testsuite/ld-elf/orphan-region.d b/ld/testsuite/ld-elf/orphan-region.d
index 9d6c90c..d63b1df 100644
--- a/ld/testsuite/ld-elf/orphan-region.d
+++ b/ld/testsuite/ld-elf/orphan-region.d
@@ -3,9 +3,10 @@
#readelf: -S -l --wide
#xfail: arc-*-* d30v-*-* dlx-*-* fr30-*-* frv-*-elf i860-*-* i960-*-*
#xfail: iq*-*-* mn10200-*-* moxie-*-* msp*-*-* mt-*-* or32-*-* pj*-*-*
-#xfail: spu-*-* hppa*64*-*-* frv-*-*
+#xfail: spu-*-* hppa*64*-*-* frv-*-* *-*-nacl*
# if not using elf32.em, you don't get fancy orphan handling
-# spu twiddles LOAD range, hppa64 adds PHDR, frv-linux adds GNU_STACK
+# spu twiddles LOAD range, hppa64 adds PHDR, frv-linux adds GNU_STACK,
+# nacl splits to two segments
#...
\[[ 0-9]+\] \.text[ \t]+PROGBITS[ \t]+0*40000000[ \t]+.*
--
1.7.9.5

View File

@ -0,0 +1,25 @@
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>
Index: binutils-2.22.90/gas/config/tc-arm.c
===================================================================
--- binutils-2.22.90.orig/gas/config/tc-arm.c 2012-07-24 09:38:32.000000000 -0700
+++ binutils-2.22.90/gas/config/tc-arm.c 2012-08-07 23:41:59.822564075 -0700
@@ -23162,6 +23162,7 @@
ARM_ARCH_OPT ("armv4t", ARM_ARCH_V4T, FPU_ARCH_FPA),
ARM_ARCH_OPT ("armv4txm", ARM_ARCH_V4TxM, FPU_ARCH_FPA),
ARM_ARCH_OPT ("armv5", ARM_ARCH_V5, FPU_ARCH_VFP),
+ ARM_ARCH_OPT ("armv5e", ARM_ARCH_V5TE, FPU_ARCH_VFP),
ARM_ARCH_OPT ("armv5t", ARM_ARCH_V5T, FPU_ARCH_VFP),
ARM_ARCH_OPT ("armv5txm", ARM_ARCH_V5TxM, FPU_ARCH_VFP),
ARM_ARCH_OPT ("armv5te", ARM_ARCH_V5TE, FPU_ARCH_VFP),

View File

@ -0,0 +1,259 @@
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.90/ld/config.in
===================================================================
--- binutils-2.22.90.orig/ld/config.in 2012-05-17 08:13:21.000000000 -0700
+++ binutils-2.22.90/ld/config.in 2012-08-07 23:09:34.834490113 -0700
@@ -11,6 +11,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.90/ld/configure
===================================================================
--- binutils-2.22.90.orig/ld/configure 2012-08-07 23:08:50.000000000 -0700
+++ binutils-2.22.90/ld/configure 2012-08-07 23:09:34.838490177 -0700
@@ -776,6 +776,7 @@
enable_targets
enable_64_bit_bfd
with_sysroot
+enable_poison_system_directories
enable_gold
enable_got
enable_werror
@@ -1432,6 +1433,8 @@
(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)
@@ -4344,7 +4347,18 @@
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.90/ld/configure.in
===================================================================
--- binutils-2.22.90.orig/ld/configure.in 2012-05-17 08:13:23.000000000 -0700
+++ binutils-2.22.90/ld/configure.in 2012-08-07 23:09:34.838490177 -0700
@@ -70,6 +70,16 @@
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.90/ld/ldfile.c
===================================================================
--- binutils-2.22.90.orig/ld/ldfile.c 2012-07-13 06:20:26.000000000 -0700
+++ binutils-2.22.90/ld/ldfile.c 2012-08-07 23:30:35.166538044 -0700
@@ -116,6 +116,23 @@
new_dirs->name = concat (ld_sysroot, name + 1, (const char *) NULL);
else
new_dirs->name = xstrdup (name);
+
+#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
+
}
/* Try to open a BFD for a lang_input_statement. */
Index: binutils-2.22.90/ld/ld.h
===================================================================
--- binutils-2.22.90.orig/ld/ld.h 2012-07-09 23:50:55.000000000 -0700
+++ binutils-2.22.90/ld/ld.h 2012-08-07 23:09:34.838490177 -0700
@@ -203,6 +203,14 @@
/* 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.90/ld/ldmain.c
===================================================================
--- binutils-2.22.90.orig/ld/ldmain.c 2012-07-13 06:20:26.000000000 -0700
+++ binutils-2.22.90/ld/ldmain.c 2012-08-07 23:09:34.846490172 -0700
@@ -265,6 +265,8 @@
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.90/ld/ld.texinfo
===================================================================
--- binutils-2.22.90.orig/ld/ld.texinfo 2012-07-09 23:50:55.000000000 -0700
+++ binutils-2.22.90/ld/ld.texinfo 2012-08-07 23:09:34.850490143 -0700
@@ -2147,6 +2147,18 @@
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.90/ld/lexsup.c
===================================================================
--- binutils-2.22.90.orig/ld/lexsup.c 2012-07-13 06:20:26.000000000 -0700
+++ binutils-2.22.90/ld/lexsup.c 2012-08-07 23:09:34.850490143 -0700
@@ -496,6 +496,14 @@
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)
@@ -1424,6 +1432,14 @@
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;
}
}
Index: binutils-2.22.90/ld/ldlex.h
===================================================================
--- binutils-2.22.90.orig/ld/ldlex.h 2012-05-26 04:13:19.000000000 -0700
+++ binutils-2.22.90/ld/ldlex.h 2012-08-07 23:34:17.122546581 -0700
@@ -135,6 +135,8 @@
#endif /* ENABLE_PLUGINS */
OPTION_DEFAULT_SCRIPT,
OPTION_PRINT_OUTPUT_FORMAT,
+ OPTION_NO_POISON_SYSTEM_DIRECTORIES,
+ OPTION_ERROR_POISON_SYSTEM_DIRECTORIES
};
/* The initial parser states. */

View File

@ -0,0 +1,40 @@
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

@ -0,0 +1,55 @@
#!/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

@ -0,0 +1,45 @@
#!/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

@ -0,0 +1,49 @@
#!/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

@ -0,0 +1,38 @@
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

@ -0,0 +1,29 @@
#!/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

@ -0,0 +1,22 @@
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

@ -0,0 +1,39 @@
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

@ -0,0 +1,49 @@
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

@ -0,0 +1,49 @@
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

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

View File

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

View File

@ -0,0 +1,14 @@
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

@ -0,0 +1,35 @@
require binutils.inc
require binutils-${PV}.inc
DEPENDS += "flex bison zlib"
EXTRA_OECONF += "--with-sysroot=/ \
--enable-install-libbfd \
--enable-shared \
"
EXTRA_OECONF_virtclass-native = "--enable-target=all --enable-64-bit-bfd --enable-install-libbfd"
do_install_virtclass-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"