[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.