3 ms·
Where do all the symbols come from if the binary has been stripped? Does go add its own proprietary symbol table sections to go binaries?
by formerly_proven 3y ago
Where do all the symbols come from if the binary has been stripped? Does go add its own proprietary symbol table sections to go binaries?
- yencabulator 3y agoI don't see the author stripping any binaries. (And features of Go assume the binary is not stripped, too. The symbol table is useful!)
- formerly_proven 3y ago> Here is an application written with golang, decompiled with IDA 8.3 Pro, we can see that IDA not only restores all the function names, but also restores the business code with good readability. > And this program has used -ldflags "-s -w" to remove the debug information and symbol information when compiling, which shows that if no processing is done for the program written in golang, there will be no secrets at all. Though perhaps those flags were just not effective. Maybe Go places it's own stuff after the user-specified flags, or maybe they're only used in cgo mode? Edit: https://words.filippo.io/shrink-your-go-binaries-with-this-one-weird-trick/ https://words.filippo.io/shrink-your-go-binaries-with-this-o... It retains the symbols needed to format stack traces, so most symbols remain. So go-link's "-s" is rather different from how normal linkers interpret "-s" (don't link symbols or debug information, functionally equivalent to strip(1)).
- yencabulator 3y agoAh, I missed that searching for "strip".