This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc 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]

[patch] Fix BZ 23606 -- Missing ENDBR32 in sysdeps/i386/start.S


Hello,

The patch is to fix this issue by wrapping the _start function with
ENTRY and END just like what we did for 64bit target. Tested with
glibc 32bit build, there is no regression. OK for trunk?

BR,
Terry


2018-09-07  H.J. Lu  <hongjiu.lu@intel.com>
            Xuepeng Guo  <xuepeng.guo@intel.com>

        [BZ #23606]
        * sysdeps/i386/start.S: Wrap _start function with ENTRY and END.


diff --git a/sysdeps/i386/start.S b/sysdeps/i386/start.S
index 91035fa83f..e35e9bd31b 100644
--- a/sysdeps/i386/start.S
+++ b/sysdeps/i386/start.S
@@ -52,10 +52,11 @@
                                        NULL
 */

-       .text
-       .globl _start
-       .type _start,@function
-_start:
+#include <sysdep.h>
+
+ENTRY (_start)
+       /* Clearing frame pointer is insufficient, use CFI.  */
+       cfi_undefined (eip)
        /* Clear the frame pointer.  The ABI suggests this be done, to mark
           the outermost frame obviously.  */
        xorl %ebp, %ebp
@@ -131,6 +132,7 @@ _start:
 1:     movl    (%esp), %ebx
        ret
 #endif
+END (_start)

 /* To fulfill the System V/i386 ABI we need this symbol.  Yuck, it's so
    meaningless since we don't support machines < 80386.  */


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