[gdb/testsuite] Fix compare-sections.exp with -fPIE/-pie
authorTom de Vries <tdevries@suse.de>
Fri, 16 Aug 2019 21:48:28 +0000 (23:48 +0200)
committerTom de Vries <tdevries@suse.de>
Fri, 16 Aug 2019 21:48:28 +0000 (23:48 +0200)
commit34dafe9f39e61de970c36ed636daa58e1caa386c
tree80d6af5acdb943692cfc34bc98c10eb3618d0492
parent81e8046dc0daaf56fb10b11931fc77600a4b5920
[gdb/testsuite] Fix compare-sections.exp with -fPIE/-pie

When running gdb.base/compare-sections.exp with target board -fPIE/-pie, we
get:
...
FAIL: gdb.base/compare-sections.exp: after run to main: compare-sections -r
...

The test expects the read-only sections to have the same contents as in the
file:
...
    # Assume startup code doesn't change read-only sections.
    compare_sections "-r"
...
but that's not the case for PIE executables.

Fix this by allowing mismatched read-only sections for PIE executables.

Tested on x86_64-linux.

gdb/testsuite/ChangeLog:

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

* gdb.base/compare-sections.exp ("after run to main"): Allow
mismatched read-only sections for PIE executables.
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/compare-sections.exp