func ReadBuildIDFromBinary

Description

ReadBuildIDFromBinary reads the build ID from a binary.

ELF binaries store the build ID in a proper PT_NOTE section.

Other binary formats are not so flexible. For those, the linker
stores the build ID as non-instruction bytes at the very beginning
of the text segment, which should appear near the beginning
of the file. This is clumsy but fairly portable. Custom locations
can be added for other binary types as needed, like we did for ELF.