upx

centos8:golang build 独立打包 + 缩小编译后体积

冷暖自知 提交于 2020-02-25 21:21:17
golang编译后的文件通常较大,依赖文件也众多,为了简化分发,决定:1、将编译成独立一体的可执行文件,2、减少体积。 测试用例,reader.go(内容不重要,甚至包括了cgo) go build reader.go ldd reader 发现有不少依赖包,在整体打包前,还需要确认是否安装了glibc-static,否则会出错 # dnf --enablerepo=PowerTools install glibc-static # go build -ldflags '-linkmode "external" -extldflags "-static" -w -s' reader.go # upx -9 reader 设置编译参数-ldflags '-linkmode "external" -extldflags "-static"‘,实现整体打包; 设置编译参数-ldflags "-w -s"。其中-w为去掉调试信息(无法使用gdb调试),-s为去掉符号表,可有效减少编译后体积(一般能缩小30+%); upx -9,直接将3MB多的文件压倒800KB。(upx需要独立安装, https://github.com/upx/upx/releases ) 来源: oschina 链接: https://my.oschina.net/faramita/blog/3163856

Are there any downsides to using UPX to compress a Windows executable?

耗尽温柔 提交于 2019-12-28 03:39:05
问题 I've used UPX before to reduce the size of my Windows executables, but I must admit that I am naive to any negative side effects this could have. What's the downside to all of this packing/unpacking? Are there scenarios in which anyone would recommend NOT UPX-ing an executable (e.g. when writing a DLL, Windows Service, or when targeting Vista or Win7)? I write most of my code in Delphi, but I've used UPX to compress C/C++ executables as well. On a side note, I'm not running UPX in some

Method to determine if an exe file has been compressed with UPX

ε祈祈猫儿з 提交于 2019-12-01 05:04:17
Is there a method to determine if an exe file has been compressed with UPX? The function to determine if an exe file has been compressed is excellent except I found a problem with the code. If the function IsUPXCompressed is called then you try to run upx, upx can not save the file it modifies. There is something not sharing rights correctly in the function. I have tested this for several hours. If I do not call the method then UPX can write the files with no problem. You you call it then try to run UPX it will not save the file. UPX reports an IOException Permission denied error when trying

Method to determine if an exe file has been compressed with UPX

断了今生、忘了曾经 提交于 2019-12-01 02:17:55
问题 Is there a method to determine if an exe file has been compressed with UPX? The function to determine if an exe file has been compressed is excellent except I found a problem with the code. If the function IsUPXCompressed is called then you try to run upx, upx can not save the file it modifies. There is something not sharing rights correctly in the function. I have tested this for several hours. If I do not call the method then UPX can write the files with no problem. You you call it then try

upx

梦想的初衷 提交于 2019-11-29 01:36:13
D:\tools\upx-3.95-win64\upx.exe --android-shlib libKTIDCard.so 来源: https://my.oschina.net/u/1177171/blog/3100100

Are there any downsides to using UPX to compress a Windows executable?

自古美人都是妖i 提交于 2019-11-27 11:54:24
I've used UPX before to reduce the size of my Windows executables, but I must admit that I am naive to any negative side effects this could have. What's the downside to all of this packing/unpacking? Are there scenarios in which anyone would recommend NOT UPX-ing an executable (e.g. when writing a DLL, Windows Service, or when targeting Vista or Win7)? I write most of my code in Delphi, but I've used UPX to compress C/C++ executables as well. On a side note, I'm not running UPX in some attempt to protect my exe from disassemblers, only to reduce the size of the executable and prevent cursory