From 74c17311635f9cf16d3ede2c0112839a26f7404d Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Wed, 8 Aug 2012 07:57:09 -0700 Subject: 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 Signed-off-by: Saul Wold Signed-off-by: Richard Purdie --- ...012-Fix-TLS-LD-to-LE-optimization-for-x32.patch | 57 ++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 meta/recipes-devtools/binutils/binutils-2.23.1/backport/0012-Fix-TLS-LD-to-LE-optimization-for-x32.patch (limited to 'meta/recipes-devtools/binutils/binutils-2.23.1/backport/0012-Fix-TLS-LD-to-LE-optimization-for-x32.patch') diff --git a/meta/recipes-devtools/binutils/binutils-2.23.1/backport/0012-Fix-TLS-LD-to-LE-optimization-for-x32.patch b/meta/recipes-devtools/binutils/binutils-2.23.1/backport/0012-Fix-TLS-LD-to-LE-optimization-for-x32.patch new file mode 100644 index 0000000000..b4bc10f9c5 --- /dev/null +++ b/meta/recipes-devtools/binutils/binutils-2.23.1/backport/0012-Fix-TLS-LD-to-LE-optimization-for-x32.patch @@ -0,0 +1,57 @@ +From 0c6a475b99dc06a49549d81059f290b23b86c62d Mon Sep 17 00:00:00 2001 +From: "H.J. Lu" +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 ++ ++ PR gold/14858 ++ * x86_64.cc (Relocate::tls_ld_to_le): Support x32. ++ + 2012-11-14 Roland McGrath + + * 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::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::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 + -- cgit v1.2.3-54-g00ecf