diff options
author | Mark Kettenis <kettenis@gnu.org> | 2004-04-05 14:43:36 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@gnu.org> | 2004-04-05 14:43:36 +0000 |
commit | 24d18d3088761bd75b7b2aec6d2861e7cd85a2dc (patch) | |
tree | 8da5e21d3db69c535c24d0c30cce8fe5bbb3f056 /bfd/netbsd-core.c | |
parent | 3c7012f597b71cb39291e736f47e9d6ad4629238 (diff) | |
download | fsf-binutils-gdb-24d18d3088761bd75b7b2aec6d2861e7cd85a2dc.zip fsf-binutils-gdb-24d18d3088761bd75b7b2aec6d2861e7cd85a2dc.tar.gz fsf-binutils-gdb-24d18d3088761bd75b7b2aec6d2861e7cd85a2dc.tar.bz2 |
* netbsd-core.c (CORE_WCOOKIE_OFFSET): New define.
(netbsd_core_file_p): Create a .wcookie section for OpenBSD/sparc.
Diffstat (limited to 'bfd/netbsd-core.c')
-rw-r--r-- | bfd/netbsd-core.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/bfd/netbsd-core.c b/bfd/netbsd-core.c index 250c6f4..fca8013 100644 --- a/bfd/netbsd-core.c +++ b/bfd/netbsd-core.c @@ -34,6 +34,10 @@ NetBSD/sparc64 overlaps with M_MIPS1. */ #define M_SPARC64_OPENBSD M_MIPS1 +/* Offset of StackGhost cookie within `struct md_coredump' on + OpenBSD/sparc. */ +#define CORE_WCOOKIE_OFFSET 344 + struct netbsd_core_struct { struct core core; @@ -140,6 +144,25 @@ netbsd_core_file_p (abfd) asect->filepos = offset; asect->alignment_power = 2; + if (CORE_GETMID (core) == M_SPARC_NETBSD + && CORE_GETFLAG (coreseg) == CORE_CPU + && coreseg.c_size > CORE_WCOOKIE_OFFSET) + { + /* Truncate the .reg section. */ + asect->_raw_size = CORE_WCOOKIE_OFFSET; + + /* And create the .wcookie section. */ + asect = bfd_make_section_anyway (abfd, ".wcookie"); + if (asect == NULL) + goto punt; + + asect->flags = SEC_ALLOC + SEC_HAS_CONTENTS; + asect->_raw_size = 4; + asect->vma = 0; + asect->filepos = offset + CORE_WCOOKIE_OFFSET; + asect->alignment_power = 2; + } + offset += coreseg.c_size; } |