1

As I can compiling go file to asm using:

go tool compile -S hello.go > hello.s

But, how can I run / build this hello.s to binary file ?

  • As far as I know you can't.This assembly output is for debug purposes only. – fuz Jul 15 '20 at 11:20
  • @fuz Thx, by the way, it's possible that build an binary using go binary ? Wht I mean is I build a go file and this binary can generate another binary dynamically. – user13935203 Jul 15 '20 at 11:47
  • @user13935203 The go tool itself was written in Go, so it's a binary that was written in Go, and it generates binaries, so it's possible :) – icza Jul 15 '20 at 11:49
  • @user13935203 How would you like to generate that other binary? – fuz Jul 15 '20 at 11:52
  • @icza Thx, I have to learn go tool source code.(ꏿ᷄౪ ꏿ᷄ ̨ )͞ – user13935203 Jul 15 '20 at 11:56
  • @fuz For example, I got this situation, I have a server and this server can generate his clients with some dynamic parameters. – user13935203 Jul 15 '20 at 12:00
  • 2
    @user13935203 I don't quite understand. Why do you think you need to generate a binary in this situation? This sounds very much like a solution that's only going to cause frustration down the road. – fuz Jul 15 '20 at 12:07

0 Answers0