[PATCH v1 1/1] Arm tests: reduce objdump's output and improve some matching patterns
Richard Earnshaw
Richard.Earnshaw@arm.com
Wed Jun 11 13:15:59 GMT 2025
On 11/06/2025 13:23, 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 adds '-j <interesting-section>' to the arguments of objdump
> to dump only relevant information for the tests. This removed the issue
> related to the ordering of the sections. The matching patterns were also
> made stricter to match better the expected output.
OK,
R.
> ---
> ld/testsuite/ld-arm/unwind-1.d | 9 +++------
> ld/testsuite/ld-arm/unwind-2.d | 9 +++------
> ld/testsuite/ld-arm/unwind-3.d | 11 ++++-------
> ld/testsuite/ld-arm/unwind-4.d | 14 ++++----------
> 4 files changed, 14 insertions(+), 29 deletions(-)
>
> diff --git a/ld/testsuite/ld-arm/unwind-1.d b/ld/testsuite/ld-arm/unwind-1.d
> index add5cb7cca0..073d6a5b56e 100644
> --- a/ld/testsuite/ld-arm/unwind-1.d
> +++ b/ld/testsuite/ld-arm/unwind-1.d
> @@ -1,10 +1,7 @@
> #ld: -T arm.ld
> -#objdump: -s
> +#objdump: -s -j .ARM.exidx
>
> .*: file format.*
>
> -#...
> -Contents of section .ARM.exidx:
> - 8008 (f8ffff7f b0b0a880 f4ffff7f 01000000|7ffffff8 80a8b0b0 7ffffff4 00000001) .*
> -Contents of section .far:
> -#...
> +Contents of section \.ARM\.exidx:
> + 8008 (f8ffff7f b0b0a880 f4ffff7f 01000000|7ffffff8 80a8b0b0 7ffffff4 00000001) \.+
> diff --git a/ld/testsuite/ld-arm/unwind-2.d b/ld/testsuite/ld-arm/unwind-2.d
> index a096c9b6a99..c9cd433eca0 100644
> --- a/ld/testsuite/ld-arm/unwind-2.d
> +++ b/ld/testsuite/ld-arm/unwind-2.d
> @@ -1,10 +1,7 @@
> #ld: -T arm.ld
> -#objdump: -s
> +#objdump: -s -j .ARM.exidx
>
> .*: file format.*
>
> -#...
> -Contents of section .ARM.exidx:
> - 8004 (fcffff7f b0b0a880 f8ffff7f 01000000|7ffffffc 80a8b0b0 7ffffff8 00000001) .*
> -Contents of section .far:
> -#...
> +Contents of section \.ARM\.exidx:
> + 8004 (fcffff7f b0b0a880 f8ffff7f 01000000|7ffffffc 80a8b0b0 7ffffff8 00000001) \.+
> diff --git a/ld/testsuite/ld-arm/unwind-3.d b/ld/testsuite/ld-arm/unwind-3.d
> index 0b8e85e11cb..9da1484b727 100644
> --- a/ld/testsuite/ld-arm/unwind-3.d
> +++ b/ld/testsuite/ld-arm/unwind-3.d
> @@ -1,11 +1,8 @@
> #ld: -T arm.ld
> -#objdump: -s
> +#objdump: -s -j .ARM.exidx
>
> .*: file format.*
>
> -#...
> -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 \.ARM\.exidx:
> + 800c (f4ffff7f b0b0a880 f0ffff7f 01000000|7ffffff4 80a8b0b0 7ffffff0 00000001) \.+
> + 801c (ecffff7f b0b0a880 e8ffff7f 01000000|7fffffec 80a8b0b0 7fffffe8 00000001) \.+
> diff --git a/ld/testsuite/ld-arm/unwind-4.d b/ld/testsuite/ld-arm/unwind-4.d
> index ffc87253ad4..7b71de884c3 100644
> --- a/ld/testsuite/ld-arm/unwind-4.d
> +++ b/ld/testsuite/ld-arm/unwind-4.d
> @@ -1,9 +1,8 @@
> #ld: -q -T arm.ld
> -#objdump: -sr
> +#objdump: -sr -j .ARM.exidx
>
> .*: file format.*
>
> -#...
> RELOCATION RECORDS FOR \[\.ARM\.exidx\]:
> OFFSET +TYPE +VALUE
> 00000000 R_ARM_PREL31 \.text
> @@ -17,11 +16,6 @@ OFFSET +TYPE +VALUE
> 00000010 R_ARM_NONE __aeabi_unwind_cpp_pr0
> 00000018 R_ARM_PREL31 \.text
>
> -
> -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 \.ARM\.exidx:
> + 8020 (e0ffff7f b0b0a880 dcffff7f e8ffff7f|7fffffe0 80a8b0b0 7fffffdc 7fffffe8) \.+
> + 8030 (d8ffff7f b0b0a880 d8ffff7f 01000000|7fffffd8 80a8b0b0 7fffffd8 00000001) \.+
More information about the Binutils
mailing list