This is the mail archive of the binutils-cvs@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]

[binutils-gdb] x86: Remove linker option: -z prefix-nop


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=4a4a4a27ba5c731044d3d3594545e6f06b0ec0e5

commit 4a4a4a27ba5c731044d3d3594545e6f06b0ec0e5
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Jun 2 14:49:37 2017 -0700

    x86: Remove linker option: -z prefix-nop
    
    Since it is incorrect to convert
    
    	bnd call *foo@GOTPCREL(%rip)
    
    to
    
    	bnd nop
    	call foo
    
    this patch removes the "-z prefix-nop" option from x86 linker.
    
    	* emulparams/call_nop.sh: Remove -z prefix-nop.
    	* ld.texinfo: Likewise.
    	* testsuite/ld-i386/call3c.d: Check for linker error.
    	* testsuite/ld-x86-64/call1c.d: Likewise.

Diff:
---
 ld/ChangeLog                    |  7 +++++++
 ld/emulparams/call_nop.sh       |  5 -----
 ld/ld.texinfo                   |  2 --
 ld/testsuite/ld-i386/call3c.d   | 12 +-----------
 ld/testsuite/ld-x86-64/call1c.d | 12 +-----------
 5 files changed, 9 insertions(+), 29 deletions(-)

diff --git a/ld/ChangeLog b/ld/ChangeLog
index e2d5496..ee9fff0 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,10 @@
+2017-06-02  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* emulparams/call_nop.sh: Remove -z prefix-nop.
+	* ld.texinfo: Likewise.
+	* testsuite/ld-i386/call3c.d: Check for linker error.
+	* testsuite/ld-x86-64/call1c.d: Likewise.
+
 2017-06-01  Alan Modra  <amodra@gmail.com>
 
 	* emultempl/ppc64elf.em (params): Init plt_localentry0 field.
diff --git a/ld/emulparams/call_nop.sh b/ld/emulparams/call_nop.sh
index fee4a81..d45806c 100644
--- a/ld/emulparams/call_nop.sh
+++ b/ld/emulparams/call_nop.sh
@@ -10,11 +10,6 @@ PARSE_AND_LIST_ARGS_CASE_Z_CALL_NOP='
 	      link_info.call_nop_as_suffix = FALSE;
 	      link_info.call_nop_byte = 0x67;
 	    }
-	  else if (strcmp (optarg + 9, "prefix-nop") == 0)
-	    {
-	      link_info.call_nop_as_suffix = FALSE;
-	      link_info.call_nop_byte = 0x90;
-	    }
 	  else if (strcmp (optarg + 9, "suffix-nop") == 0)
 	    {
 	      link_info.call_nop_as_suffix = TRUE;
diff --git a/ld/ld.texinfo b/ld/ld.texinfo
index 9a72cb9..edf1e31 100644
--- a/ld/ld.texinfo
+++ b/ld/ld.texinfo
@@ -1250,14 +1250,12 @@ relocation overflow check if there will be no dynamic relocation
 overflow at run-time.  Supported for x86_64.
 
 @item call-nop=prefix-addr
-@itemx call-nop=prefix-nop
 @itemx call-nop=suffix-nop
 @itemx call-nop=prefix-@var{byte}
 @itemx call-nop=suffix-@var{byte}
 Specify the 1-byte @code{NOP} padding when transforming indirect call
 to a locally defined function, foo, via its GOT slot.
 @option{call-nop=prefix-addr} generates @code{0x67 call foo}.
-@option{call-nop=prefix-nop} generates @code{0x90 call foo}.
 @option{call-nop=suffix-nop} generates @code{call foo 0x90}.
 @option{call-nop=prefix-@var{byte}} generates @code{@var{byte} call foo}.
 @option{call-nop=suffix-@var{byte}} generates @code{call foo @var{byte}}.
diff --git a/ld/testsuite/ld-i386/call3c.d b/ld/testsuite/ld-i386/call3c.d
index 0fdbee4..f869dcc 100644
--- a/ld/testsuite/ld-i386/call3c.d
+++ b/ld/testsuite/ld-i386/call3c.d
@@ -1,14 +1,4 @@
 #source: call3.s
 #as: --32 -mrelax-relocations=yes
 #ld: -melf_i386 -z call-nop=prefix-nop
-#objdump: -dw
-
-.*: +file format .*
-
-
-Disassembly of section .text:
-
-#...
-[ 	]*[a-f0-9]+:	90                   	nop
-[ 	]*[a-f0-9]+:	e8 ([0-9a-f]{2} ){4} *	call +[a-f0-9]+ <foo>
-#pass
+#error: invalid number for -z call-nop=prefix-: nop
diff --git a/ld/testsuite/ld-x86-64/call1c.d b/ld/testsuite/ld-x86-64/call1c.d
index 7fe8056..70933da 100644
--- a/ld/testsuite/ld-x86-64/call1c.d
+++ b/ld/testsuite/ld-x86-64/call1c.d
@@ -1,14 +1,4 @@
 #source: call1.s
 #as: --64 -mrelax-relocations=yes
 #ld: -melf_x86_64 -z call-nop=prefix-nop
-#objdump: -dw
-
-.*: +file format .*
-
-
-Disassembly of section .text:
-
-#...
-[ 	]*[a-f0-9]+:	90                   	nop
-[ 	]*[a-f0-9]+:	e8 ([0-9a-f]{2} ){4} *	callq +[a-f0-9]+ <foo>
-#pass
+#error: invalid number for -z call-nop=prefix-: nop


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