网址导航网站有哪些,图片街景位置识别,做网站用的幻灯片大小,太原网站建设需求多嘛rpmbuild 将二进制文件 strip#xff0c;文件 md5 发生改变 上一篇中提到 strip 相关的操作#xff0c;会去掉文件中的调试信息【strip 、objdump、objcopy 差异与区别】 在编译或打包环境中#xff0c;莫名其妙的文件 大小 md5 都发生了改变#xff0c;怀疑跟 rpmbuild 打…rpmbuild 将二进制文件 strip文件 md5 发生改变 上一篇中提到 strip 相关的操作会去掉文件中的调试信息【strip 、objdump、objcopy 差异与区别】 在编译或打包环境中莫名其妙的文件 大小 md5 都发生了改变怀疑跟 rpmbuild 打包有关
用 file 命令原文件与打包后解压文件对比下
源文件
ice-x86.ko.xz: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), BuildID[sha1]ca1f40033e8b3ce779deb4604897f67aea62f459, with debug_info, not stripped打包后文件
ice.ko.xz: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), BuildID[sha1]ca1f40033e8b3ce779deb4604897f67aea62f459, not stripped发现丢失了 debug_info这是因为 rpmbuild 打包时一般会把 debug 信息提取出来然后单独放入到一个 xxx.debuginfo.rpm看一下当前环境中宏定义
# rpm --showrc |grep strip
-13: __brp_strip /usr/lib/rpm/brp-strip %{__strip}
-13: __brp_strip_comment_note /usr/lib/rpm/brp-strip-comment-note %{__strip} %{__objdump}
-13: __brp_strip_static_archive /usr/lib/rpm/brp-strip-static-archive %{__strip}%{?__brp_strip} %{?__brp_strip_comment_note} %{?__brp_strip_static_archive}
-13: __strip /usr/bin/strippip%{python2_version} install -I dist/%{1} --root %{buildroot} --strip-file-prefix %{buildroot} --no-depspip install -I dist/%{1} --root %{buildroot} --strip-file-prefix %{buildroot} --no-deps看下 __brp_strip 宏内容
# cat /usr/lib/rpm/brp-strip
#!/bin/sh
# If using normal root, avoid changing anything.
if [ -z $RPM_BUILD_ROOT ] || [ $RPM_BUILD_ROOT / ]; thenexit 0
fiSTRIP${1:-strip}
NCPUS${RPM_BUILD_NCPUS:-1}case uname -a in
Darwin*) exit 0 ;;
*) ;;
esac# Strip ELF binaries
find $RPM_BUILD_ROOT -type f \! -regex ${RPM_BUILD_ROOT}/*usr/lib/debug.* \! -name *.ko -print0 | \xargs -0 -r -P$NCPUS -n32 sh -c file \\$\ | sed -n -e s/^\(.*\):[ ]*ELF.*, not stripped.*/\1/p | xargs -I\{\} $STRIP -g \{\} ARG0
$STRIP -g 说明去除了二进制文件的调试信息 ${1:-strip}是给 STRIP 进行赋值代表 $1 参数是否存在如果不存在则使用 :- 后面的 strip