Strange symbol size in symtab

49 views
Skip to first unread message

Nikolay Dubina

unread,
Mar 10, 2022, 8:00:38 AM3/10/22
to golang-nuts
Hello,

I am getting strange byte sizes for Undefined symbols in symtabs.

How to reproduce:
1. build and go binary (e.g. https://github.com/gohugoio/hugo)
2. make symbtab file (go tool nm -size <binary finename>)

In file you will see entries like this
```
         4294971392 U _symlink
         4294971392 U _sysconf
         4294971392 U _sysctl
         4294971392 U _sysctlbyname
         4294971392 U _unlink
         4294971392 U _unlinkat
         4294971392 U _unsetenv
         4294971392 U _usleep
         4294971392 U _utimes
         4294971392 U _wait4
         4294971392 U _write
```

What is strange here:
- 4294971392 is number of bytes per documentation: https://pkg.go.dev/cmd/nm
- this is around 4GB
- binary of hugo is much smaller 62MB
- the size of symbol has to be different, but it is same for all these undefined symbols.

Would be nice if anyone seen this problem or tells me what is happening here.

I am also planning to dig dipper into go core, but would like to check with you guys first.

Thank you and hope everyone is doing well,

-- Nikolay
Reply all
Reply to author
Forward
0 new messages