ctf_dump_objts output string

Nick Alcock nick.alcock@oracle.com
Tue Feb 3 16:23:36 GMT 2026
On 30 Jan 2026, Alan Modra uttered the following:

> "Section is indexed" and "No symbol table" are generated at the
> beginning of ctf_dump_objts but not output, resulting in an asan
> complaint about leaked memory.  Clearly the messages should either not
> be generated, or they should be output.
>
> I chose to do the latter in this patch.  I'll happily jump the other
> way if you'd prefer, Nick.

Oh dear, that's stupid.

(Given the number of memory-leak tests I'm running, how on earth has
this never come to light?! It's really blatant now you point it out.)

> diff --git a/ld/testsuite/ld-ctf/data-func-conflicted-vars.d b/ld/testsuite/ld-ctf/data-func-conflicted-vars.d
> index 4e570c6a61a..e2bd077cf9e 100644
> --- a/ld/testsuite/ld-ctf/data-func-conflicted-vars.d
> +++ b/ld/testsuite/ld-ctf/data-func-conflicted-vars.d
> @@ -22,6 +22,7 @@ Contents of CTF section \.ctf:
>      String section:	.*
>  #...
>    Data objects:
> +    Section is indexed.
>      bar -> 0x[0-9a-f]*: \(kind 6\) struct var_3 \(size 0x[0-9a-f]*\) \(aligned at 0x[0-9a-f]*\)
>      var_1 -> 0x[0-9a-f]*: \(kind 10\) foo_t \(size 0x[0-9a-f]*\) \(aligned at 0x[0-9a-f]*\) -> .*
>      var_666 -> 0x[0-9a-f]*: \(kind 3\) foo_t \* \(size 0x[0-9a-f]*\) \(aligned at 0x[0-9a-f]*\) -> .*

That doesn't really *look* very nice. Maybe we could indent it a bit:

>    Data objects:
>        (Section is indexed.)
>      bar -> 0x[0-9a-f]*: \(kind 6\) struct var_3 \(size 0x[0-9a-f]*\) \(aligned at 0x[0-9a-f]*\)

perhaps? (Putting the indexed stuff on the same line as the Data objects
is a bit hard.)

This has implications for a whole bunch of the testcases too, since many
of them look at objdump output and that needs adjusting.

I can take on shepherding this in and making those adjustments if you
like.

-- 
NULL && (void)


More information about the Binutils mailing list