mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-29 08:24:05 +08:00
* corelow.c (core_xfer_partial): Fix coding standards violation.
Add support for TARGET_OBJECT_WCOOKIE.
This commit is contained in:
@ -1,5 +1,8 @@
|
|||||||
2004-04-10 Mark Kettenis <kettenis@gnu.org>
|
2004-04-10 Mark Kettenis <kettenis@gnu.org>
|
||||||
|
|
||||||
|
* corelow.c (core_xfer_partial): Fix coding standards violation.
|
||||||
|
Add support for TARGET_OBJECT_WCOOKIE.
|
||||||
|
|
||||||
* sparc-linux-tdep.c (sparc32_linux_init_abi): Don't set
|
* sparc-linux-tdep.c (sparc32_linux_init_abi): Don't set
|
||||||
deprecated_pc_in_sigtramp.
|
deprecated_pc_in_sigtramp.
|
||||||
* sparc-sol2-tdep.c (sparc32_sol2_init_abi): Likewise.
|
* sparc-sol2-tdep.c (sparc32_sol2_init_abi): Likewise.
|
||||||
|
@ -552,9 +552,9 @@ core_xfer_partial (struct target_ops *ops, enum target_object object,
|
|||||||
size -= offset;
|
size -= offset;
|
||||||
if (size > len)
|
if (size > len)
|
||||||
size = len;
|
size = len;
|
||||||
if (size > 0 &&
|
if (size > 0
|
||||||
! bfd_get_section_contents (core_bfd, section, readbuf,
|
&& !bfd_get_section_contents (core_bfd, section, readbuf,
|
||||||
(file_ptr) offset, size))
|
(file_ptr) offset, size))
|
||||||
{
|
{
|
||||||
warning ("Couldn't read NT_AUXV note in core file.");
|
warning ("Couldn't read NT_AUXV note in core file.");
|
||||||
return -1;
|
return -1;
|
||||||
@ -564,6 +564,38 @@ core_xfer_partial (struct target_ops *ops, enum target_object object,
|
|||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
case TARGET_OBJECT_WCOOKIE:
|
||||||
|
if (readbuf)
|
||||||
|
{
|
||||||
|
/* When the StackGhost cookie is stored in core file, BFD
|
||||||
|
represents this with a fake section called ".wcookie". */
|
||||||
|
|
||||||
|
struct bfd_section *section;
|
||||||
|
bfd_size_type size;
|
||||||
|
char *contents;
|
||||||
|
|
||||||
|
section = bfd_get_section_by_name (core_bfd, ".wcookie");
|
||||||
|
if (section == NULL)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
size = bfd_section_size (core_bfd, section);
|
||||||
|
if (offset >= size)
|
||||||
|
return 0;
|
||||||
|
size -= offset;
|
||||||
|
if (size > len)
|
||||||
|
size = len;
|
||||||
|
if (size > 0
|
||||||
|
&& !bfd_get_section_contents (core_bfd, section, readbuf,
|
||||||
|
(file_ptr) offset, size))
|
||||||
|
{
|
||||||
|
warning ("Couldn't read StackGhost cookie in core file.");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return size;
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if (ops->beneath != NULL)
|
if (ops->beneath != NULL)
|
||||||
return ops->beneath->to_xfer_partial (ops->beneath, object, annex,
|
return ops->beneath->to_xfer_partial (ops->beneath, object, annex,
|
||||||
|
Reference in New Issue
Block a user