From abb3f6cca7cd9d8ab574d252cab8e64928d7c40f Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Fri, 8 Mar 2013 17:13:31 +0000 Subject: [PATCH] * elf-bfd.h (elfcore_write_s390_tdb): Add prototype. * elf.c (elfcore_write_s390_tdb): New function. (elfcore_write_register_note): Call it. (elfcore_grok_s390_tdb): New function. (elfcore_grok_note): Call it. * readelf.c (get_note_type): Add NT_S390_TDB. --- bfd/ChangeLog | 8 ++++++++ bfd/elf-bfd.h | 6 +++--- bfd/elf.c | 32 ++++++++++++++++++++++++++++---- binutils/ChangeLog | 4 ++++ binutils/readelf.c | 2 ++ include/elf/ChangeLog | 4 ++++ include/elf/common.h | 7 +++---- 7 files changed, 52 insertions(+), 11 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 1454f405953..d4b07a98409 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,11 @@ +2013-03-08 Andreas Arnez + + * elf-bfd.h (elfcore_write_s390_tdb): Add prototype. + * elf.c (elfcore_write_s390_tdb): New function. + (elfcore_write_register_note): Call it. + (elfcore_grok_s390_tdb): New function. + (elfcore_grok_note): Call it. + 2013-03-08 Maciej W. Rozycki * elfxx-mips.c (mips_elf_allocate_lazy_stub): Correct data type. diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h index 72be700a125..3f068bb95e1 100644 --- a/bfd/elf-bfd.h +++ b/bfd/elf-bfd.h @@ -1,7 +1,5 @@ /* BFD back-end data structures for ELF files. - Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, - 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 - Free Software Foundation, Inc. + Copyright 1992-2013 Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -2291,6 +2289,8 @@ extern char *elfcore_write_s390_last_break (bfd *, char *, int *, const void *, int); extern char *elfcore_write_s390_system_call (bfd *, char *, int *, const void *, int); +extern char *elfcore_write_s390_tdb + (bfd *, char *, int *, const void *, int); extern char *elfcore_write_arm_vfp (bfd *, char *, int *, const void *, int); extern char *elfcore_write_aarch_tls diff --git a/bfd/elf.c b/bfd/elf.c index e0487c2c915..3ba7e5f11ab 100644 --- a/bfd/elf.c +++ b/bfd/elf.c @@ -1,9 +1,6 @@ /* ELF executable support for BFD. - Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, - 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, - 2013 - Free Software Foundation, Inc. + Copyright 1993-2013 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -8174,6 +8171,12 @@ elfcore_grok_s390_system_call (bfd *abfd, Elf_Internal_Note *note) return elfcore_make_note_pseudosection (abfd, ".reg-s390-system-call", note); } +static bfd_boolean +elfcore_grok_s390_tdb (bfd *abfd, Elf_Internal_Note *note) +{ + return elfcore_make_note_pseudosection (abfd, ".reg-s390-tdb", note); +} + static bfd_boolean elfcore_grok_arm_vfp (bfd *abfd, Elf_Internal_Note *note) { @@ -8631,6 +8634,13 @@ elfcore_grok_note (bfd *abfd, Elf_Internal_Note *note) else return TRUE; + case NT_S390_TDB: + if (note->namesz == 6 + && strcmp (note->namedata, "LINUX") == 0) + return elfcore_grok_s390_tdb (abfd, note); + else + return TRUE; + case NT_ARM_VFP: if (note->namesz == 6 && strcmp (note->namedata, "LINUX") == 0) @@ -9484,6 +9494,18 @@ elfcore_write_s390_system_call (bfd *abfd, s390_system_call, size); } +char * +elfcore_write_s390_tdb (bfd *abfd, + char *buf, + int *bufsiz, + const void *s390_tdb, + int size) +{ + char *note_name = "LINUX"; + return elfcore_write_note (abfd, buf, bufsiz, + note_name, NT_S390_TDB, s390_tdb, size); +} + char * elfcore_write_arm_vfp (bfd *abfd, char *buf, @@ -9566,6 +9588,8 @@ elfcore_write_register_note (bfd *abfd, return elfcore_write_s390_last_break (abfd, buf, bufsiz, data, size); if (strcmp (section, ".reg-s390-system-call") == 0) return elfcore_write_s390_system_call (abfd, buf, bufsiz, data, size); + if (strcmp (section, ".reg-s390-tdb") == 0) + return elfcore_write_s390_tdb (abfd, buf, bufsiz, data, size); if (strcmp (section, ".reg-arm-vfp") == 0) return elfcore_write_arm_vfp (abfd, buf, bufsiz, data, size); if (strcmp (section, ".reg-aarch-tls") == 0) diff --git a/binutils/ChangeLog b/binutils/ChangeLog index bc0488902f0..12861614e6f 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,7 @@ +2013-03-08 Andreas Arnez + + * readelf.c (get_note_type): Add NT_S390_TDB. + 2013-03-07 Alan Modra * strings.c (get_char): Dispense with buf[]. Instead shift diff --git a/binutils/readelf.c b/binutils/readelf.c index 28172f22a3a..266e37e7924 100644 --- a/binutils/readelf.c +++ b/binutils/readelf.c @@ -12843,6 +12843,8 @@ get_note_type (unsigned e_type) return _("NT_S390_LAST_BREAK (s390 last breaking event address)"); case NT_S390_SYSTEM_CALL: return _("NT_S390_SYSTEM_CALL (s390 system call restart data)"); + case NT_S390_TDB: + return _("NT_S390_TDB (s390 transaction diagnostic block)"); case NT_ARM_VFP: return _("NT_ARM_VFP (arm VFP registers)"); case NT_ARM_TLS: diff --git a/include/elf/ChangeLog b/include/elf/ChangeLog index 7807767278d..f08ca6bea98 100644 --- a/include/elf/ChangeLog +++ b/include/elf/ChangeLog @@ -1,3 +1,7 @@ +2013-03-08 Andreas Arnez + + * common.h (NT_S390_TDB): Define. + 2013-02-06 Sandra Loosemore Andrew Jenner diff --git a/include/elf/common.h b/include/elf/common.h index 2bae603c40a..8bdefa60b91 100644 --- a/include/elf/common.h +++ b/include/elf/common.h @@ -1,8 +1,5 @@ /* ELF support for BFD. - Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, - 2013 - Free Software Foundation, Inc. + Copyright 1991-2013 Free Software Foundation, Inc. Written by Fred Fish @ Cygnus Support, from information published in "UNIX System V Release 4, Programmers Guide: ANSI C and @@ -552,6 +549,8 @@ /* note name must be "LINUX". */ #define NT_S390_SYSTEM_CALL 0x307 /* S390 system call restart data */ /* note name must be "LINUX". */ +#define NT_S390_TDB 0x308 /* S390 transaction diagnostic block */ + /* note name must be "LINUX". */ #define NT_ARM_VFP 0x400 /* ARM VFP registers */ /* The following definitions should really use NT_AARCH_..., but defined this way for compatibility with Linux. */ -- 2.30.2