All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mathieu Othacehe <othacehe@gnu.org>
To: Richard Purdie <richard.purdie@linuxfoundation.org>
Cc: openembedded-core@lists.openembedded.org,
	 Quentin Schulz <quentin.schulz@cherry.de>
Subject: Re: [OE-core] [PATCH v2] lib/oe/package: Add strip keep-section support
Date: Fri, 28 Feb 2025 10:09:58 +0100	[thread overview]
Message-ID: <87frjysae1.fsf@gnu.org> (raw)
In-Reply-To: <11f5d7bcfd74d901e8001e7316244a037ae1860c.camel@linuxfoundation.org> (Richard Purdie's message of "Thu, 27 Feb 2025 15:28:13 +0000")


Hello Richard,

> One of the reasons this has stayed as pending was this messy argument
> passing, which I appreciate is pre-existing code. I've sent a patch
> which cleans it up a bit and this patch will need rebasing on top of
> it. That should at least make things cleaner.

OK, noted. 

> I'm still a bit unsure what to do with the stripping changes this patch
> makes. One concern I worry about is having "magic" options users need
> to know to set. The other is whether there is really a binutils type
> bug underlying this and that there really should be a fix made
> somewhere else. I don't know enough about the issue to be sure whether
> there is an underlying issue though...

I think that this can be seen in a more generic way. To get a backtrace,
libunwind supports multiple methods on ARM:

--8<---------------cut here---------------start------------->8---
/* unwinding method selection support */
#define UNW_ARM_METHOD_ALL          0xFF
#define UNW_ARM_METHOD_DWARF        0x01
#define UNW_ARM_METHOD_FRAME        0x02
#define UNW_ARM_METHOD_EXIDX        0x04
#define UNW_ARM_METHOD_LR           0x08
--8<---------------cut here---------------end--------------->8---

The default one UNW_ARM_METHOD_EXIDX only supports partial backtraces,
as explained in the GCC thread[1]. Then, the UNW_ARM_METHOD_DWARF method
that provides complete backtraces operates on the ELF .debug_frame. By
always stripping that section, and offering no way of keeping this
section, we are preventing the user to use that unwinding method
altogether.

That is true for ARM but for other architectures as well. It can very be
that one might want to keep the .debug_frame around on x86_64 so that
the same unwinding method is used across all the architectures supported
for a given image.

Maybe going for the v2 approach allowing to keep any ELF section, would
feel less magical than the v1 approach that was targeting specifically
the .debug_frame section.

Finally, the .debug_frame based unwinding was a bit broken on libunwind,
it this now fixed[2], so it would be great to be able to use it in
Yocto.

Thanks,

Mathieu

[1]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117941
[2]: https://github.com/libunwind/libunwind/pull/826


  reply	other threads:[~2025-02-28  9:10 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-04 10:37 [PATCH v2] lib/oe/package: Add strip keep-section support Mathieu Othacehe
2025-02-04 11:37 ` [OE-core] " Alexander Kanavin
2025-02-04 11:39   ` Alexander Kanavin
2025-02-04 12:36   ` Mathieu Othacehe
2025-02-04 12:50     ` Alexander Kanavin
2025-02-04 14:25       ` Mathieu Othacehe
2025-02-04 19:02         ` Alexander Kanavin
2025-02-27 15:28 ` Richard Purdie
2025-02-28  9:09   ` Mathieu Othacehe [this message]
2025-02-28 10:37     ` Richard Purdie
2025-03-01  9:31       ` Mathieu Othacehe
2025-03-01  9:57         ` Richard Purdie
2025-03-06  7:34           ` Mathieu Othacehe
2025-03-01 16:11         ` Khem Raj

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=87frjysae1.fsf@gnu.org \
    --to=othacehe@gnu.org \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=quentin.schulz@cherry.de \
    --cc=richard.purdie@linuxfoundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.