public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "vries at gcc dot gnu.org" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug corefiles/27689] FAIL: gdb.base/gcore-tls-pie.exp: x/i $pc
Date: Mon, 05 Apr 2021 14:17:15 +0000	[thread overview]
Message-ID: <bug-27689-4717-ds8GCgvA8j@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-27689-4717@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=27689

--- Comment #1 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Tom de Vries from comment #0)
> warning: core file may not match specified executable file.^M

I looked into this warning.  It's due to a mismatch in buildid, which is caused
by incorrect reading of the buildid for the core.

We're trying to read the following 3 notes from the core:
...
                      04 00 00 00  10 00 00 00 01 00 00 00  |o.2.............|
00000770  47 4e 55 00 00 00 00 00  03 00 00 00 02 00 00 00  |GNU.............|
00000780  00 00 00 00

                       00 00 00 00

                                   04 00 00 00 20 00 00 00  |............ ...|
00000790  05 00 00 00 47 4e 55 00  02 80 00 c0 04 00 00 00  |....GNU.........|
000007a0  01 00 00 00 00 00 00 00  01 00 01 c0 04 00 00 00  |................|
000007b0  01 00 00 00 00 00 00 00

                                   04 00 00 00 14 00 00 00  |................|
000007c0  03 00 00 00 47 4e 55 00  79 c4 e9 5a c4 c0 5c ce  |....GNU.y..Z..\.|
000007d0  95 e9 38 e2 13 58 41 4e  2e fa 5f c7
...

[ Note format: First word is name size (4 in all cases), second words is data
size (0x10, 0x20 and 0x14), third word is type (1,5,3, see NT_GNU constants in
include/elf/common.h), then there's the name, "GNU\0", followed by the data. ]

First we have a NT_GNU_ABI_TAG note, then a NT_GNU_PROPERTY_TYPE_0 note, then a
NT_GNU_BUILD_ID note.

However, the NT_GNU_PROPERTY_TYPE_0 note has alignment 8:
... 
  [Nr] Name              Type            Address          Off    Size   ES Flg
Lk Inf Al
  ...
  [16] .note.gnu.property NOTE            0000000000000000 000390 000030 00   A
 0   0  8
...
to it doesn't start immediately after the NT_GNU_ABI_TAG note, instead we have
4 bytes padding (00 00 00 00).

The padding throws off the note reader in bfd, so the last two notes are not
read correctly.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  reply	other threads:[~2021-04-05 14:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-02 15:36 [Bug corefiles/27689] New: " vries at gcc dot gnu.org
2021-04-05 14:17 ` vries at gcc dot gnu.org [this message]
2021-04-05 14:21 ` [Bug corefiles/27689] " vries at gcc dot gnu.org
2021-04-05 14:27 ` vries at gcc dot gnu.org
2021-04-05 18:40 ` vries at gcc dot gnu.org
2021-04-07 12:56 ` vries at gcc dot gnu.org
2021-04-07 13:07 ` vries at gcc dot gnu.org
2021-04-07 13:22 ` vries at gcc dot gnu.org
2021-04-07 13:39 ` vries at gcc dot gnu.org
2021-04-09  9:31 ` vries at gcc dot gnu.org
2024-02-16  2:54 ` amodra at gmail dot com

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=bug-27689-4717-ds8GCgvA8j@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).