On Wed, Aug 12, 2020 at 8:43 AM ethan.pailes via golang-nuts
<golang-nuts@googlegroups.com> wrote:
>
> The C ecosystem allows one to generate a separate file containing debug info 
> so that you can initially install a stripped library or binary and then only 
> pull in the debug info as needed. I'm interested in doing the same for go, 
> but I have not been able to find an equivalent to the -gsplit-dwarf compiler 
> flag. I've tried using `objcopy --only-keep-debug` to generate a .debug file, 
> but it didn't seem to take.
>
> Has anyone else gone down this road? I would also be glad to hear that this 
> is just known not to be possible at this point so that I can stop digging.
>
> For a little context as to why I want to do this, we are using go on embedded 
> devices and we would like to keep our payload size down for OTA updates so we 
> would rather avoid shipping debug info that will only be used rarely.

I would expect the objcopy approach to work.

go build x
objcopy --only-keep-debug x x.debug
objcopy --strip-debug --add-gnu-debuglink=x.debug x x.stripped

Where does that go wrong?

Ian

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAOyqgcU-_Jw_Zk%2BWksxNB9T2t02hTzNQuURwSzuxi97TLknLPw%40mail.gmail.com.

Reply via email to