[Crash-utility] [Patch V2 1/2] sparc64 changes for gdb-7.6

David Miller davem at davemloft.net
Thu Mar 24 19:20:16 UTC 2016


From: Dave Kleikamp <dave.kleikamp at 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.

Thanks.




More information about the Crash-utility mailing list