mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-02 23:04:09 +08:00
S390: Support new vector register sections
The IBM z13 has new 128-bit wide vector registers v0-v31, where v0-v15 include the existing 64-bit wide floating point registers. The Linux kernel presents the vector registers as two additional register sets, one for the right halves of v0-v15 and another one for the full registers v16-v31. Thus a new core file may contain two new register note sections, and this patch adds support to binutils for them. bfd/ * elf-bfd.h (elfcore_write_s390_vxrs_low): Add prototype. (elfcore_write_s390_vxrs_high): Likewise. * elf.c (elfcore_grok_s390_vxrs_low): New function. (elfcore_grok_s390_vxrs_high): New function. (elfcore_grok_note): Call them. (elfcore_write_s390_vxrs_low): New function. (elfcore_write_s390_vxrs_high): New function. (elfcore_write_register_note): Call them. binutils/ * readelf.c (get_note_type): Add NT_S390_VXRS_LOW and NT_S390_VXRS_HIGH. include/elf/ * common.h (NT_S390_VXRS_LOW): New macro. (NT_S390_VXRS_HIGH): Likewise.
This commit is contained in:
parent
dc049bf460
commit
4ef9f41a95
@ -1,3 +1,14 @@
|
||||
2015-02-20 Andreas Arnez <arnez@linux.vnet.ibm.com>
|
||||
|
||||
* elf-bfd.h (elfcore_write_s390_vxrs_low): Add prototype.
|
||||
(elfcore_write_s390_vxrs_high): Likewise.
|
||||
* elf.c (elfcore_grok_s390_vxrs_low): New function.
|
||||
(elfcore_grok_s390_vxrs_high): New function.
|
||||
(elfcore_grok_note): Call them.
|
||||
(elfcore_write_s390_vxrs_low): New function.
|
||||
(elfcore_write_s390_vxrs_high): New function.
|
||||
(elfcore_write_register_note): Call them.
|
||||
|
||||
2015-02-19 Branko Drevensek <branko.drevensek@gmail.com>
|
||||
|
||||
PR 17995
|
||||
|
@ -2285,6 +2285,10 @@ 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_s390_vxrs_low
|
||||
(bfd *, char *, int *, const void *, int);
|
||||
extern char *elfcore_write_s390_vxrs_high
|
||||
(bfd *, char *, int *, const void *, int);
|
||||
extern char *elfcore_write_arm_vfp
|
||||
(bfd *, char *, int *, const void *, int);
|
||||
extern char *elfcore_write_aarch_tls
|
||||
|
55
bfd/elf.c
55
bfd/elf.c
@ -8250,6 +8250,18 @@ 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_s390_vxrs_low (bfd *abfd, Elf_Internal_Note *note)
|
||||
{
|
||||
return elfcore_make_note_pseudosection (abfd, ".reg-s390-vxrs-low", note);
|
||||
}
|
||||
|
||||
static bfd_boolean
|
||||
elfcore_grok_s390_vxrs_high (bfd *abfd, Elf_Internal_Note *note)
|
||||
{
|
||||
return elfcore_make_note_pseudosection (abfd, ".reg-s390-vxrs-high", note);
|
||||
}
|
||||
|
||||
static bfd_boolean
|
||||
elfcore_grok_arm_vfp (bfd *abfd, Elf_Internal_Note *note)
|
||||
{
|
||||
@ -8714,6 +8726,20 @@ elfcore_grok_note (bfd *abfd, Elf_Internal_Note *note)
|
||||
else
|
||||
return TRUE;
|
||||
|
||||
case NT_S390_VXRS_LOW:
|
||||
if (note->namesz == 6
|
||||
&& strcmp (note->namedata, "LINUX") == 0)
|
||||
return elfcore_grok_s390_vxrs_low (abfd, note);
|
||||
else
|
||||
return TRUE;
|
||||
|
||||
case NT_S390_VXRS_HIGH:
|
||||
if (note->namesz == 6
|
||||
&& strcmp (note->namedata, "LINUX") == 0)
|
||||
return elfcore_grok_s390_vxrs_high (abfd, note);
|
||||
else
|
||||
return TRUE;
|
||||
|
||||
case NT_ARM_VFP:
|
||||
if (note->namesz == 6
|
||||
&& strcmp (note->namedata, "LINUX") == 0)
|
||||
@ -9579,6 +9605,31 @@ elfcore_write_s390_tdb (bfd *abfd,
|
||||
note_name, NT_S390_TDB, s390_tdb, size);
|
||||
}
|
||||
|
||||
char *
|
||||
elfcore_write_s390_vxrs_low (bfd *abfd,
|
||||
char *buf,
|
||||
int *bufsiz,
|
||||
const void *s390_vxrs_low,
|
||||
int size)
|
||||
{
|
||||
char *note_name = "LINUX";
|
||||
return elfcore_write_note (abfd, buf, bufsiz,
|
||||
note_name, NT_S390_VXRS_LOW, s390_vxrs_low, size);
|
||||
}
|
||||
|
||||
char *
|
||||
elfcore_write_s390_vxrs_high (bfd *abfd,
|
||||
char *buf,
|
||||
int *bufsiz,
|
||||
const void *s390_vxrs_high,
|
||||
int size)
|
||||
{
|
||||
char *note_name = "LINUX";
|
||||
return elfcore_write_note (abfd, buf, bufsiz,
|
||||
note_name, NT_S390_VXRS_HIGH,
|
||||
s390_vxrs_high, size);
|
||||
}
|
||||
|
||||
char *
|
||||
elfcore_write_arm_vfp (bfd *abfd,
|
||||
char *buf,
|
||||
@ -9663,6 +9714,10 @@ elfcore_write_register_note (bfd *abfd,
|
||||
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-s390-vxrs-low") == 0)
|
||||
return elfcore_write_s390_vxrs_low (abfd, buf, bufsiz, data, size);
|
||||
if (strcmp (section, ".reg-s390-vxrs-high") == 0)
|
||||
return elfcore_write_s390_vxrs_high (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)
|
||||
|
@ -1,3 +1,8 @@
|
||||
2015-02-20 Andreas Arnez <arnez@linux.vnet.ibm.com>
|
||||
|
||||
* readelf.c (get_note_type): Add NT_S390_VXRS_LOW and
|
||||
NT_S390_VXRS_HIGH.
|
||||
|
||||
2015-02-13 Nick Clifton <nickc@redhat.com>
|
||||
|
||||
PR binutils/17512
|
||||
|
@ -14513,6 +14513,10 @@ get_note_type (unsigned e_type)
|
||||
return _("NT_S390_SYSTEM_CALL (s390 system call restart data)");
|
||||
case NT_S390_TDB:
|
||||
return _("NT_S390_TDB (s390 transaction diagnostic block)");
|
||||
case NT_S390_VXRS_LOW:
|
||||
return _("NT_S390_VXRS_LOW (s390 vector registers 0-15 upper half)");
|
||||
case NT_S390_VXRS_HIGH:
|
||||
return _("NT_S390_VXRS_HIGH (s390 vector registers 16-31)");
|
||||
case NT_ARM_VFP:
|
||||
return _("NT_ARM_VFP (arm VFP registers)");
|
||||
case NT_ARM_TLS:
|
||||
|
@ -1,3 +1,8 @@
|
||||
2015-02-20 Andreas Arnez <arnez@linux.vnet.ibm.com>
|
||||
|
||||
* common.h (NT_S390_VXRS_LOW): New macro.
|
||||
(NT_S390_VXRS_HIGH): Likewise.
|
||||
|
||||
2015-01-28 James Bowman <james.bowman@ftdichip.com>
|
||||
|
||||
* common.h (EM_FT32): Define.
|
||||
|
@ -557,6 +557,10 @@
|
||||
/* note name must be "LINUX". */
|
||||
#define NT_S390_TDB 0x308 /* S390 transaction diagnostic block */
|
||||
/* note name must be "LINUX". */
|
||||
#define NT_S390_VXRS_LOW 0x309 /* S390 vector registers 0-15 upper half */
|
||||
/* note name must be "LINUX". */
|
||||
#define NT_S390_VXRS_HIGH 0x30a /* S390 vector registers 16-31 */
|
||||
/* 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. */
|
||||
|
Loading…
Reference in New Issue
Block a user