How can I compile go plan9 asm to object file with ELF format

160 views
Skip to first unread message

JX Zhang

unread,
Apr 9, 2021, 9:00:14 AM4/9/21
to golang-nuts
Asm in go is in style of plan9. Now I need to compile the asm files into a .o file which is an ELF object
In original go tool chains, go use go/pkg/tool/linux_amd64/asm to compile asm to a `go object` file instead of ELF object


Ian Lance Taylor

unread,
Apr 9, 2021, 3:55:36 PM4/9/21
to JX Zhang, golang-nuts
On Fri, Apr 9, 2021 at 6:00 AM JX Zhang <f011...@gmail.com> wrote:
>
> Asm in go is in style of plan9. Now I need to compile the asm files into a .o file which is an ELF object
> In original go tool chains, go use go/pkg/tool/linux_amd64/asm to compile asm to a `go object` file instead of ELF object

I don't think there is any simple way to do that.

Note that even if there were a way to do that, the calling convention
is different, so you could not call the resulting ELF code in the
usual way.

Ian

JX Zhang

unread,
Apr 11, 2021, 10:57:21 AM4/11/21
to golang-nuts
I hold the same view,   but..
The most helpless thing is that my boss forced me to do something which is difficult and meaningless...

Reply all
Reply to author
Forward
0 new messages