This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [gold][PATCH] PR gold/19119: Gold accepts bogus target emulation


On Fri, Oct 16, 2015 at 8:01 AM, Cary Coutant <ccoutant@gmail.com> wrote:
>>>>         PR gold/19119
>>>>         * options.h (General_options): Remove "obsolete" from -m.
>>>
>>> I'm a little reluctant to remove "obsolete" from the description --
>>> maybe "deprecated" instead?
>> ...
>> It shows that -m elf32ppc is required.  Saying it is obsolete or deprecated
>> isn't correct.
>
> The option is only needed for the very limited case where the inputs
> are empty and we produce an empty object file. In the LTO case, it
> could also be solved by adding a plugin interface so that the plugin
> could tell the linker what the target is (which, again, is only needed
> when building a shared library with no startup files in the link). In
> the kernel case, I don't see a good alternative, but I don't really
> understand why the linker even needs to run when the only input is an
> empty archive. (Maybe we could instead produce a completely empty
> output file for a -r link with no inputs, which would be interpreted
> as an empty script when used in a final link.)
>
> Anyway, I'll hold my "deprecated" argument for another day when these
> two cases can be handled better.
>
>> Is my original patch OK?
>
> Sure.
>

My patch exposed typos in testsuite/Makefile.am.  I checked
in this patch to fix them.


-- 
H.J.
From 580a88a2f61b73074a1d500194377bc1e2d4c2c9 Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Tue, 20 Oct 2015 10:43:33 -0700
Subject: [PATCH] Feed right input object to x86_64_mov_to_lea1[12]

x86_64_mov_to_lea1.o is a 64-bit x86-64 object and x86_64_mov_to_lea2.o
is a 32-bit x86-64 object.  x86_64_mov_to_lea11 should use
x86_64_mov_to_lea2.o and x86_64_mov_to_lea12 should use
x86_64_mov_to_lea1.o.

	* testsuite/Makefile.am (x86_64_mov_to_lea11): Replace
	x86_64_mov_to_lea1.o with x86_64_mov_to_lea2.o.
	(x86_64_mov_to_lea12): Replace x86_64_mov_to_lea2.o with
	x86_64_mov_to_lea1.o.
	* testsuite/Makefile.in: Regenerated.
---
 gold/ChangeLog             | 8 ++++++++
 gold/testsuite/Makefile.am | 4 ++--
 gold/testsuite/Makefile.in | 4 ++--
 3 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/gold/ChangeLog b/gold/ChangeLog
index 1f619f7..a3d0571 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -1,3 +1,11 @@
+2015-10-20  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* testsuite/Makefile.am (x86_64_mov_to_lea11): Replace
+	x86_64_mov_to_lea1.o with x86_64_mov_to_lea2.o.
+	(x86_64_mov_to_lea12): Replace x86_64_mov_to_lea2.o with
+	x86_64_mov_to_lea1.o.
+	* testsuite/Makefile.in: Regenerated.
+
 2015-10-16  H.J. Lu  <hongjiu.lu@intel.com>
 
 	PR gold/19119
diff --git a/gold/testsuite/Makefile.am b/gold/testsuite/Makefile.am
index 5ceaeef..c8e5f9f 100644
--- a/gold/testsuite/Makefile.am
+++ b/gold/testsuite/Makefile.am
@@ -1032,9 +1032,9 @@ x86_64_mov_to_lea9: x86_64_mov_to_lea5.o
 	../ld-new -melf32_x86_64  -o $@ $<
 x86_64_mov_to_lea10: x86_64_mov_to_lea6.o
 	../ld-new -melf_x86_64  -o $@ $<
-x86_64_mov_to_lea11: x86_64_mov_to_lea1.o
+x86_64_mov_to_lea11: x86_64_mov_to_lea2.o
 	../ld-new -melf32_x86_64 -shared  -o $@ $<
-x86_64_mov_to_lea12: x86_64_mov_to_lea2.o
+x86_64_mov_to_lea12: x86_64_mov_to_lea1.o
 	../ld-new -melf_x86_64 -shared  -o $@ $<
 x86_64_mov_to_lea13: x86_64_mov_to_lea7.o
 	../ld-new -melf32_x86_64 -shared  -o $@ $<
diff --git a/gold/testsuite/Makefile.in b/gold/testsuite/Makefile.in
index 9cabcd8..31c9951 100644
--- a/gold/testsuite/Makefile.in
+++ b/gold/testsuite/Makefile.in
@@ -5413,9 +5413,9 @@ uninstall-am:
 @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	../ld-new -melf32_x86_64  -o $@ $<
 @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@x86_64_mov_to_lea10: x86_64_mov_to_lea6.o
 @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	../ld-new -melf_x86_64  -o $@ $<
-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@x86_64_mov_to_lea11: x86_64_mov_to_lea1.o
+@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@x86_64_mov_to_lea11: x86_64_mov_to_lea2.o
 @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	../ld-new -melf32_x86_64 -shared  -o $@ $<
-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@x86_64_mov_to_lea12: x86_64_mov_to_lea2.o
+@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@x86_64_mov_to_lea12: x86_64_mov_to_lea1.o
 @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	../ld-new -melf_x86_64 -shared  -o $@ $<
 @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@x86_64_mov_to_lea13: x86_64_mov_to_lea7.o
 @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	../ld-new -melf32_x86_64 -shared  -o $@ $<
-- 
2.4.3


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]