golang/go

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

Open

#42.238 geöffnet am 27. Okt. 2020

Auf GitHub ansehen
 (5 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Go (19.008 Forks)batch import
NeedsInvestigationcompiler/runtimehelp wanted

Repository-Metriken

Stars
 (133.883 Stars)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

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.

Contributor Guide