]> sourceware.org Git - glibc.git/commitdiff
i386: Use "movl main@GOT(%ebx), %eax" in start.S
authorH.J. Lu <hjl.tools@gmail.com>
Wed, 4 Oct 2017 00:54:13 +0000 (17:54 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Wed, 4 Oct 2017 00:54:30 +0000 (17:54 -0700)
Don't use "leal main@GOTOFF(%ebx), %eax" since main may be in a
shared object.  Linker will convert "movl main@GOT(%ebx), %eax"
to "leal main@GOTOFF(%ebx), %eax" if main is defined locally.

* sysdeps/i386/start.S: Replace "leal main@GOT(%ebx), %eax" with
"movl main@GOTOFF(%ebx), %eax".

ChangeLog
sysdeps/i386/start.S

index 01517c5514df2b9c0215fe2c0f184943720a9cb9..a8d731c75ddfc023bc7828f95a2001fac05c34ef 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2017-10-03  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * sysdeps/i386/start.S: Replace "leal main@GOT(%ebx), %eax" with
+       "movl main@GOTOFF(%ebx), %eax".
+
 2017-10-03  H.J. Lu  <hongjiu.lu@intel.com>
 
        * sysdeps/i386/dl-machine.h (elf_machine_load_address): Don't
index 375a93c15a0804b1217e9717d7ecbd3063b3201d..916fcd2f9ab27a05b89290a751224388f696f0dc 100644 (file)
@@ -99,8 +99,11 @@ _start:
        pushl main@GOT(%ebx)
 # else
        /* Avoid relocation in static PIE since _start is called before
-          it is relocated.  */
-       leal main@GOTOFF(%ebx), %eax
+          it is relocated.  Don't use "leal main@GOTOFF(%ebx), %eax"
+          since main may be in a shared object.  Linker will convert
+          "movl main@GOT(%ebx), %eax" to "leal main@GOTOFF(%ebx), %eax"
+          if main is defined locally.  */
+       movl main@GOT(%ebx), %eax
        pushl %eax
 # endif
 
This page took 0.073256 seconds and 5 git commands to generate.