lkml.org 
[lkml]   [2023]   [Aug]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v5 08/13] selftests/sgx: Handle relocations in test enclave
From
On 01.09.23 01:13, Huang, Kai wrote:
>> encl_body:
>> /* snipped */
>> lea encl_op_array(%rip), %rcx
>> lea __encl_base(%rip), %rax
>> add (%rcx,%rdx,8),%rax
>> jmp *%rax
>
> call *%rax
>
> ?
>
>> ret

Good catch, but this is indeed the code as generated with gcc -Os (for
readability). It seems the compiler choose a JMP over a CALL (as the
stack is untouched and the callee can immediately return to the caller).

Somehow, the compiler still emits a RET after the JMP (which is not
supposed to return here) though. I agree this is unnecessarily confusing
and can simply remove the RET from the commit message.

Best,
Jo

\
 
 \ /
  Last update: 2023-09-01 01:26    [W:0.103 / U:0.832 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site