x86: Remove linker option: -z prefix-nop
authorH.J. Lu <hjl.tools@gmail.com>
Fri, 2 Jun 2017 21:49:37 +0000 (14:49 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Fri, 2 Jun 2017 21:49:37 +0000 (14:49 -0700)
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.

ld/ChangeLog
ld/emulparams/call_nop.sh
ld/ld.texinfo
ld/testsuite/ld-i386/call3c.d
ld/testsuite/ld-x86-64/call1c.d

index e2d549643be72935f2ec8a10532df10f83a04e58..ee9fff0c60ab76b38948848d235b93c52662537e 100644 (file)
@@ -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.
index fee4a8154e9ded2c6327763a807e8e38a13d6f61..d45806ca94d45f9221895a374c61c228921a51b3 100644 (file)
@@ -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;
index 9a72cb9e4db5ac87c2cafe3580bf8be1ba44d736..edf1e31a8bb3bbc215ad4dcab97053b96323f056 100644 (file)
@@ -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}}.
index 0fdbee454a3b7da035156658f56e5937b0fb092d..f869dcc8861a24eed3f6f2f5314318da0f7e03d8 100644 (file)
@@ -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
index 7fe8056e49df8c99b1f531559777bbdddb12f152..70933daa10adfe08640ff986dea7e6c9e400112b 100644 (file)
@@ -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
This page took 0.032196 seconds and 4 git commands to generate.