Re: c function call issue from assembly program

2022-09-01 Thread Arpan Man Sainju
Hello Nick, Thank you for your response. Maybe the issue is only in Ubuntu 22.04 I was able to make it run in Ubuntu 22.04, by adding something to the stack (assuming stack alignment issue). It works fine after that. Sample: content of asm_program.asm: .global main .text main: * push %rbx*

Re: c function call issue from assembly program

2022-09-01 Thread Nick Clifton
Hi Arpan, I found this interesting issue in binutils v2.38. The following code works perfectly fine in ubuntuĀ 20.04 (binutils v2.34) I could not reproduce this failure. That is when I compiled, assembled and linked your test program using binutils 2.38 tools, the resulting executable ran corr

c function call issue from assembly program

2022-08-31 Thread Arpan Man Sainju
Hello, I found this interesting issue in binutils v2.38. The following code works perfectly fine in ubuntu 20.04 (binutils v2.34) content of asm_program.asm: .global main .text main: mov $message, %rdi call c_function ret .data #where the message is stored message: .ascii "Hello Wor