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

[Bug string/22353] New: sysdeps/i386/i586/strcpy.S isn't maintainable


https://sourceware.org/bugzilla/show_bug.cgi?id=22353

            Bug ID: 22353
           Summary: sysdeps/i386/i586/strcpy.S isn't maintainable
           Product: glibc
           Version: 2.27
            Status: NEW
          Severity: normal
          Priority: P2
         Component: string
          Assignee: unassigned at sourceware dot org
          Reporter: hjl.tools at gmail dot com
  Target Milestone: ---
            Target: i586

sysdeps/i386/i586/strcpy.S has

       andl    $3, %ecx

#ifdef PIC
        call    2f  
        cfi_adjust_cfa_offset (4) 
2:      popl    %edx
        cfi_adjust_cfa_offset (-4)
        /* 0xb is the distance between 2: and 1: but we avoid writing
           1f-2b because the assembler generates worse code.  */
        leal    0xb(%edx,%ecx,8), %ecx
#else
        leal    1f(,%ecx,8), %ecx
#endif

        jmp     *%ecx

        .align 8
1:
        orb     (%esi), %al 
        jz      L(end)
        stosb
        xorl    %eax, %eax
        incl    %esi

        orb     (%esi), %al 
        jz      L(end)
        stosb
        xorl    %eax, %eax
        incl    %esi

        orb     (%esi), %al 
        jz      L(end)
        stosb
        xorl    %eax, %eax
        incl    %esi

L(1):   movl    (%esi), %ecx
        leal    4(%esi),%esi

Change a single instruction will break the jump table.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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