From 6bd89b2a55eeafeb9095aea2262a80f012853f1c27e51898257be7d8aadc0b47 Mon Sep 17 00:00:00 2001 From: Olaf Hering Date: Mon, 13 Jun 2022 14:00:02 +0000 Subject: [PATCH 1/2] - fix objdump parsing (#52) OBS-URL: https://build.opensuse.org/package/show/openSUSE:Tools/build-compare?expand=0&rev=293 --- build-compare.changes | 7 ++++++- build-compare.spec | 2 +- pkg-diff.sh | 28 ++++++++++------------------ 3 files changed, 17 insertions(+), 20 deletions(-) diff --git a/build-compare.changes b/build-compare.changes index 6775c19..396d667 100644 --- a/build-compare.changes +++ b/build-compare.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Jun 13 13:13:13 UTC 2022 - olaf@aepfle.de + +- fix objdump parsing (#52) + ------------------------------------------------------------------- Fri Mar 4 12:34:56 UTC 2022 - olaf@aepfle.de @@ -216,7 +221,7 @@ Thu Jan 5 11:01:53 UTC 2017 - olaf@aepfle.de ------------------------------------------------------------------- Wed Dec 14 08:44:11 UTC 2016 - olaf@aepfle.de -- Remove warning about python mtime mismatch, a republish will not help +- Remove warning about python mtime mismatch, a republish will not help (bsc#915948) - Handle yet another variant of numbered anchor in html file ------------------------------------------------------------------- diff --git a/build-compare.spec b/build-compare.spec index 54fcbc5..3008db3 100644 --- a/build-compare.spec +++ b/build-compare.spec @@ -21,7 +21,7 @@ Summary: Build Result Compare Script License: GPL-2.0+ Group: Development/Tools/Building Url: https://github.com/openSUSE/build-compare -Version: 20220307T115648.b5abdde +Version: 20220613T135442.472ee09 Release: 0 Source1: COPYING Source2: same-build-result.sh diff --git a/pkg-diff.sh b/pkg-diff.sh index e208d0a..74f16fe 100644 --- a/pkg-diff.sh +++ b/pkg-diff.sh @@ -933,25 +933,17 @@ check_single_file() p } ')) - ($OBJDUMP -s ${sections[@]} old/$file | - sed -e "s,old/,," ; echo "${PIPESTATUS[@]}" > $file1 ) > old/$file.objdump & - ($OBJDUMP -s ${sections[@]} new/$file | - sed -e "s,new/,," ; echo "${PIPESTATUS[@]}" > $file2 ) > new/$file.objdump & + (cd old && exec $OBJDUMP -s ${sections[@]} ./$file ) > old/$file.objdump & + (cd new && exec $OBJDUMP -s ${sections[@]} ./$file ) > new/$file.objdump & wait - read i < ${file1} - pipestatus=( $i ) - objdump_failed="${pipestatus[0]}" - if [[ ${pipestatus[*]} =~ [1-9] ]] + if ! test -s old/$file.objdump then - wprint "ELF section: pipe command failed for old/$file" + wprint "ELF section: objdump failed for old/$file" elfdiff='failed' fi - read i < ${file2} - pipestatus=( $i ) - objdump_failed="${objdump_failed}${pipestatus[0]}" - if [[ ${pipestatus[*]} =~ [1-9] ]] + if ! test -s new/$file.objdump then - wprint "ELF section: pipe command failed for new/$file" + wprint "ELF section: objdump failed for new/$file" elfdiff='failed' fi if test -z "${elfdiff}" @@ -975,10 +967,10 @@ check_single_file() fi watchdog_touch elfdiff= - ($OBJDUMP -d --no-show-raw-insn old/$file | filter_disasm | - sed -e "s,^old/[^:]\+,," ; echo "${PIPESTATUS[@]}" > $file1 ) > old/$file.objdump & - ($OBJDUMP -d --no-show-raw-insn new/$file | filter_disasm | - sed -e "s,^new/[^:]\+,," ; echo "${PIPESTATUS[@]}" > $file2 ) > new/$file.objdump & + (cd old && exec $OBJDUMP -d --no-show-raw-insn ./$file | filter_disasm + echo "${PIPESTATUS[@]}" > $file1 ) > old/$file.objdump & + (cd new && exec $OBJDUMP -d --no-show-raw-insn ./$file | filter_disasm + echo "${PIPESTATUS[@]}" > $file2 ) > new/$file.objdump & wait read i < ${file1} pipestatus=( $i ) From 597e7f2fd4441e7041442520eafb55b6909ed5910258e4fd4d8a4bc4443ca5ca Mon Sep 17 00:00:00 2001 From: Olaf Hering Date: Mon, 20 Jun 2022 15:06:40 +0000 Subject: [PATCH 2/2] - fix objdump parsing for non-executable sections (#53) OBS-URL: https://build.opensuse.org/package/show/openSUSE:Tools/build-compare?expand=0&rev=294 --- build-compare.changes | 5 +++++ build-compare.spec | 2 +- pkg-diff.sh | 17 ++++++----------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/build-compare.changes b/build-compare.changes index 396d667..40f0e32 100644 --- a/build-compare.changes +++ b/build-compare.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Jun 20 12:34:56 UTC 2022 - olaf@aepfle.de + +- fix objdump parsing for non-executable sections (#53) + ------------------------------------------------------------------- Mon Jun 13 13:13:13 UTC 2022 - olaf@aepfle.de diff --git a/build-compare.spec b/build-compare.spec index 3008db3..92dc7b2 100644 --- a/build-compare.spec +++ b/build-compare.spec @@ -21,7 +21,7 @@ Summary: Build Result Compare Script License: GPL-2.0+ Group: Development/Tools/Building Url: https://github.com/openSUSE/build-compare -Version: 20220613T135442.472ee09 +Version: 20220620T150329.a852498 Release: 0 Source1: COPYING Source2: same-build-result.sh diff --git a/pkg-diff.sh b/pkg-diff.sh index 74f16fe..5b4a765 100644 --- a/pkg-diff.sh +++ b/pkg-diff.sh @@ -833,8 +833,7 @@ check_single_file() local ret=0 local i local failed - local objdump_failed - local elfdiff + local elfdiff elf_executable_sections local sections local -a pipestatus @@ -966,7 +965,6 @@ check_single_file() return 0 fi watchdog_touch - elfdiff= (cd old && exec $OBJDUMP -d --no-show-raw-insn ./$file | filter_disasm echo "${PIPESTATUS[@]}" > $file1 ) > old/$file.objdump & (cd new && exec $OBJDUMP -d --no-show-raw-insn ./$file | filter_disasm @@ -974,21 +972,19 @@ check_single_file() wait read i < ${file1} pipestatus=( $i ) - objdump_failed="${objdump_failed}${pipestatus[0]}" if [[ ${pipestatus[*]} =~ [1-9] ]] then wprint "ELF disassembly: pipe command failed for old/$file" - elfdiff='failed' + elf_executable_sections='failed' fi read i < ${file2} pipestatus=( $i ) - objdump_failed="${objdump_failed}${pipestatus[0]}" if [[ ${pipestatus[*]} =~ [1-9] ]] then wprint "ELF disassembly: pipe command failed for new/$file" - elfdiff='failed' + elf_executable_sections='failed' fi - if test ${objdump_failed} -gt 0 || test -n "${elfdiff}" + if test -n "${elf_executable_sections}" then # objdump had no idea how to handle it rm old/$file.objdump new/$file.objdump & @@ -997,7 +993,6 @@ check_single_file() fi return 1 fi - elfdiff= diff --speed-large-files --unified \ --label "old $file (disasm)" \ --label "new $file (disasm)" \ @@ -1008,11 +1003,11 @@ check_single_file() then wprint "$file differs in assembler output" $buildcompare_head $dfile - elfdiff='elfdiff' + elf_executable_sections='elf_executable_sections' else watchdog_touch fi - if test -n "$elfdiff" + if test -n "$elfdiff" || test -n "$elf_executable_sections" then return 1 fi