Re: [Patch V2 1/2] sparc64 changes for gdb-7.6

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Dave Kleikamp <dave.kleikamp@xxxxxxxxxx>
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.
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Development]     [DCCP]     [Linux ARM Development]     [Linux]     [Photo]     [Yosemite Help]     [Linux ARM Kernel]     [Linux SCSI]     [Linux x86_64]     [Linux Hams]

  Powered by Linux