From: Simon Marchi <simark@simark.ca>
To: Bratislav Filipovic <bfilipov@amd.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] gdb.dwarf2: Fix fission-dw-form-strx.exp workflow
Date: Thu, 23 Apr 2026 10:36:27 -0400 [thread overview]
Message-ID: <ff249a67-dbac-4783-8b27-7bedacd3f761@simark.ca> (raw)
In-Reply-To: <20260423103929.3137187-1-bfilipov@amd.com>
On 4/23/26 6:37 AM, Bratislav Filipovic wrote:
> The test was using gdb_compile_shlib to create the .dwo file, which
> runs the linker. This is incorrect for DWARF fission - .dwo files
> should be created by objcopy extraction, not linking.
>
> Per commit 6a29913eeb9, "it was a bad idea to generate a .dwo file
> using the linker, since the idea behind .dwo files is that they do
> not need to be linked."
>
> GCC's assembler doesn't set the SHF_EXCLUDE flag on .debug_*.dwo
> sections, so the linker preserves them in the output. Clang's
> assembler sets SHF_EXCLUDE, causing the linker to exclude these
> sections. Both approaches are valid, but only the GCC approach
> happens to work with this test's incorrect use of the linker.
>
> Rewrite the test to use build_executable_and_dwo_files with the
> split-dwo option, matching all other fission-*.exp tests. This uses
> objcopy to properly extract .dwo sections without involving the
> linker.
>
> Changes:
> - Use build_executable_and_dwo_files instead of gdb_compile_shlib
> - Generate both skeleton and DWO CUs in single Dwarf::assemble block
> - Add debug_str_offsets section for DW_FORM_strx support
> - Add is_remote host check (required for objcopy-based workflow)
> - Fix DW_AT_dwo_name to match generated filename
>
> Tested: GCC 13.3.0, Clang-23 (passes)
Thanks, that LGTM.
Approved-By: Simon Marchi <simon.marchi@efficios.com>
Just a nit: when sending a version 2 of a patch or patch series, pass
`-v2` to git-send-email to make it add "v2" in the subject prefix.
However, it seems that you used --in-reply-to to keep the new patch in
the same thread as the original on, that is very nice and thoughtful,
thank you.
Simon
prev parent reply other threads:[~2026-04-23 14:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-16 14:00 [PATCH] testsuite: Skip fission-dw-form-strx with clang Bratislav Filipovic
2026-04-16 14:45 ` Guinevere Larsen
2026-04-16 15:19 ` Simon Marchi
2026-04-23 10:37 ` [PATCH] gdb.dwarf2: Fix fission-dw-form-strx.exp workflow Bratislav Filipovic
2026-04-23 14:36 ` Simon Marchi [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ff249a67-dbac-4783-8b27-7bedacd3f761@simark.ca \
--to=simark@simark.ca \
--cc=bfilipov@amd.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox