public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi <simark@simark.ca>
To: Michael Spang <spang@chromium.org>, gdb-patches@sourceware.org
Cc: Michael Spang <spang@google.com>
Subject: Re: [PATCH] Fix debugging of stripped PIE executables with padded PT_TLS
Date: Mon, 20 Aug 2018 12:36:00 -0000	[thread overview]
Message-ID: <6c5217dee8a0e2df1fdf7fc68e1fbecb@simark.ca> (raw)
In-Reply-To: <21d25ba3-6e6f-c39c-7332-291819ebf906@simark.ca>

On 2018-08-19 11:04, Simon Marchi wrote:
> On 2018-08-16 2:35 p.m., Michael Spang via gdb-patches wrote:
>> From: Michael Spang <spang@google.com>
>> 
>> Certain PIE executables produced by gold cannot be debugged by gdb 
>> after
>> being stripped. GDB requires program headers of PIE executables to 
>> match,
>> and those checks may fail due to adjustments made during stripping.
>> 
>> One case of this occurs because strip recomputes the memsz of PT_TLS 
>> and
>> does not add alignment, while gold does. This is another variant of PR
>> 11786, so apply the same fix of relaxing the program header matching.
> 
> Thanks, as far as I understand this patch is correct.  I pushed it with 
> some
> minor changes outlined below.

Hmm, the new test fails on the buildbot, see here for example:

https://gdb-build.sergiodj.net/builders/Fedora-x86_64-m64/builds/10711

On the buildbot:

x/i $pc^M
=> 0x55555555467d:      mov    $0x0,%eax^M
(gdb) FAIL: gdb.base/gcore-tls-pie.exp: x/i $pc
frame^M
#0  0x000055555555467d in ?? ()^M
(gdb) FAIL: gdb.base/gcore-tls-pie.exp: unstripped + core ok


on my machine:

x/i $pc^M
=> 0x55555555460d <break_here+4>:       mov    $0x0,%eax^M
(gdb) PASS: gdb.base/gcore-tls-pie.exp: x/i $pc
frame^M
#0  break_here () at 
/home/simark/src/binutils-gdb/gdb/testsuite/gdb.base/gcore-tls-pie.c:28^M
28        *(int *) 0 = 0;^M
(gdb) PASS: gdb.base/gcore-tls-pie.exp: unstripped + core ok


Does anybody see the failure locally?

Simon

  reply	other threads:[~2018-08-20 12:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-16 18:35 Michael Spang via gdb-patches
2018-08-19 15:04 ` Simon Marchi
2018-08-20 12:36   ` Simon Marchi [this message]
2018-08-16 18:37 spang.google.com via gdb-patches

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=6c5217dee8a0e2df1fdf7fc68e1fbecb@simark.ca \
    --to=simark@simark.ca \
    --cc=gdb-patches@sourceware.org \
    --cc=spang@chromium.org \
    --cc=spang@google.com \
    /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).