diff --git a/0001-S390-Fix-compiler-invocation-with-compile-command.patch b/0001-S390-Fix-compiler-invocation-with-compile-command.patch new file mode 100644 index 0000000..2c3ba42 --- /dev/null +++ b/0001-S390-Fix-compiler-invocation-with-compile-command.patch @@ -0,0 +1,73 @@ +From 60abeae4f219a7a445d11ebaf72d2939413ffe80 Mon Sep 17 00:00:00 2001 +From: Andreas Arnez +Date: Fri, 27 Feb 2015 10:47:54 +0100 +Subject: [PATCH] S390: Fix compiler invocation with "compile" command + +On 64-bit S390 platforms the "compile" command always failed because +gcc was not invoked correctly. This patch fixes the compiler +invocation. + +gdb/ChangeLog: + + * s390-linux-tdep.c (s390_gcc_target_options): Not just handle + 31-bit targets, but 64-bit targets as well. + (s390_gnu_triplet_regexp): New function. + (s390_gdbarch_init): Set the gcc_target_options gdbarch method for + 64-bit targets as well. Set the gnu_triplet_regexp gdbarch + method. +--- + gdb/ChangeLog | 9 +++++++++ + gdb/s390-linux-tdep.c | 19 ++++++++++++++++--- + 2 files changed, 25 insertions(+), 3 deletions(-) + +diff --git a/gdb/s390-linux-tdep.c b/gdb/s390-linux-tdep.c +index 9bd25fe..803779c 100644 +--- a/gdb/s390-linux-tdep.c ++++ b/gdb/s390-linux-tdep.c +@@ -2808,12 +2808,24 @@ s390_address_class_name_to_type_flags (struct gdbarch *gdbarch, + return 0; + } + +-/* Implement gdbarch_gcc_target_options. GCC does not know "-m32". */ ++/* Implement gdbarch_gcc_target_options. GCC does not know "-m32" or ++ "-mcmodel=large". */ + + static char * + s390_gcc_target_options (struct gdbarch *gdbarch) + { +- return xstrdup ("-m31"); ++ return xstrdup (gdbarch_ptr_bit (gdbarch) == 64 ? "-m64" : "-m31"); ++} ++ ++/* Implement gdbarch_gnu_triplet_regexp. Target triplets are "s390-*" ++ for 31-bit and "s390x-*" for 64-bit, while the BFD arch name is ++ always "s390". Note that an s390x compiler supports "-m31" as ++ well. */ ++ ++static const char * ++s390_gnu_triplet_regexp (struct gdbarch *gdbarch) ++{ ++ return "s390x?"; + } + + /* Implementation of `gdbarch_stap_is_single_operand', as defined in +@@ -3112,7 +3124,6 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) + { + case ABI_LINUX_S390: + set_gdbarch_addr_bits_remove (gdbarch, s390_addr_bits_remove); +- set_gdbarch_gcc_target_options (gdbarch, s390_gcc_target_options); + set_solib_svr4_fetch_link_map_offsets + (gdbarch, svr4_ilp32_fetch_link_map_offsets); + +@@ -3152,6 +3163,8 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) + set_gdbarch_stap_register_indirection_suffixes (gdbarch, + stap_register_indirection_suffixes); + set_gdbarch_stap_is_single_operand (gdbarch, s390_stap_is_single_operand); ++ set_gdbarch_gcc_target_options (gdbarch, s390_gcc_target_options); ++ set_gdbarch_gnu_triplet_regexp (gdbarch, s390_gnu_triplet_regexp); + + return gdbarch; + } +-- +1.8.1.4 + diff --git a/0001-S390-Support-new-vector-register-sections.patch b/0001-S390-Support-new-vector-register-sections.patch new file mode 100644 index 0000000..b9ac367 --- /dev/null +++ b/0001-S390-Support-new-vector-register-sections.patch @@ -0,0 +1,157 @@ +From 4ef9f41a9538c9c7e4e540277e437b137cb64c4c Mon Sep 17 00:00:00 2001 +From: Andreas Arnez +Date: Fri, 20 Feb 2015 10:39:53 +0100 +Subject: [PATCH] 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. +--- + bfd/ChangeLog | 11 +++++++++++ + bfd/elf-bfd.h | 4 ++++ + bfd/elf.c | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++ + include/elf/ChangeLog | 5 +++++ + include/elf/common.h | 4 ++++ + 7 files changed, 88 insertions(+) + +diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h +index 495053d..156eec7 100644 +--- a/bfd/elf-bfd.h ++++ b/bfd/elf-bfd.h +@@ -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 +diff --git a/bfd/elf.c b/bfd/elf.c +index 0aa5f8e..14bc531 100644 +--- a/bfd/elf.c ++++ b/bfd/elf.c +@@ -8251,6 +8251,18 @@ elfcore_grok_s390_tdb (bfd *abfd, Elf_Internal_Note *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) + { + return elfcore_make_note_pseudosection (abfd, ".reg-arm-vfp", 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) +@@ -9580,6 +9606,31 @@ elfcore_write_s390_tdb (bfd *abfd, + } + + 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, + int *bufsiz, +@@ -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) +diff --git a/include/elf/common.h b/include/elf/common.h +index ae7b5f8..70778bf 100644 +--- a/include/elf/common.h ++++ b/include/elf/common.h +@@ -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. */ +-- +1.8.1.4 + diff --git a/gdb.changes b/gdb.changes index ef279d7..b69b6e0 100644 --- a/gdb.changes +++ b/gdb.changes @@ -5,6 +5,8 @@ Fri Jul 10 13:49:28 UTC 2015 - matz@suse.de fixes PR python/18299, python/18285. - Add gdb-s390-reorder-arch.diff [bnc #936050] - Added patches for fate#318039, s390 z13 support: + 0001-S390-Fix-compiler-invocation-with-compile-command.patch + 0001-S390-Support-new-vector-register-sections.patch 0001-S390-Add-target-descriptions-for-vector-register-set.patch 0002-S390-Add-vector-register-support-to-gdb.patch 0003-S390-Add-vector-register-support-to-gdbserver.patch diff --git a/gdb.spec b/gdb.spec index 7d8ee6b..07f471d 100644 --- a/gdb.spec +++ b/gdb.spec @@ -215,11 +215,13 @@ Patch1002: gdb-6.6-buildid-locate-rpm-suse.patch # Upstream patch for reordering "s390:31-bit" (bnc#936050) Patch1003: gdb-s390-reorder-arch.diff # fate#318039 -Patch1004: 0001-S390-Add-target-descriptions-for-vector-register-set.patch -Patch1005: 0002-S390-Add-vector-register-support-to-gdb.patch -Patch1006: 0003-S390-Add-vector-register-support-to-gdbserver.patch -Patch1007: 0004-S390-Vector-register-test-case.patch -Patch1008: 0005-S390-Name-invisible-registers-with-the-empty-string-.patch +Patch1004: 0001-S390-Fix-compiler-invocation-with-compile-command.patch +Patch1005: 0001-S390-Support-new-vector-register-sections.patch +Patch1006: 0001-S390-Add-target-descriptions-for-vector-register-set.patch +Patch1007: 0002-S390-Add-vector-register-support-to-gdb.patch +Patch1008: 0003-S390-Add-vector-register-support-to-gdbserver.patch +Patch1009: 0004-S390-Vector-register-test-case.patch +Patch1010: 0005-S390-Name-invisible-registers-with-the-empty-string-.patch BuildRequires: bison BuildRequires: flex @@ -487,6 +489,8 @@ find -name "*.info*"|xargs rm -f %patch1006 -p1 %patch1007 -p1 %patch1008 -p1 +%patch1009 -p1 +%patch1010 -p1 find -name "*.orig" | xargs rm -f ! find -name "*.rej" # Should not happen.