go 言語で作ったプログラムでは、main を呼び出すまでのプログラム(いわゆるスタートアップルーチン)はどうなっているのだろうか。

コンパイルしたソースは以下のソース。

hello.go

package main

import "fmt"

func main() {
  fmt.Println("hello")
}

intel Mac 上で、GOARCH/GOOS を設定してビルドしてみた。-x を付けると、実際に何がビルドされているのか見える。 (goroot に go 言語をチェックアウトしたコンパイラ?を使用)

moriya@MacBook-Pro hello % GOARCH=arm64 GOOS=linux ~/goroot/bin/go build -x
WORK=/var/folders/67/77z8h7rd6mndb73yknyd_bbr0000gn/T/go-build328978959
mkdir -p $WORK/b005/
mkdir -p $WORK/b009/
mkdir -p $WORK/b016/
cat >$WORK/b009/importcfg << 'EOF' # internal
# import config
EOF
cat >$WORK/b016/importcfg << 'EOF' # internal
# import config
EOF
cd /Users/moriya/goroot/src/internal/cpu
/Users/moriya/goroot/pkg/tool/darwin_amd64/compile -o $WORK/b009/_pkg_.a -trimpath "$WORK/b009=>" -p internal/cpu -std -+ -complete -buildid vOvcM2du9TrVVkV94b7Y/vOvcM2du9TrVVkV94b7Y -goversion go1.15.6 -D "" -importcfg $WORK/b009/importcfg -pack -c=4 ./cpu.go ./cpu_arm64.go
cat >$WORK/b005/importcfg << 'EOF' # internal
# import config
EOF
cd /Users/moriya/goroot/src/math/bits
/Users/moriya/goroot/pkg/tool/darwin_amd64/compile -o $WORK/b016/_pkg_.a -trimpath "$WORK/b016=>" -p math/bits -std -complete -buildid euZ-COjC4BO53HPfXBvS/euZ-COjC4BO53HPfXBvS -goversion go1.15.6 -D "" -importcfg $WORK/b016/importcfg -pack -c=4 ./bits.go ./bits_errors.go ./bits_tables.go
cd /Users/moriya/goroot/src/internal/unsafeheader
/Users/moriya/goroot/pkg/tool/darwin_amd64/compile -o $WORK/b005/_pkg_.a -trimpath "$WORK/b005=>" -p internal/unsafeheader -std -complete -buildid hCfqR0Ot7KQU2EI9YLtI/hCfqR0Ot7KQU2EI9YLtI -goversion go1.15.6 -D "" -importcfg $WORK/b005/importcfg -pack -c=4 ./unsafeheader.go
mkdir -p $WORK/b018/
mkdir -p $WORK/b020/
cat >$WORK/b018/importcfg << 'EOF' # internal
# import config
EOF
cd /Users/moriya/goroot/src/unicode/utf8
/Users/moriya/goroot/pkg/tool/darwin_amd64/compile -o $WORK/b018/_pkg_.a -trimpath "$WORK/b018=>" -p unicode/utf8 -std -complete -buildid EJjfgE2rAFPJ8z4bOjKc/EJjfgE2rAFPJ8z4bOjKc -goversion go1.15.6 -D "" -importcfg $WORK/b018/importcfg -pack -c=4 ./utf8.go
cat >$WORK/b020/importcfg << 'EOF' # internal
# import config
EOF
mkdir -p $WORK/b012/
cd /Users/moriya/goroot/src/internal/race
/Users/moriya/goroot/pkg/tool/darwin_amd64/compile -o $WORK/b020/_pkg_.a -trimpath "$WORK/b020=>" -p internal/race -std -complete -buildid 2bcJBEseeanYs-OlTORw/2bcJBEseeanYs-OlTORw -goversion go1.15.6 -D "" -importcfg $WORK/b020/importcfg -pack -c=4 ./doc.go ./norace.go
cat >$WORK/b012/importcfg << 'EOF' # internal
# import config
EOF
cd /Users/moriya/goroot/src/runtime/internal/sys
/Users/moriya/goroot/pkg/tool/darwin_amd64/compile -o $WORK/b012/_pkg_.a -trimpath "$WORK/b012=>" -p runtime/internal/sys -std -+ -complete -buildid -4r4mcs7pCfSblbL9_07/-4r4mcs7pCfSblbL9_07 -goversion go1.15.6 -D "" -importcfg $WORK/b012/importcfg -pack -c=4 ./arch.go ./arch_arm64.go ./intrinsics.go ./intrinsics_common.go ./stubs.go ./sys.go ./zgoarch_arm64.go ./zgoos_linux.go ./zversion.go
mkdir -p $WORK/b010/
cat >$WORK/b010/go_asm.h << 'EOF' # internal
EOF
cd /Users/moriya/goroot/src/runtime/internal/atomic
/Users/moriya/goroot/pkg/tool/darwin_amd64/asm -p runtime/internal/atomic -trimpath "$WORK/b010=>" -I $WORK/b010/ -I /Users/moriya/goroot/pkg/include -D GOOS_linux -D GOARCH_arm64 -gensymabis -o $WORK/b010/symabis ./asm_arm64.s ./atomic_arm64.s
mkdir -p $WORK/b021/
cat >$WORK/b021/go_asm.h << 'EOF' # internal
EOF
cd /Users/moriya/goroot/src/sync/atomic
/Users/moriya/goroot/pkg/tool/darwin_amd64/asm -p sync/atomic -trimpath "$WORK/b021=>" -I $WORK/b021/ -I /Users/moriya/goroot/pkg/include -D GOOS_linux -D GOARCH_arm64 -gensymabis -o $WORK/b021/symabis ./asm.s
/Users/moriya/goroot/pkg/tool/darwin_amd64/buildid -w $WORK/b005/_pkg_.a # internal
cp $WORK/b005/_pkg_.a /Users/moriya/Library/Caches/go-build/2c/2c5b48074878a8ef42c0c086dc4722e1df5a336a7813a539cc8b60c95d7ba2fa-d # internal
mkdir -p $WORK/b022/
cat >$WORK/b022/importcfg << 'EOF' # internal
# import config
EOF
cd /Users/moriya/goroot/src/unicode
/Users/moriya/goroot/pkg/tool/darwin_amd64/compile -o $WORK/b022/_pkg_.a -trimpath "$WORK/b022=>" -p unicode -std -complete -buildid 5K6urx6QFusvGVO2f1Aw/5K6urx6QFusvGVO2f1Aw -goversion go1.15.6 -D "" -importcfg $WORK/b022/importcfg -pack -c=4 ./casetables.go ./digit.go ./graphic.go ./letter.go ./tables.go
cat >$WORK/b010/importcfg << 'EOF' # internal
# import config
EOF
cd /Users/moriya/goroot/src/runtime/internal/atomic
/Users/moriya/goroot/pkg/tool/darwin_amd64/compile -o $WORK/b010/_pkg_.a -trimpath "$WORK/b010=>" -p runtime/internal/atomic -std -+ -buildid kk0Vd8uys5qlC3kmmS0K/kk0Vd8uys5qlC3kmmS0K -goversion go1.15.6 -symabis $WORK/b010/symabis -D "" -importcfg $WORK/b010/importcfg -pack -asmhdr $WORK/b010/go_asm.h -c=4 ./atomic_arm64.go ./stubs.go
/Users/moriya/goroot/pkg/tool/darwin_amd64/buildid -w $WORK/b020/_pkg_.a # internal
cp $WORK/b020/_pkg_.a /Users/moriya/Library/Caches/go-build/98/987af3a718d177b968468c06f1884de0186afb935f5f4bce938eec99001ebe04-d # internal
/Users/moriya/goroot/pkg/tool/darwin_amd64/buildid -w $WORK/b009/_pkg_.a # internal
cp $WORK/b009/_pkg_.a /Users/moriya/Library/Caches/go-build/3f/3fd3aa650b6ad654bcb322276531eed4d5e762b3df8f303de96e5762971872fe-d # internal
mkdir -p $WORK/b008/
/Users/moriya/goroot/pkg/tool/darwin_amd64/buildid -w $WORK/b012/_pkg_.a # internal
cat >$WORK/b008/go_asm.h << 'EOF' # internal
EOF
cd /Users/moriya/goroot/src/internal/bytealg
/Users/moriya/goroot/pkg/tool/darwin_amd64/asm -p internal/bytealg -trimpath "$WORK/b008=>" -I $WORK/b008/ -I /Users/moriya/goroot/pkg/include -D GOOS_linux -D GOARCH_arm64 -gensymabis -o $WORK/b008/symabis ./compare_arm64.s ./count_arm64.s ./equal_arm64.s ./index_arm64.s ./indexbyte_arm64.s
/Users/moriya/goroot/pkg/tool/darwin_amd64/buildid -w $WORK/b018/_pkg_.a # internal
cat >$WORK/b021/importcfg << 'EOF' # internal
# import config
EOF
cd /Users/moriya/goroot/src/sync/atomic
/Users/moriya/goroot/pkg/tool/darwin_amd64/compile -o $WORK/b021/_pkg_.a -trimpath "$WORK/b021=>" -p sync/atomic -std -buildid fOpkhlzk3Qm50Oym6vmx/fOpkhlzk3Qm50Oym6vmx -goversion go1.15.6 -symabis $WORK/b021/symabis -D "" -importcfg $WORK/b021/importcfg -pack -asmhdr $WORK/b021/go_asm.h -c=4 ./doc.go ./value.go
/Users/moriya/goroot/pkg/tool/darwin_amd64/buildid -w $WORK/b016/_pkg_.a # internal
cp $WORK/b012/_pkg_.a /Users/moriya/Library/Caches/go-build/56/56dd4adb11fd445df94d3021c6a5efb4f63a640d12f01b9f4279c41417258123-d # internal
mkdir -p $WORK/b011/
cp $WORK/b018/_pkg_.a /Users/moriya/Library/Caches/go-build/dc/dced1a5eeb749141102c8c0832cada9eff68edf0450921223b3c158b7ad79621-d # internal
cat >$WORK/b011/importcfg << 'EOF' # internal
# import config
packagefile runtime/internal/sys=$WORK/b012/_pkg_.a
EOF
cp $WORK/b016/_pkg_.a /Users/moriya/Library/Caches/go-build/66/66b194f41f9ad9aab5651c7183d3565984076ac1f6b432ef89df2086b78ea0c0-d # internal
cd /Users/moriya/goroot/src/runtime/internal/math
/Users/moriya/goroot/pkg/tool/darwin_amd64/compile -o $WORK/b011/_pkg_.a -trimpath "$WORK/b011=>" -p runtime/internal/math -std -+ -complete -buildid Ar8a1FVOe4p09UYVCWs5/Ar8a1FVOe4p09UYVCWs5 -goversion go1.15.6 -D "" -importcfg $WORK/b011/importcfg -pack -c=4 ./math.go
mkdir -p $WORK/b015/
cat >$WORK/b015/go_asm.h << 'EOF' # internal
EOF
cd /Users/moriya/goroot/src/math
/Users/moriya/goroot/pkg/tool/darwin_amd64/asm -p math -trimpath "$WORK/b015=>" -I $WORK/b015/ -I /Users/moriya/goroot/pkg/include -D GOOS_linux -D GOARCH_arm64 -gensymabis -o $WORK/b015/symabis ./dim_arm64.s ./exp_arm64.s ./floor_arm64.s ./modf_arm64.s ./sqrt_arm64.s ./stubs_arm64.s
cd /Users/moriya/goroot/src/runtime/internal/atomic
/Users/moriya/goroot/pkg/tool/darwin_amd64/asm -p runtime/internal/atomic -trimpath "$WORK/b010=>" -I $WORK/b010/ -I /Users/moriya/goroot/pkg/include -D GOOS_linux -D GOARCH_arm64 -o $WORK/b010/asm_arm64.o ./asm_arm64.s
cat >$WORK/b008/importcfg << 'EOF' # internal
# import config
packagefile internal/cpu=$WORK/b009/_pkg_.a
EOF
cd /Users/moriya/goroot/src/internal/bytealg
/Users/moriya/goroot/pkg/tool/darwin_amd64/compile -o $WORK/b008/_pkg_.a -trimpath "$WORK/b008=>" -p internal/bytealg -std -+ -buildid 3oMhsFwunDZ0nZbIVKjH/3oMhsFwunDZ0nZbIVKjH -goversion go1.15.6 -symabis $WORK/b008/symabis -D "" -importcfg $WORK/b008/importcfg -pack -asmhdr $WORK/b008/go_asm.h -c=4 ./bytealg.go ./compare_native.go ./count_native.go ./equal_generic.go ./equal_native.go ./index_arm64.go ./index_native.go ./indexbyte_native.go
cd /Users/moriya/goroot/src/sync/atomic
/Users/moriya/goroot/pkg/tool/darwin_amd64/asm -p sync/atomic -trimpath "$WORK/b021=>" -I $WORK/b021/ -I /Users/moriya/goroot/pkg/include -D GOOS_linux -D GOARCH_arm64 -o $WORK/b021/asm.o ./asm.s
/Users/moriya/goroot/pkg/tool/darwin_amd64/buildid -w $WORK/b011/_pkg_.a # internal
cp $WORK/b011/_pkg_.a /Users/moriya/Library/Caches/go-build/84/84aa11376c9f30d899ac9491f2513dd35bd520ab2201beb1b91e463ce073f656-d # internal
cat >$WORK/b015/importcfg << 'EOF' # internal
# import config
packagefile math/bits=$WORK/b016/_pkg_.a
EOF
cd /Users/moriya/goroot/src/runtime/internal/atomic
/Users/moriya/goroot/pkg/tool/darwin_amd64/asm -p runtime/internal/atomic -trimpath "$WORK/b010=>" -I $WORK/b010/ -I /Users/moriya/goroot/pkg/include -D GOOS_linux -D GOARCH_arm64 -o $WORK/b010/atomic_arm64.o ./atomic_arm64.s
cd /Users/moriya/goroot/src/math
/Users/moriya/goroot/pkg/tool/darwin_amd64/compile -o $WORK/b015/_pkg_.a -trimpath "$WORK/b015=>" -p math -std -buildid iAjZuKwrzXRaZlpN1q6E/iAjZuKwrzXRaZlpN1q6E -goversion go1.15.6 -symabis $WORK/b015/symabis -D "" -importcfg $WORK/b015/importcfg -pack -asmhdr $WORK/b015/go_asm.h -c=4 ./abs.go ./acosh.go ./asin.go ./asinh.go ./atan.go ./atan2.go ./atanh.go ./bits.go ./cbrt.go ./const.go ./copysign.go ./dim.go ./erf.go ./erfinv.go ./exp.go ./expm1.go ./floor.go ./fma.go ./frexp.go ./gamma.go ./hypot.go ./j0.go ./j1.go ./jn.go ./ldexp.go ./lgamma.go ./log.go ./log10.go ./log1p.go ./logb.go ./mod.go ./modf.go ./nextafter.go ./pow.go ./pow10.go ./remainder.go ./signbit.go ./sin.go ./sincos.go ./sinh.go ./sqrt.go ./tan.go ./tanh.go ./trig_reduce.go ./unsafe.go
cd /Users/moriya/goroot/src/sync/atomic
/Users/moriya/goroot/pkg/tool/darwin_amd64/pack r $WORK/b021/_pkg_.a $WORK/b021/asm.o # internal
/Users/moriya/goroot/pkg/tool/darwin_amd64/buildid -w $WORK/b021/_pkg_.a # internal
cp $WORK/b021/_pkg_.a /Users/moriya/Library/Caches/go-build/7c/7cc5768eb6132015900222b626223902b600f5a23c9f26689e05e254694ac1b3-d # internal
cd /Users/moriya/goroot/src/internal/bytealg
/Users/moriya/goroot/pkg/tool/darwin_amd64/asm -p internal/bytealg -trimpath "$WORK/b008=>" -I $WORK/b008/ -I /Users/moriya/goroot/pkg/include -D GOOS_linux -D GOARCH_arm64 -o $WORK/b008/compare_arm64.o ./compare_arm64.s
mkdir -p $WORK/b032/
cd /Users/moriya/goroot/src/runtime/internal/atomic
/Users/moriya/goroot/pkg/tool/darwin_amd64/pack r $WORK/b010/_pkg_.a $WORK/b010/asm_arm64.o $WORK/b010/atomic_arm64.o # internal
/Users/moriya/goroot/pkg/tool/darwin_amd64/buildid -w $WORK/b010/_pkg_.a # internal
cat >$WORK/b032/importcfg << 'EOF' # internal
# import config
packagefile sync/atomic=$WORK/b021/_pkg_.a
EOF
cd /Users/moriya/goroot/src/internal/testlog
/Users/moriya/goroot/pkg/tool/darwin_amd64/compile -o $WORK/b032/_pkg_.a -trimpath "$WORK/b032=>" -p internal/testlog -std -complete -buildid JDeFot24GKyxq4MQoG3C/JDeFot24GKyxq4MQoG3C -goversion go1.15.6 -D "" -importcfg $WORK/b032/importcfg -pack -c=4 ./log.go
cp $WORK/b010/_pkg_.a /Users/moriya/Library/Caches/go-build/14/14385206a8c5387392551e130d2c34ef4bd271261d394fa60d18bc9a6241b920-d # internal
cd /Users/moriya/goroot/src/internal/bytealg
/Users/moriya/goroot/pkg/tool/darwin_amd64/asm -p internal/bytealg -trimpath "$WORK/b008=>" -I $WORK/b008/ -I /Users/moriya/goroot/pkg/include -D GOOS_linux -D GOARCH_arm64 -o $WORK/b008/count_arm64.o ./count_arm64.s
/Users/moriya/goroot/pkg/tool/darwin_amd64/buildid -w $WORK/b032/_pkg_.a # internal
cp $WORK/b032/_pkg_.a /Users/moriya/Library/Caches/go-build/d4/d47850a80a0b7cf1ac1281d04e2776a410e650666f742b51fa60e6b46b840713-d # internal
/Users/moriya/goroot/pkg/tool/darwin_amd64/asm -p internal/bytealg -trimpath "$WORK/b008=>" -I $WORK/b008/ -I /Users/moriya/goroot/pkg/include -D GOOS_linux -D GOARCH_arm64 -o $WORK/b008/equal_arm64.o ./equal_arm64.s
/Users/moriya/goroot/pkg/tool/darwin_amd64/asm -p internal/bytealg -trimpath "$WORK/b008=>" -I $WORK/b008/ -I /Users/moriya/goroot/pkg/include -D GOOS_linux -D GOARCH_arm64 -o $WORK/b008/index_arm64.o ./index_arm64.s
/Users/moriya/goroot/pkg/tool/darwin_amd64/asm -p internal/bytealg -trimpath "$WORK/b008=>" -I $WORK/b008/ -I /Users/moriya/goroot/pkg/include -D GOOS_linux -D GOARCH_arm64 -o $WORK/b008/indexbyte_arm64.o ./indexbyte_arm64.s
cd /Users/moriya/goroot/src/math
/Users/moriya/goroot/pkg/tool/darwin_amd64/asm -p math -trimpath "$WORK/b015=>" -I $WORK/b015/ -I /Users/moriya/goroot/pkg/include -D GOOS_linux -D GOARCH_arm64 -o $WORK/b015/dim_arm64.o ./dim_arm64.s
cd /Users/moriya/goroot/src/internal/bytealg
/Users/moriya/goroot/pkg/tool/darwin_amd64/pack r $WORK/b008/_pkg_.a $WORK/b008/compare_arm64.o $WORK/b008/count_arm64.o $WORK/b008/equal_arm64.o $WORK/b008/index_arm64.o $WORK/b008/indexbyte_arm64.o # internal
/Users/moriya/goroot/pkg/tool/darwin_amd64/buildid -w $WORK/b022/_pkg_.a # internal
/Users/moriya/goroot/pkg/tool/darwin_amd64/buildid -w $WORK/b008/_pkg_.a # internal
cp $WORK/b008/_pkg_.a /Users/moriya/Library/Caches/go-build/60/60721c4efb7195ffb00290e5270e0f274a31847b6794adc34b297593dffa0834-d # internal
cp $WORK/b022/_pkg_.a /Users/moriya/Library/Caches/go-build/3b/3bc2e0ba834ddda18c0a254b24e999ce95fb8061972fdc59523efc43aa8abb97-d # internal
cd /Users/moriya/goroot/src/math
/Users/moriya/goroot/pkg/tool/darwin_amd64/asm -p math -trimpath "$WORK/b015=>" -I $WORK/b015/ -I /Users/moriya/goroot/pkg/include -D GOOS_linux -D GOARCH_arm64 -o $WORK/b015/exp_arm64.o ./exp_arm64.s
mkdir -p $WORK/b007/
cat >$WORK/b007/go_asm.h << 'EOF' # internal
EOF
cd /Users/moriya/goroot/src/runtime
/Users/moriya/goroot/pkg/tool/darwin_amd64/asm -p runtime -trimpath "$WORK/b007=>" -I $WORK/b007/ -I /Users/moriya/goroot/pkg/include -D GOOS_linux -D GOARCH_arm64 -gensymabis -o $WORK/b007/symabis ./asm.s ./asm_arm64.s ./atomic_arm64.s ./duff_arm64.s ./memclr_arm64.s ./memmove_arm64.s ./preempt_arm64.s ./rt0_linux_arm64.s ./sys_linux_arm64.s ./tls_arm64.s
cd /Users/moriya/goroot/src/math
/Users/moriya/goroot/pkg/tool/darwin_amd64/asm -p math -trimpath "$WORK/b015=>" -I $WORK/b015/ -I /Users/moriya/goroot/pkg/include -D GOOS_linux -D GOARCH_arm64 -o $WORK/b015/floor_arm64.o ./floor_arm64.s
/Users/moriya/goroot/pkg/tool/darwin_amd64/asm -p math -trimpath "$WORK/b015=>" -I $WORK/b015/ -I /Users/moriya/goroot/pkg/include -D GOOS_linux -D GOARCH_arm64 -o $WORK/b015/modf_arm64.o ./modf_arm64.s
cat >$WORK/b007/importcfg << 'EOF' # internal
# import config
packagefile internal/bytealg=$WORK/b008/_pkg_.a
packagefile internal/cpu=$WORK/b009/_pkg_.a
packagefile runtime/internal/atomic=$WORK/b010/_pkg_.a
packagefile runtime/internal/math=$WORK/b011/_pkg_.a
packagefile runtime/internal/sys=$WORK/b012/_pkg_.a
EOF
cd /Users/moriya/goroot/src/runtime
/Users/moriya/goroot/pkg/tool/darwin_amd64/compile -o $WORK/b007/_pkg_.a -trimpath "$WORK/b007=>" -p runtime -std -+ -buildid _RoAy0ME7yusboC13u7x/_RoAy0ME7yusboC13u7x -goversion go1.15.6 -symabis $WORK/b007/symabis -D "" -importcfg $WORK/b007/importcfg -pack -asmhdr $WORK/b007/go_asm.h -c=4 ./alg.go ./atomic_pointer.go ./cgo.go ./cgo_mmap.go ./cgo_sigaction.go ./cgocall.go ./cgocallback.go ./cgocheck.go ./chan.go ./checkptr.go ./compiler.go ./complex.go ./cpuflags.go ./cpuprof.go ./debug.go ./debuglog.go ./debuglog_off.go ./defs_linux_arm64.go ./env_posix.go ./error.go ./extern.go ./fastlog2.go ./fastlog2table.go ./float.go ./hash64.go ./heapdump.go ./iface.go ./lfstack.go ./lfstack_64bit.go ./lock_futex.go ./lockrank.go ./lockrank_off.go ./malloc.go ./map.go ./map_fast32.go ./map_fast64.go ./map_faststr.go ./mbarrier.go ./mbitmap.go ./mcache.go ./mcentral.go ./mem_linux.go ./mfinal.go ./mfixalloc.go ./mgc.go ./mgcmark.go ./mgcscavenge.go ./mgcstack.go ./mgcsweep.go ./mgcsweepbuf.go ./mgcwork.go ./mheap.go ./mpagealloc.go ./mpagealloc_64bit.go ./mpagecache.go ./mpallocbits.go ./mprof.go ./mranges.go ./msan0.go ./msize.go ./mspanset.go ./mstats.go ./mwbbuf.go ./nbpipe_pipe2.go ./netpoll.go ./netpoll_epoll.go ./os_linux.go ./os_linux_arm64.go ./os_linux_generic.go ./os_nonopenbsd.go ./panic.go ./plugin.go ./preempt.go ./preempt_nonwindows.go ./print.go ./proc.go ./profbuf.go ./proflabel.go ./race0.go ./rdebug.go ./relax_stub.go ./runtime.go ./runtime1.go ./runtime2.go ./rwmutex.go ./select.go ./sema.go ./signal_arm64.go ./signal_linux_arm64.go ./signal_unix.go ./sigqueue.go ./sigqueue_note.go ./sigtab_linux_generic.go ./sizeclasses.go ./slice.go ./softfloat64.go ./stack.go ./string.go ./stubs.go ./stubs2.go ./stubs3.go ./stubs_arm64.go ./stubs_linux.go ./symtab.go ./sys_arm64.go ./sys_nonppc64x.go ./time.go ./time_nofake.go ./timestub.go ./timestub2.go ./trace.go ./traceback.go ./type.go ./typekind.go ./utf8.go ./vdso_elf64.go ./vdso_linux.go ./vdso_linux_arm64.go ./write_err.go
cd /Users/moriya/goroot/src/math
/Users/moriya/goroot/pkg/tool/darwin_amd64/asm -p math -trimpath "$WORK/b015=>" -I $WORK/b015/ -I /Users/moriya/goroot/pkg/include -D GOOS_linux -D GOARCH_arm64 -o $WORK/b015/sqrt_arm64.o ./sqrt_arm64.s
/Users/moriya/goroot/pkg/tool/darwin_amd64/asm -p math -trimpath "$WORK/b015=>" -I $WORK/b015/ -I /Users/moriya/goroot/pkg/include -D GOOS_linux -D GOARCH_arm64 -o $WORK/b015/stubs_arm64.o ./stubs_arm64.s
/Users/moriya/goroot/pkg/tool/darwin_amd64/pack r $WORK/b015/_pkg_.a $WORK/b015/dim_arm64.o $WORK/b015/exp_arm64.o $WORK/b015/floor_arm64.o $WORK/b015/modf_arm64.o $WORK/b015/sqrt_arm64.o $WORK/b015/stubs_arm64.o # internal
/Users/moriya/goroot/pkg/tool/darwin_amd64/buildid -w $WORK/b015/_pkg_.a # internal
cp $WORK/b015/_pkg_.a /Users/moriya/Library/Caches/go-build/ec/ec9f40aeec2888c70fc14b12b9162928d4bcd66d6547cf402ed6f008da762895-d # internal
cp /Users/moriya/goroot/src/runtime/tls_arm64.h $WORK/b007/tls_GOARCH.h
cd /Users/moriya/goroot/src/runtime
/Users/moriya/goroot/pkg/tool/darwin_amd64/asm -p runtime -trimpath "$WORK/b007=>" -I $WORK/b007/ -I /Users/moriya/goroot/pkg/include -D GOOS_linux -D GOARCH_arm64 -o $WORK/b007/asm.o ./asm.s
/Users/moriya/goroot/pkg/tool/darwin_amd64/asm -p runtime -trimpath "$WORK/b007=>" -I $WORK/b007/ -I /Users/moriya/goroot/pkg/include -D GOOS_linux -D GOARCH_arm64 -o $WORK/b007/asm_arm64.o ./asm_arm64.s
/Users/moriya/goroot/pkg/tool/darwin_amd64/asm -p runtime -trimpath "$WORK/b007=>" -I $WORK/b007/ -I /Users/moriya/goroot/pkg/include -D GOOS_linux -D GOARCH_arm64 -o $WORK/b007/atomic_arm64.o ./atomic_arm64.s
/Users/moriya/goroot/pkg/tool/darwin_amd64/asm -p runtime -trimpath "$WORK/b007=>" -I $WORK/b007/ -I /Users/moriya/goroot/pkg/include -D GOOS_linux -D GOARCH_arm64 -o $WORK/b007/duff_arm64.o ./duff_arm64.s
/Users/moriya/goroot/pkg/tool/darwin_amd64/asm -p runtime -trimpath "$WORK/b007=>" -I $WORK/b007/ -I /Users/moriya/goroot/pkg/include -D GOOS_linux -D GOARCH_arm64 -o $WORK/b007/memclr_arm64.o ./memclr_arm64.s
/Users/moriya/goroot/pkg/tool/darwin_amd64/asm -p runtime -trimpath "$WORK/b007=>" -I $WORK/b007/ -I /Users/moriya/goroot/pkg/include -D GOOS_linux -D GOARCH_arm64 -o $WORK/b007/memmove_arm64.o ./memmove_arm64.s
/Users/moriya/goroot/pkg/tool/darwin_amd64/asm -p runtime -trimpath "$WORK/b007=>" -I $WORK/b007/ -I /Users/moriya/goroot/pkg/include -D GOOS_linux -D GOARCH_arm64 -o $WORK/b007/preempt_arm64.o ./preempt_arm64.s
/Users/moriya/goroot/pkg/tool/darwin_amd64/asm -p runtime -trimpath "$WORK/b007=>" -I $WORK/b007/ -I /Users/moriya/goroot/pkg/include -D GOOS_linux -D GOARCH_arm64 -o $WORK/b007/rt0_linux_arm64.o ./rt0_linux_arm64.s
/Users/moriya/goroot/pkg/tool/darwin_amd64/asm -p runtime -trimpath "$WORK/b007=>" -I $WORK/b007/ -I /Users/moriya/goroot/pkg/include -D GOOS_linux -D GOARCH_arm64 -o $WORK/b007/sys_linux_arm64.o ./sys_linux_arm64.s
/Users/moriya/goroot/pkg/tool/darwin_amd64/asm -p runtime -trimpath "$WORK/b007=>" -I $WORK/b007/ -I /Users/moriya/goroot/pkg/include -D GOOS_linux -D GOARCH_arm64 -o $WORK/b007/tls_arm64.o ./tls_arm64.s
/Users/moriya/goroot/pkg/tool/darwin_amd64/pack r $WORK/b007/_pkg_.a $WORK/b007/asm.o $WORK/b007/asm_arm64.o $WORK/b007/atomic_arm64.o $WORK/b007/duff_arm64.o $WORK/b007/memclr_arm64.o $WORK/b007/memmove_arm64.o $WORK/b007/preempt_arm64.o $WORK/b007/rt0_linux_arm64.o $WORK/b007/sys_linux_arm64.o $WORK/b007/tls_arm64.o # internal
/Users/moriya/goroot/pkg/tool/darwin_amd64/buildid -w $WORK/b007/_pkg_.a # internal
cp $WORK/b007/_pkg_.a /Users/moriya/Library/Caches/go-build/e4/e44daff829b00abc533c27cff18370224775e4ec2a6923e9690d832efce5370c-d # internal
mkdir -p $WORK/b004/
mkdir -p $WORK/b019/
cat >$WORK/b004/go_asm.h << 'EOF' # internal
EOF
cat >$WORK/b019/importcfg << 'EOF' # internal
# import config
packagefile internal/race=$WORK/b020/_pkg_.a
packagefile runtime=$WORK/b007/_pkg_.a
packagefile sync/atomic=$WORK/b021/_pkg_.a
EOF
cd /Users/moriya/goroot/src/internal/reflectlite
/Users/moriya/goroot/pkg/tool/darwin_amd64/asm -p internal/reflectlite -trimpath "$WORK/b004=>" -I $WORK/b004/ -I /Users/moriya/goroot/pkg/include -D GOOS_linux -D GOARCH_arm64 -gensymabis -o $WORK/b004/symabis ./asm.s
cd /Users/moriya/goroot/src/sync
/Users/moriya/goroot/pkg/tool/darwin_amd64/compile -o $WORK/b019/_pkg_.a -trimpath "$WORK/b019=>" -p sync -std -buildid bDkC5Ra5vg-0gnMMczPC/bDkC5Ra5vg-0gnMMczPC -goversion go1.15.6 -D "" -importcfg $WORK/b019/importcfg -pack -c=4 ./cond.go ./map.go ./mutex.go ./once.go ./pool.go ./poolqueue.go ./runtime.go ./runtime2.go ./rwmutex.go ./waitgroup.go
cat >$WORK/b004/importcfg << 'EOF' # internal
# import config
packagefile internal/unsafeheader=$WORK/b005/_pkg_.a
packagefile runtime=$WORK/b007/_pkg_.a
EOF
cd /Users/moriya/goroot/src/internal/reflectlite
/Users/moriya/goroot/pkg/tool/darwin_amd64/compile -o $WORK/b004/_pkg_.a -trimpath "$WORK/b004=>" -p internal/reflectlite -std -buildid K_ekQMwTtBmHNWieValh/K_ekQMwTtBmHNWieValh -goversion go1.15.6 -symabis $WORK/b004/symabis -D "" -importcfg $WORK/b004/importcfg -pack -asmhdr $WORK/b004/go_asm.h -c=4 ./swapper.go ./type.go ./value.go
/Users/moriya/goroot/pkg/tool/darwin_amd64/buildid -w $WORK/b019/_pkg_.a # internal
cp $WORK/b019/_pkg_.a /Users/moriya/Library/Caches/go-build/3c/3c5d13307ea81d1787800ef3dd2f16f5327a25dcca21cdeb4e7e5373c6236493-d # internal
/Users/moriya/goroot/pkg/tool/darwin_amd64/asm -p internal/reflectlite -trimpath "$WORK/b004=>" -I $WORK/b004/ -I /Users/moriya/goroot/pkg/include -D GOOS_linux -D GOARCH_arm64 -o $WORK/b004/asm.o ./asm.s
/Users/moriya/goroot/pkg/tool/darwin_amd64/pack r $WORK/b004/_pkg_.a $WORK/b004/asm.o # internal
/Users/moriya/goroot/pkg/tool/darwin_amd64/buildid -w $WORK/b004/_pkg_.a # internal
cp $WORK/b004/_pkg_.a /Users/moriya/Library/Caches/go-build/11/119a5b4f08e7125167939b39b4c7fd5b71b81bf4028885f994ad65443e5eefce-d # internal
mkdir -p $WORK/b003/
mkdir -p $WORK/b023/
cat >$WORK/b003/importcfg << 'EOF' # internal
# import config
packagefile internal/reflectlite=$WORK/b004/_pkg_.a
EOF
cat >$WORK/b023/importcfg << 'EOF' # internal
# import config
packagefile internal/reflectlite=$WORK/b004/_pkg_.a
EOF
cd /Users/moriya/goroot/src/errors
/Users/moriya/goroot/pkg/tool/darwin_amd64/compile -o $WORK/b003/_pkg_.a -trimpath "$WORK/b003=>" -p errors -std -complete -buildid B5TWWAAoyqvTzJ2Qn9-1/B5TWWAAoyqvTzJ2Qn9-1 -goversion go1.15.6 -D "" -importcfg $WORK/b003/importcfg -pack -c=4 ./errors.go ./wrap.go
cd /Users/moriya/goroot/src/sort
/Users/moriya/goroot/pkg/tool/darwin_amd64/compile -o $WORK/b023/_pkg_.a -trimpath "$WORK/b023=>" -p sort -std -complete -buildid 9bBBEh25I-mzuiqsU39N/9bBBEh25I-mzuiqsU39N -goversion go1.15.6 -D "" -importcfg $WORK/b023/importcfg -pack -c=4 ./search.go ./slice.go ./slice_go113.go ./sort.go ./zfuncversion.go
/Users/moriya/goroot/pkg/tool/darwin_amd64/buildid -w $WORK/b003/_pkg_.a # internal
cp $WORK/b003/_pkg_.a /Users/moriya/Library/Caches/go-build/e8/e820cf651d9df8da29a732d7b172970e1df05cadfa225222002c29fa27effbfd-d # internal
mkdir -p $WORK/b026/
mkdir -p $WORK/b024/
mkdir -p $WORK/b017/
cat >$WORK/b026/importcfg << 'EOF' # internal
# import config
packagefile errors=$WORK/b003/_pkg_.a
EOF
cd /Users/moriya/goroot/src/internal/oserror
/Users/moriya/goroot/pkg/tool/darwin_amd64/compile -o $WORK/b026/_pkg_.a -trimpath "$WORK/b026=>" -p internal/oserror -std -complete -buildid SFOHZJwAC4ZrhivjVK0a/SFOHZJwAC4ZrhivjVK0a -goversion go1.15.6 -D "" -importcfg $WORK/b026/importcfg -pack -c=4 ./errors.go
cat >$WORK/b024/importcfg << 'EOF' # internal
# import config
packagefile errors=$WORK/b003/_pkg_.a
packagefile sync=$WORK/b019/_pkg_.a
EOF
cat >$WORK/b017/importcfg << 'EOF' # internal
# import config
packagefile errors=$WORK/b003/_pkg_.a
packagefile internal/bytealg=$WORK/b008/_pkg_.a
packagefile math=$WORK/b015/_pkg_.a
packagefile math/bits=$WORK/b016/_pkg_.a
packagefile unicode/utf8=$WORK/b018/_pkg_.a
EOF
cd /Users/moriya/goroot/src/io
/Users/moriya/goroot/pkg/tool/darwin_amd64/compile -o $WORK/b024/_pkg_.a -trimpath "$WORK/b024=>" -p io -std -complete -buildid rBT632JhDyTHQkG8y6hZ/rBT632JhDyTHQkG8y6hZ -goversion go1.15.6 -D "" -importcfg $WORK/b024/importcfg -pack -c=4 ./io.go ./multi.go ./pipe.go
cd /Users/moriya/goroot/src/strconv
/Users/moriya/goroot/pkg/tool/darwin_amd64/compile -o $WORK/b017/_pkg_.a -trimpath "$WORK/b017=>" -p strconv -std -complete -buildid q32GA3e0GCdHJ8sPmBis/q32GA3e0GCdHJ8sPmBis -goversion go1.15.6 -D "" -importcfg $WORK/b017/importcfg -pack -c=4 ./atob.go ./atoc.go ./atof.go ./atoi.go ./ctoa.go ./decimal.go ./doc.go ./extfloat.go ./ftoa.go ./isprint.go ./itoa.go ./quote.go
/Users/moriya/goroot/pkg/tool/darwin_amd64/buildid -w $WORK/b023/_pkg_.a # internal
cp $WORK/b023/_pkg_.a /Users/moriya/Library/Caches/go-build/b5/b58fc31dc9c57a0b7897398e4249c6deb41ef2d78dfa7a13db2dc01ff04d4f0c-d # internal
/Users/moriya/goroot/pkg/tool/darwin_amd64/buildid -w $WORK/b026/_pkg_.a # internal
cp $WORK/b026/_pkg_.a /Users/moriya/Library/Caches/go-build/58/588245cb133d1ec21596baf7227713ef500d4af1c56fac751bc73a5423384063-d # internal
mkdir -p $WORK/b029/
cat >$WORK/b029/go_asm.h << 'EOF' # internal
EOF
cd /Users/moriya/goroot/src/syscall
/Users/moriya/goroot/pkg/tool/darwin_amd64/asm -p syscall -trimpath "$WORK/b029=>" -I $WORK/b029/ -I /Users/moriya/goroot/pkg/include -D GOOS_linux -D GOARCH_arm64 -gensymabis -o $WORK/b029/symabis ./asm_linux_arm64.s
cat >$WORK/b029/importcfg << 'EOF' # internal
# import config
packagefile errors=$WORK/b003/_pkg_.a
packagefile internal/bytealg=$WORK/b008/_pkg_.a
packagefile internal/oserror=$WORK/b026/_pkg_.a
packagefile internal/race=$WORK/b020/_pkg_.a
packagefile internal/unsafeheader=$WORK/b005/_pkg_.a
packagefile runtime=$WORK/b007/_pkg_.a
packagefile sync=$WORK/b019/_pkg_.a
EOF
/Users/moriya/goroot/pkg/tool/darwin_amd64/compile -o $WORK/b029/_pkg_.a -trimpath "$WORK/b029=>" -p syscall -std -buildid a2ORWSGmYGd3pzzjAqah/a2ORWSGmYGd3pzzjAqah -goversion go1.15.6 -symabis $WORK/b029/symabis -D "" -importcfg $WORK/b029/importcfg -pack -asmhdr $WORK/b029/go_asm.h -c=4 ./dirent.go ./endian_little.go ./env_unix.go ./exec_linux.go ./exec_unix.go ./flock.go ./lsf_linux.go ./msan0.go ./net.go ./netlink_linux.go ./setuidgid_linux.go ./sock_cloexec_linux.go ./sockcmsg_linux.go ./sockcmsg_unix.go ./sockcmsg_unix_other.go ./str.go ./syscall.go ./syscall_dup3_linux.go ./syscall_linux.go ./syscall_linux_arm64.go ./syscall_unix.go ./time_nofake.go ./timestruct.go ./zerrors_linux_arm64.go ./zsyscall_linux_arm64.go ./zsysnum_linux_arm64.go ./ztypes_linux_arm64.go
/Users/moriya/goroot/pkg/tool/darwin_amd64/buildid -w $WORK/b024/_pkg_.a # internal
cp $WORK/b024/_pkg_.a /Users/moriya/Library/Caches/go-build/b7/b72ac8e89068dffb4ad4c07a0209b724e243025df864628617b6cd2ce3876c39-d # internal
/Users/moriya/goroot/pkg/tool/darwin_amd64/buildid -w $WORK/b017/_pkg_.a # internal
cp $WORK/b017/_pkg_.a /Users/moriya/Library/Caches/go-build/46/462e0bef9ffaf9696b83b23148252acd584d52e647f82bbd34d4840989bf2f4b-d # internal
mkdir -p $WORK/b014/
cat >$WORK/b014/go_asm.h << 'EOF' # internal
EOF
cd /Users/moriya/goroot/src/reflect
/Users/moriya/goroot/pkg/tool/darwin_amd64/asm -p reflect -trimpath "$WORK/b014=>" -I $WORK/b014/ -I /Users/moriya/goroot/pkg/include -D GOOS_linux -D GOARCH_arm64 -gensymabis -o $WORK/b014/symabis ./asm_arm64.s
cat >$WORK/b014/importcfg << 'EOF' # internal
# import config
packagefile internal/unsafeheader=$WORK/b005/_pkg_.a
packagefile math=$WORK/b015/_pkg_.a
packagefile runtime=$WORK/b007/_pkg_.a
packagefile strconv=$WORK/b017/_pkg_.a
packagefile sync=$WORK/b019/_pkg_.a
packagefile unicode=$WORK/b022/_pkg_.a
packagefile unicode/utf8=$WORK/b018/_pkg_.a
EOF
/Users/moriya/goroot/pkg/tool/darwin_amd64/compile -o $WORK/b014/_pkg_.a -trimpath "$WORK/b014=>" -p reflect -std -buildid ptLsoD_k2xGhmpNUeeQq/ptLsoD_k2xGhmpNUeeQq -goversion go1.15.6 -symabis $WORK/b014/symabis -D "" -importcfg $WORK/b014/importcfg -pack -asmhdr $WORK/b014/go_asm.h -c=4 ./deepequal.go ./makefunc.go ./swapper.go ./type.go ./value.go
cd /Users/moriya/goroot/src/syscall
/Users/moriya/goroot/pkg/tool/darwin_amd64/asm -p syscall -trimpath "$WORK/b029=>" -I $WORK/b029/ -I /Users/moriya/goroot/pkg/include -D GOOS_linux -D GOARCH_arm64 -o $WORK/b029/asm_linux_arm64.o ./asm_linux_arm64.s
/Users/moriya/goroot/pkg/tool/darwin_amd64/pack r $WORK/b029/_pkg_.a $WORK/b029/asm_linux_arm64.o # internal
/Users/moriya/goroot/pkg/tool/darwin_amd64/buildid -w $WORK/b029/_pkg_.a # internal
cp $WORK/b029/_pkg_.a /Users/moriya/Library/Caches/go-build/e5/e5876040db16eba14c804859d2070f0a85359d1b0aeda81f0439f65e63406844-d # internal
mkdir -p $WORK/b031/
mkdir -p $WORK/b028/
cat >$WORK/b031/importcfg << 'EOF' # internal
# import config
packagefile syscall=$WORK/b029/_pkg_.a
EOF
cd /Users/moriya/goroot/src/internal/syscall/execenv
/Users/moriya/goroot/pkg/tool/darwin_amd64/compile -o $WORK/b031/_pkg_.a -trimpath "$WORK/b031=>" -p internal/syscall/execenv -std -complete -buildid 7EiKQ2uNeAsTbCVoSsiV/7EiKQ2uNeAsTbCVoSsiV -goversion go1.15.6 -D "" -importcfg $WORK/b031/importcfg -pack -c=4 ./execenv_default.go
mkdir -p $WORK/b030/
cat >$WORK/b028/importcfg << 'EOF' # internal
# import config
packagefile sync/atomic=$WORK/b021/_pkg_.a
packagefile syscall=$WORK/b029/_pkg_.a
EOF
cd /Users/moriya/goroot/src/internal/syscall/unix
/Users/moriya/goroot/pkg/tool/darwin_amd64/compile -o $WORK/b028/_pkg_.a -trimpath "$WORK/b028=>" -p internal/syscall/unix -std -complete -buildid U1YmFQkPFDiCvfjZxlKE/U1YmFQkPFDiCvfjZxlKE -goversion go1.15.6 -D "" -importcfg $WORK/b028/importcfg -pack -c=4 ./at.go ./at_sysnum_fstatat_linux.go ./at_sysnum_linux.go ./copy_file_range_linux.go ./getrandom_linux.go ./nonblocking.go ./sysnum_linux_generic.go
cat >$WORK/b030/importcfg << 'EOF' # internal
# import config
packagefile errors=$WORK/b003/_pkg_.a
packagefile runtime=$WORK/b007/_pkg_.a
packagefile sync=$WORK/b019/_pkg_.a
packagefile syscall=$WORK/b029/_pkg_.a
EOF
cd /Users/moriya/goroot/src/time
/Users/moriya/goroot/pkg/tool/darwin_amd64/compile -o $WORK/b030/_pkg_.a -trimpath "$WORK/b030=>" -p time -std -buildid I_tXRMBPA7fHZpJXAIFk/I_tXRMBPA7fHZpJXAIFk -goversion go1.15.6 -D "" -importcfg $WORK/b030/importcfg -pack -c=4 ./format.go ./sleep.go ./sys_unix.go ./tick.go ./time.go ./zoneinfo.go ./zoneinfo_read.go ./zoneinfo_unix.go
/Users/moriya/goroot/pkg/tool/darwin_amd64/buildid -w $WORK/b031/_pkg_.a # internal
cp $WORK/b031/_pkg_.a /Users/moriya/Library/Caches/go-build/04/04fce9036f4db12e4c04bd936cb2100cb06a654a7f53c8f65f97c41607b7f8aa-d # internal
/Users/moriya/goroot/pkg/tool/darwin_amd64/buildid -w $WORK/b028/_pkg_.a # internal
cp $WORK/b028/_pkg_.a /Users/moriya/Library/Caches/go-build/af/af364985a8b6f878a4dc7d8243f7ffe078080d9b6d5f7cf36c689828b7d2268a-d # internal
/Users/moriya/goroot/pkg/tool/darwin_amd64/buildid -w $WORK/b030/_pkg_.a # internal
cd /Users/moriya/goroot/src/reflect
/Users/moriya/goroot/pkg/tool/darwin_amd64/asm -p reflect -trimpath "$WORK/b014=>" -I $WORK/b014/ -I /Users/moriya/goroot/pkg/include -D GOOS_linux -D GOARCH_arm64 -o $WORK/b014/asm_arm64.o ./asm_arm64.s
cp $WORK/b030/_pkg_.a /Users/moriya/Library/Caches/go-build/80/80af787132ec1a1cb7fec637e6f213f9d3adbaeb599d0c2207f01ba6c6351f6b-d # internal
mkdir -p $WORK/b027/
cat >$WORK/b027/importcfg << 'EOF' # internal
# import config
packagefile errors=$WORK/b003/_pkg_.a
packagefile internal/syscall/unix=$WORK/b028/_pkg_.a
packagefile io=$WORK/b024/_pkg_.a
packagefile sync=$WORK/b019/_pkg_.a
packagefile sync/atomic=$WORK/b021/_pkg_.a
packagefile syscall=$WORK/b029/_pkg_.a
packagefile time=$WORK/b030/_pkg_.a
EOF
cd /Users/moriya/goroot/src/internal/poll
/Users/moriya/goroot/pkg/tool/darwin_amd64/compile -o $WORK/b027/_pkg_.a -trimpath "$WORK/b027=>" -p internal/poll -std -buildid jEEoDG4AVr7cDgZXhG3V/jEEoDG4AVr7cDgZXhG3V -goversion go1.15.6 -D "" -importcfg $WORK/b027/importcfg -pack -c=4 ./copy_file_range_linux.go ./errno_unix.go ./fcntl_syscall.go ./fd.go ./fd_fsync_posix.go ./fd_mutex.go ./fd_poll_runtime.go ./fd_posix.go ./fd_unix.go ./fd_writev_unix.go ./hook_cloexec.go ./hook_unix.go ./sendfile_linux.go ./sock_cloexec.go ./sockopt.go ./sockopt_linux.go ./sockopt_unix.go ./sockoptip.go ./splice_linux.go ./writev.go
cd /Users/moriya/goroot/src/reflect
/Users/moriya/goroot/pkg/tool/darwin_amd64/pack r $WORK/b014/_pkg_.a $WORK/b014/asm_arm64.o # internal
/Users/moriya/goroot/pkg/tool/darwin_amd64/buildid -w $WORK/b014/_pkg_.a # internal
cp $WORK/b014/_pkg_.a /Users/moriya/Library/Caches/go-build/93/93d1abf51d49c598815e0e87567609a135358c4f95498c3a8e0bd66340e95c5c-d # internal
mkdir -p $WORK/b013/
cat >$WORK/b013/importcfg << 'EOF' # internal
# import config
packagefile reflect=$WORK/b014/_pkg_.a
packagefile sort=$WORK/b023/_pkg_.a
EOF
cd /Users/moriya/goroot/src/internal/fmtsort
/Users/moriya/goroot/pkg/tool/darwin_amd64/compile -o $WORK/b013/_pkg_.a -trimpath "$WORK/b013=>" -p internal/fmtsort -std -complete -buildid VnMDT6JOpjOdYl-54bqw/VnMDT6JOpjOdYl-54bqw -goversion go1.15.6 -D "" -importcfg $WORK/b013/importcfg -pack -c=4 ./sort.go
/Users/moriya/goroot/pkg/tool/darwin_amd64/buildid -w $WORK/b027/_pkg_.a # internal
/Users/moriya/goroot/pkg/tool/darwin_amd64/buildid -w $WORK/b013/_pkg_.a # internal
cp $WORK/b013/_pkg_.a /Users/moriya/Library/Caches/go-build/5b/5bb555af605f2f456969f69c12fd3a028c327442a0077604d2a699b22a6ab5a0-d # internal
cp $WORK/b027/_pkg_.a /Users/moriya/Library/Caches/go-build/24/24fb15a4357f69730e2db23edbefec8adc8a0d04d46a4467b429333f47105b6a-d # internal
mkdir -p $WORK/b025/
cat >$WORK/b025/importcfg << 'EOF' # internal
# import config
packagefile errors=$WORK/b003/_pkg_.a
packagefile internal/oserror=$WORK/b026/_pkg_.a
packagefile internal/poll=$WORK/b027/_pkg_.a
packagefile internal/syscall/execenv=$WORK/b031/_pkg_.a
packagefile internal/syscall/unix=$WORK/b028/_pkg_.a
packagefile internal/testlog=$WORK/b032/_pkg_.a
packagefile io=$WORK/b024/_pkg_.a
packagefile runtime=$WORK/b007/_pkg_.a
packagefile sync=$WORK/b019/_pkg_.a
packagefile sync/atomic=$WORK/b021/_pkg_.a
packagefile syscall=$WORK/b029/_pkg_.a
packagefile time=$WORK/b030/_pkg_.a
EOF
cd /Users/moriya/goroot/src/os
/Users/moriya/goroot/pkg/tool/darwin_amd64/compile -o $WORK/b025/_pkg_.a -trimpath "$WORK/b025=>" -p os -std -buildid T6nhYUiRRhz01R2UphKm/T6nhYUiRRhz01R2UphKm -goversion go1.15.6 -D "" -importcfg $WORK/b025/importcfg -pack -c=4 ./dir.go ./dir_unix.go ./env.go ./error.go ./error_errno.go ./error_posix.go ./exec.go ./exec_posix.go ./exec_unix.go ./executable.go ./executable_procfs.go ./file.go ./file_posix.go ./file_unix.go ./getwd.go ./path.go ./path_unix.go ./pipe_linux.go ./proc.go ./rawconn.go ./readfrom_linux.go ./removeall_at.go ./stat.go ./stat_linux.go ./stat_unix.go ./sticky_notbsd.go ./str.go ./sys.go ./sys_linux.go ./sys_unix.go ./types.go ./types_unix.go ./wait_waitid.go
/Users/moriya/goroot/pkg/tool/darwin_amd64/buildid -w $WORK/b025/_pkg_.a # internal
cp $WORK/b025/_pkg_.a /Users/moriya/Library/Caches/go-build/92/92d404a17ee8ebe7d32810dcb1f46d7a3748e6e9de91351709628cec47615801-d # internal
mkdir -p $WORK/b002/
cat >$WORK/b002/importcfg << 'EOF' # internal
# import config
packagefile errors=$WORK/b003/_pkg_.a
packagefile internal/fmtsort=$WORK/b013/_pkg_.a
packagefile io=$WORK/b024/_pkg_.a
packagefile math=$WORK/b015/_pkg_.a
packagefile os=$WORK/b025/_pkg_.a
packagefile reflect=$WORK/b014/_pkg_.a
packagefile strconv=$WORK/b017/_pkg_.a
packagefile sync=$WORK/b019/_pkg_.a
packagefile unicode/utf8=$WORK/b018/_pkg_.a
EOF
cd /Users/moriya/goroot/src/fmt
/Users/moriya/goroot/pkg/tool/darwin_amd64/compile -o $WORK/b002/_pkg_.a -trimpath "$WORK/b002=>" -p fmt -std -complete -buildid 9A3e6VpSecZNTUOMyWbU/9A3e6VpSecZNTUOMyWbU -goversion go1.15.6 -D "" -importcfg $WORK/b002/importcfg -pack -c=4 ./doc.go ./errors.go ./format.go ./print.go ./scan.go
/Users/moriya/goroot/pkg/tool/darwin_amd64/buildid -w $WORK/b002/_pkg_.a # internal
cp $WORK/b002/_pkg_.a /Users/moriya/Library/Caches/go-build/42/4205cb643a5bb1840f3bc1477bceb1335aa9dc86fcedf38ae4f7a51bf28d51a3-d # internal
mkdir -p $WORK/b001/
cat >$WORK/b001/importcfg << 'EOF' # internal
# import config
packagefile fmt=$WORK/b002/_pkg_.a
packagefile runtime=$WORK/b007/_pkg_.a
EOF
cd /Users/moriya/goprog/hello
/Users/moriya/goroot/pkg/tool/darwin_amd64/compile -o $WORK/b001/_pkg_.a -trimpath "$WORK/b001=>" -p main -complete -buildid cZJv4pZXApe92CmEh9GL/cZJv4pZXApe92CmEh9GL -goversion go1.15.6 -D _/Users/moriya/goprog/hello -importcfg $WORK/b001/importcfg -pack -c=4 ./hello.go
/Users/moriya/goroot/pkg/tool/darwin_amd64/buildid -w $WORK/b001/_pkg_.a # internal
cp $WORK/b001/_pkg_.a /Users/moriya/Library/Caches/go-build/06/06fc7a052982d5f910cc6ac55c74c2d15bc1e84872ef877edb018aae9af51ac3-d # internal
cat >$WORK/b001/importcfg.link << 'EOF' # internal
packagefile _/Users/moriya/goprog/hello=$WORK/b001/_pkg_.a
packagefile fmt=$WORK/b002/_pkg_.a
packagefile runtime=$WORK/b007/_pkg_.a
packagefile errors=$WORK/b003/_pkg_.a
packagefile internal/fmtsort=$WORK/b013/_pkg_.a
packagefile io=$WORK/b024/_pkg_.a
packagefile math=$WORK/b015/_pkg_.a
packagefile os=$WORK/b025/_pkg_.a
packagefile reflect=$WORK/b014/_pkg_.a
packagefile strconv=$WORK/b017/_pkg_.a
packagefile sync=$WORK/b019/_pkg_.a
packagefile unicode/utf8=$WORK/b018/_pkg_.a
packagefile internal/bytealg=$WORK/b008/_pkg_.a
packagefile internal/cpu=$WORK/b009/_pkg_.a
packagefile runtime/internal/atomic=$WORK/b010/_pkg_.a
packagefile runtime/internal/math=$WORK/b011/_pkg_.a
packagefile runtime/internal/sys=$WORK/b012/_pkg_.a
packagefile internal/reflectlite=$WORK/b004/_pkg_.a
packagefile sort=$WORK/b023/_pkg_.a
packagefile math/bits=$WORK/b016/_pkg_.a
packagefile internal/oserror=$WORK/b026/_pkg_.a
packagefile internal/poll=$WORK/b027/_pkg_.a
packagefile internal/syscall/execenv=$WORK/b031/_pkg_.a
packagefile internal/syscall/unix=$WORK/b028/_pkg_.a
packagefile internal/testlog=$WORK/b032/_pkg_.a
packagefile sync/atomic=$WORK/b021/_pkg_.a
packagefile syscall=$WORK/b029/_pkg_.a
packagefile time=$WORK/b030/_pkg_.a
packagefile internal/unsafeheader=$WORK/b005/_pkg_.a
packagefile unicode=$WORK/b022/_pkg_.a
packagefile internal/race=$WORK/b020/_pkg_.a
EOF
mkdir -p $WORK/b001/exe/
cd .
/Users/moriya/goroot/pkg/tool/darwin_amd64/link -o $WORK/b001/exe/a.out -importcfg $WORK/b001/importcfg.link -buildmode=exe -buildid=N531VpQ2xBCwSvppZXoV/cZJv4pZXApe92CmEh9GL/DY-jED8bGjUgc7MfoOaU/N531VpQ2xBCwSvppZXoV -extld=clang $WORK/b001/_pkg_.a
/Users/moriya/goroot/pkg/tool/darwin_amd64/buildid -w $WORK/b001/exe/a.out # internal
mv $WORK/b001/exe/a.out hello
rm -r $WORK/b001/

使い方が合っているかどうか怪しいが、objdump –all-headers hello の結果

hello:  file format ELF64-aarch64-little

architecture: aarch64
start address: 0x000000000006c260
:

実行アドレスは、6c260 になっている。

(intel mac の環境で何故逆アセンブルできるか知らないが) objdump –disassemble-all hello

_rt0_arm64_linux:
   6c260: e0 03 40 f9                   ldr     x0, [sp]
   6c264: e1 23 00 91                   add     x1, sp, #8
   6c268: 02 00 00 94                   bl      #8 <main>
   6c26c: 00 00 00 00                   udf     #0

000000000006c270 main:
   6c270: e2 ff ff b0                   adrp    x2, #-12288
   6c274: 42 80 0c 91                   add     x2, x2, #800
   6c278: 40 00 3f d6                   blr     x2
   6c27c: 00 00 80 d2                   mov     x0, #0
   6c280: c8 0b 80 d2                   mov     x8, #94
   6c284: 01 00 00 d4                   svc     #0
   6c288: fd ff ff 17                   b       #-12 <main+0xc>
   6c28c: 00 00 00 00                   udf     #0

どうやら、rt0_arm64_linux がエントリーポイントのようだ。

rt0_arm64_linux 自体は、src/runtime/rt0_linux_arm64.s にある。

しかし、このシンボルが実行開始番地である、というのは、どこで指定されているのだろうか?

コードの配置や、実行開始番地を決めるのは、リンカーの仕事だから、もしや、ベタ書きされているのだろうか?

moriya@MacBook-Pro link % pwd                   
/Users/moriya/goroot/src/cmd/link
moriya@MacBook-Pro link % grep -R rt0 .
./internal/ld/lib.go:                   *flagEntrySymbol = fmt.Sprintf("_rt0_%s_%s_lib", objabi.GOARCH, objabi.GOOS)
./internal/ld/lib.go:                   *flagEntrySymbol = fmt.Sprintf("_rt0_%s_%s", objabi.GOARCH, objabi.GOOS)
./internal/ld/lib.go:           argv = append(argv, "/lib/crt0_64.o")
./internal/ld/lib.go:   import0 := f.Offset()
./internal/ld/lib.go:   f.MustSeek(import0, 0)
./internal/ld/lib.go:   ldpkg(ctxt, f, lib, import1-import0-2, pn) // -2 for !\n
./internal/ld/xcoff.go:         // Change rt0_go name to match name in runtime/cgo:main().
./internal/ld/xcoff.go:         rt0 := ldr.Lookup("runtime.rt0_go", 0)
./internal/ld/xcoff.go:         ldr.SetSymExtname(rt0, "runtime_rt0_go")
./internal/wasm/asm.go: "_rt0_wasm_js":           {Params: []byte{}},                                         //

何も指定しなければ、実行ファイルをビルドすると、_rt0_GOARCH_GOOS になるようだ。

moriya@MacBook-Pro ~ % go tool link  
usage: link [options] main.o
  -B note
      add an ELF NT_GNU_BUILD_ID note when using ELF
  -E entry
      set entry symbol name
         :

なので、-E で指定してやればスタートアップルーチンの名前は変えられるのかもしれない。