[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-kernel
Subject:    Re: [PATCH v5 08/13] selftests/sgx: Handle relocations in test enclave
From:       Jo Van Bulck <jo.vanbulck () cs ! kuleuven ! be>
Date:       2023-08-31 23:26:08
Message-ID: 55ef3859-774e-1bd3-0e2a-5105cbf0d33a () cs ! kuleuven ! be
[Download RAW message or body]

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
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic