[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[committed] Add eu-strip/eu-unstrip test-cases



[ was: Re: [Bug default/24249] Section offsets not monotonically
increasing ]

On 22-02-19 14:40, mark at klomp dot org wrote:
> https://sourceware.org/bugzilla/show_bug.cgi?id=24249
> 
> Mark Wielaard <mark at klomp dot org> changed:
> 
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>                  CC|                            |mark at klomp dot org
> 
> --- Comment #11 from Mark Wielaard <mark at klomp dot org> ---
> (In reply to Tom de Vries from comment #10)
>> (In reply to Jakub Jelinek from comment #9)
>>> e.g. if we process *.debug files stripped into file
>>> by objcopy or eu-strip, won't this shdr reordering then break the matching
>>> between original binary and *.debug file?
>>
>> Indeed the ordering of entries in the section table in the original binary
>> and the .debug file will not be the same.
>>
>> I'm not aware though of a tool that relies on this ordering to be the same.
> 
> I think eu-unstrip does deal with differences in ordering, but you might want
> to test whether it still works correctly.
> 

I did not know eu-unstrip, thanks for letting me know.

Committed two test-cases using dwz in combination with eu-strip and
eu-unstrip.

Thanks,
- Tom
Add eu-strip/eu-unstrip test-cases

Add regular and multifile test-cases that:
- use eu-strip to split off the debuginfo into a seperate file,
- dwz the debuginfo, and
- merge the debuginfo back into the original file using eu-unstrip.

2019-03-08  Tom de Vries  <tdevries@suse.de>

	* testsuite/dwz.tests/eu-strip-unstrip-multifile.sh: New test.
	* testsuite/dwz.tests/eu-strip-unstrip.sh: New test.

---
 testsuite/dwz.tests/eu-strip-unstrip-multifile.sh | 26 +++++++++++++++++++++++
 testsuite/dwz.tests/eu-strip-unstrip.sh           | 19 +++++++++++++++++
 2 files changed, 45 insertions(+)

diff --git a/testsuite/dwz.tests/eu-strip-unstrip-multifile.sh b/testsuite/dwz.tests/eu-strip-unstrip-multifile.sh
new file mode 100755
index 0000000..a49666f
--- /dev/null
+++ b/testsuite/dwz.tests/eu-strip-unstrip-multifile.sh
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+set -e
+
+cp ../hello 1
+cp ../hello 2
+
+eu-strip 1 -o 1.stripped -f 1.debug
+eu-strip 2 -o 2.stripped -f 2.debug
+
+dwz -m 3 1.debug 2.debug
+
+eu-unstrip 1.stripped 1.debug -o 1.unstripped
+eu-unstrip 2.stripped 2.debug -o 2.unstripped
+
+smaller-than.sh 1.unstripped 1
+smaller-than.sh 2.unstripped 2
+
+[ $(gnu-debugaltlink-name.sh 1.unstripped) = "3" ]
+[ $(gnu-debugaltlink-name.sh 2.unstripped) = "3" ]
+
+ls=$(ls)
+ls=$(echo $ls)
+[ "$ls" = "1 1.debug 1.stripped 1.unstripped 2 2.debug 2.stripped 2.unstripped 3" ]
+
+rm -f 1 1.debug 1.stripped 1.unstripped 2 2.debug 2.stripped 2.unstripped 3
diff --git a/testsuite/dwz.tests/eu-strip-unstrip.sh b/testsuite/dwz.tests/eu-strip-unstrip.sh
new file mode 100755
index 0000000..9ecb3fe
--- /dev/null
+++ b/testsuite/dwz.tests/eu-strip-unstrip.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+set -e
+
+cp ../hello 1
+
+eu-strip 1 -o 1.stripped -f 1.debug
+
+dwz 1.debug
+
+eu-unstrip 1.stripped 1.debug -o 1.unstripped
+
+smaller-than.sh 1.unstripped 1
+
+ls=$(ls)
+ls=$(echo $ls)
+[ "$ls" = "1 1.debug 1.stripped 1.unstripped" ]
+
+rm -f 1 1.debugged 1.stripped 1.unstripped