How to create an object file in elf format from go

284 views
Skip to first unread message

eafea eaef

unread,
Jan 30, 2021, 7:35:59 PM1/30/21
to golang-nuts
I'm trying to build my own Fort Rango.
One of the requirements for this project is to not import "C".
If I use the official go compiler with "go tool compile", it will output an object file in its own format!
I'm wondering if I can use the official go compiler to produce elf format object files.
I hope someone can help me... (

Ian Lance Taylor

unread,
Jan 30, 2021, 8:07:45 PM1/30/21
to eafea eaef, golang-nuts
I don't understand the goal. If you want a pure Go program that does
not import "C", then who cares what the object file format is? The
final output of `go build` of your main package will be an ELF
executable.

Can you explain why you want an ELF object file?

Thanks.

Ian
Reply all
Reply to author
Forward
0 new messages