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* mov $message, %rdi call c_function *pop %rbx* ret .data #where the message is stored message: .ascii "Hello World\n\0" I thought we don't have to get concerned with stack alignment with the new version of gnu. Let me know if I am wrong. Thank you again for your response. Regards, Arpan On Thu, Sep 1, 2022 at 6:08 AM Nick Clifton <ni...@redhat.com> wrote: > 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 correctly. > > I was however using Fedora rather than Ubuntu, so possibly the problem > is related to any Ubuntu specific changes that have been made to the > binutils sources. > > Also when switching from Ubunti 20.04 to 22.04 it is likely that the > version of gcc has changed as well. So possibly the problem is with > gcc rather than the binutils. > > I suggest that you report the problem using the Ubuntu bug tracking > system. They should be able to give you a more detailed answer. > > Cheers > Nick > > >