public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Kevin Buettner via Gdb-patches <gdb-patches@sourceware.org>
Cc: Kevin Buettner <kevinb@redhat.com>,
	 Simon Marchi <simon.marchi@polymtl.ca>
Subject: Re: [PATCH v3 1/2] [symtab/27831] Fix OBJF_MAINLINE assert
Date: Mon, 14 Aug 2023 10:00:14 -0600	[thread overview]
Message-ID: <87zg2tzka9.fsf@tromey.com> (raw)
In-Reply-To: <20230813035925.3344167-2-kevinb@redhat.com> (Kevin Buettner via Gdb-patches's message of "Sat, 12 Aug 2023 20:48:52 -0700")

>>>>> "Kevin" == Kevin Buettner via Gdb-patches <gdb-patches@sourceware.org> writes:

Kevin> This commit fixes a bug mentioned by Florian Weimer during the
Kevin> libpthread/ld.so load order discussion from 2021.  Florian provided
Kevin> instructions for reproducing the bug here:

Thanks for the patch.

I think this looks good but I had one possible concern.

Kevin> diff --git a/gdb/elfread.c b/gdb/elfread.c
Kevin> index 349a8b75bcc..dbe5951c802 100644
...
Kevin> -    result->maybe_copied = 1;

Kevin> +bool
Kevin> +minimal_symbol::maybe_copied (objfile *objfile) const
Kevin> +{
Kevin> +  return ((objfile->flags & OBJF_MAINLINE) == 0
Kevin> +	  && (m_type == mst_data || m_type == mst_bss));

The old approach was specific to ELF, while the new approach will be
used by any object format.

I am not sure if other object formats even have copy relocs.  Do they?
If so then this seems fine.  If not, then it seems like it could result
in an incorrect evaluation in some scenario.

Tom

  reply	other threads:[~2023-08-14 16:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-13  3:48 [PATCH v3 0/2] " Kevin Buettner
2023-08-13  3:48 ` [PATCH v3 1/2] " Kevin Buettner
2023-08-14 16:00   ` Tom Tromey [this message]
2023-08-13  3:48 ` [PATCH v3 2/2] [symtab/27831] New test case: gdb.base/add-symbol-file-attach.exp Kevin Buettner

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=87zg2tzka9.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    --cc=kevinb@redhat.com \
    --cc=simon.marchi@polymtl.ca \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).