golang/go

cmd/link: c-shared build mode not working with UPX

Open

#42.238 aperta il 27 ott 2020

Vedi su GitHub
 (5 commenti) (0 reazioni) (0 assegnatari)Go (19.008 fork)batch import
NeedsInvestigationcompiler/runtimehelp wanted

Metriche repository

Star
 (133.883 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

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)?

What did you do?

I wrote a simple Golang file. is as follows:

package main
func main() {
}

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 error

What 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.

Guida contributor