I can only assume I was testing the 32-bit implementation when I claimed
this worked. While improving the 32-bit code I realized that I'd used
signed comparisons instead of unsigned, and came back to find that the
64-bit code didn't work.
By way of apology, make x86-64 the first architecture where __memset_chk
falls through to memset.
Change-Id: I54d9eee5349b6a2abb2ce81e161fdcde09556561
ENTRY(__memset_chk)
# %rdi = dst, %rsi = byte, %rdx = n, %rcx = dst_len
- cmp %rdx, %rcx
- jl memset
-
- # TODO: include __memset_chk_fail in the backtrace?
- call PIC_PLT(__memset_chk_fail)
+ cmp %rcx, %rdx
+ ja __memset_chk_fail
+ // Fall through to memset...
END(__memset_chk)