All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Kleikamp <dave.kleikamp@oracle.com>
To: sparclinux@vger.kernel.org
Subject: Re: [Patch V2 1/2] sparc64 changes for gdb-7.6
Date: Thu, 24 Mar 2016 21:01:10 +0000	[thread overview]
Message-ID: <56F45596.1080807@oracle.com> (raw)
In-Reply-To: <1458772868-10255-2-git-send-email-dave.kleikamp@oracle.com>

On 03/24/2016 02:20 PM, David Miller wrote:
> From: Dave Kleikamp <dave.kleikamp@oracle.com>
> Date: Wed, 23 Mar 2016 17:41:07 -0500
> 
>> +   /* If the section has relocations, we must read it ourselves.
>> +-     Otherwise we attach it to the BFD.  */
>> ++     Otherwise we attach it to the BFD.  
>> ++     Also, in sparc64 only try mmap for sections which
>> ++     are properly aligned in order to avoid SIGBUS errors.  */
>> ++
>> ++#if defined(__sparc__) && __WORDSIZE = 64
>> ++  if (info->size > 4 * pagesize && (sectp->flags & SEC_RELOC) = 0 && !(sectp->filepos & 0x3))
>> ++#else
>> +   if ((sectp->flags & SEC_RELOC) = 0)
>> ++#endif
>> +     {
>> +       const gdb_byte *bytes = gdb_bfd_map_section (sectp, &info->size);
> 
> This doesn't make any sense at all.
> 
> The bug is probably that unaligned relocations are being improperly
> accessed using 32-bit loads and storess them.
> 
> Several relocs, particularly those used in debugging sections, need to
> be carefully accessed using byte at a time accesses in order to avoid
> said SIGBUS problem.
> 
> BFD and the rest of binutils have code to handle this case properly.
> 
> Please don't paper over the core issue with hacks like this.

I have to admit that I don't know the whole story here. I took over the
crash port, but haven't had to touch the gdb patch that got handed to
me. What I do know is crash works off an older 7.6 branch of gdb. I'll
get back to you after I talk to some other folks.

Thanks,
Dave

  parent reply	other threads:[~2016-03-24 21:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-23 22:41 [Patch V2 1/2] sparc64 changes for gdb-7.6 Dave Kleikamp
2016-03-24 19:20 ` David Miller
2016-03-24 21:01 ` Dave Kleikamp [this message]
2016-03-25  0:21 ` David Miller
2016-03-25  3:39 ` Dave Kleikamp
2016-03-25 16:17 ` Dave Kleikamp

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=56F45596.1080807@oracle.com \
    --to=dave.kleikamp@oracle.com \
    --cc=sparclinux@vger.kernel.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.