cmd/link: c-shared build mode not working with UPX #42238
Labels
compiler/runtime
Issues related to the Go compiler and/or runtime.
help wanted
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I wrote a simple Golang file. is as follows:
Then build it :
go build -buildmode=c-shared -o library.so main.go
After library.so created I want to compress it with UPX
run
upx -9 library.so
and got errorWhat did you expect to see?
92200 -> 49976 54.20% linux/amd64 library.so
What did you see instead?
upx: library.so: CantPackException: PT_NOTE 0xa71cc above stub
I opened a issue in GitHub UPX. They told me the problem the library.so does not have the correct format to allow compression.
This problem only when use -buildmode=c-shared in command-line.
Thanks.
The text was updated successfully, but these errors were encountered: