[PATCH v4 1/5] Arm tests: relax some matching patterns
Matthieu Longo
matthieu.longo@arm.com
Wed Jun 11 10:19:33 GMT 2025
On 2025-06-09 16:53, Richard Earnshaw (lists) wrote:
> On 22/05/2025 15:35, Matthieu Longo wrote:
>> Linker scripts can change the sections order in the output. Some matching
>> patterns in tests try to detect the end of a section by detecting the
>> beginning of the next one. However, they mistakenly enforce the name of
>> the next section without any need. This caused the tests to break due to
>> minor changes to the linker scripts.
>>
>> This patch relaxes some matching patterns in those tests to allow some
>> flexibility in the sections ordering, which is irrelevant to what is
>> tested.
>
> This would still fail if the .ARM.exidx section were to be the last section in the object file.
>
> A more robust solution would be to use
>
> #objdump: -s -j .ARM.exidx
>
> to dump only the relevant section contents, then we could drop both the next section tag and the subsequent "#..." as this should end the output.
>
> R.
>
I agree. Fixed in the next revision.
>> ---
>> ld/testsuite/ld-arm/unwind-1.d | 2 +-
>> ld/testsuite/ld-arm/unwind-2.d | 2 +-
>> ld/testsuite/ld-arm/unwind-3.d | 2 +-
>> ld/testsuite/ld-arm/unwind-4.d | 2 +-
>> 4 files changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/ld/testsuite/ld-arm/unwind-1.d b/ld/testsuite/ld-arm/unwind-1.d
>> index add5cb7cca0..4305189b477 100644
>> --- a/ld/testsuite/ld-arm/unwind-1.d
>> +++ b/ld/testsuite/ld-arm/unwind-1.d
>> @@ -6,5 +6,5 @@
>> #...
>> Contents of section .ARM.exidx:
>> 8008 (f8ffff7f b0b0a880 f4ffff7f 01000000|7ffffff8 80a8b0b0 7ffffff4 00000001) .*
>> -Contents of section .far:
>> +Contents of section .*
>> #...
>> diff --git a/ld/testsuite/ld-arm/unwind-2.d b/ld/testsuite/ld-arm/unwind-2.d
>> index a096c9b6a99..8a63d3b7103 100644
>> --- a/ld/testsuite/ld-arm/unwind-2.d
>> +++ b/ld/testsuite/ld-arm/unwind-2.d
>> @@ -6,5 +6,5 @@
>> #...
>> Contents of section .ARM.exidx:
>> 8004 (fcffff7f b0b0a880 f8ffff7f 01000000|7ffffffc 80a8b0b0 7ffffff8 00000001) .*
>> -Contents of section .far:
>> +Contents of section .*
>> #...
>> diff --git a/ld/testsuite/ld-arm/unwind-3.d b/ld/testsuite/ld-arm/unwind-3.d
>> index 0b8e85e11cb..f42d5d30183 100644
>> --- a/ld/testsuite/ld-arm/unwind-3.d
>> +++ b/ld/testsuite/ld-arm/unwind-3.d
>> @@ -7,5 +7,5 @@
>> Contents of section .ARM.exidx:
>> 800c (f4ffff7f b0b0a880 f0ffff7f 01000000|7ffffff4 80a8b0b0 7ffffff0 00000001) .*
>> 801c (ecffff7f b0b0a880 e8ffff7f 01000000|7fffffec 80a8b0b0 7fffffe8 00000001) .*
>> -Contents of section .far:
>> +Contents of section .*
>> #...
>> diff --git a/ld/testsuite/ld-arm/unwind-4.d b/ld/testsuite/ld-arm/unwind-4.d
>> index ffc87253ad4..ea541ea1700 100644
>> --- a/ld/testsuite/ld-arm/unwind-4.d
>> +++ b/ld/testsuite/ld-arm/unwind-4.d
>> @@ -23,5 +23,5 @@ Contents of section .text:
>> Contents of section .ARM.exidx:
>> 8020 (e0ffff7f b0b0a880 dcffff7f e8ffff7f|7fffffe0 80a8b0b0 7fffffdc 7fffffe8) .*
>> 8030 (d8ffff7f b0b0a880 d8ffff7f 01000000|7fffffd8 80a8b0b0 7fffffd8 00000001) .*
>> -Contents of section .far:
>> +Contents of section .*
>> #...
>
More information about the Binutils
mailing list