On Sun, Aug 30, 2020 at 7:32 AM xie cui <cuiwei...@gmail.com> wrote: > > i am trying to understand code of cmd/link, i need to know where linker get > instructions(text segment in executable file) from *o file, and where linker > write the binary data (.text segment) to excutable file(in linux it 's a elf > file).
The linker was recently rewritten, so I'm describing tip and to some extent Go 1.15, not earlier releases. Object files are read by the cmd/link/internal/loader package. The Go object file format is read by code in cmd/internal/goobj. All the loadable segments are written out by the asmb function in cmd/link/internal/asmb.go. Ian -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CAOyqgcUpTwG8PPCeENXcdTHG-G0DS%3DDbq2RdQJNWzQFiFpVVag%40mail.gmail.com.