teh-cmc / go-internals

A book about the internals of the Go programming language.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

chapter2: about symbol addr and size

cch123 opened this issue · comments

We can also use nm in binutils to dump symbol information

nm  --print-size ./iface |grep "go.itab.main.Adder,main.Mather"
00000000004767a0 0000000000000028 R go.itab.main.Adder,main.Mather

Though no difference ...

For sure, there are plenty of available options for finding out the VMA of a given symbol; the actual tricky part here is to compute the real offset within the binary so we can dump the associated contents.