From: H.J. Lu Date: Wed, 4 Oct 2017 00:54:13 +0000 (-0700) Subject: i386: Use "movl main@GOT(%ebx), %eax" in start.S X-Git-Tag: glibc-2.27~751 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=955774751b71c4bc94029dd541ad9d34634ec995;p=thirdparty%2Fglibc.git i386: Use "movl main@GOT(%ebx), %eax" in start.S 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". --- diff --git a/ChangeLog b/ChangeLog index 01517c5514d..a8d731c75dd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2017-10-03 H.J. Lu + + * sysdeps/i386/start.S: Replace "leal main@GOT(%ebx), %eax" with + "movl main@GOTOFF(%ebx), %eax". + 2017-10-03 H.J. Lu * sysdeps/i386/dl-machine.h (elf_machine_load_address): Don't diff --git a/sysdeps/i386/start.S b/sysdeps/i386/start.S index 375a93c15a0..916fcd2f9ab 100644 --- a/sysdeps/i386/start.S +++ b/sysdeps/i386/start.S @@ -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