* elfcode.h (elf_swap_ehdr_out): Adjust value written for e_shnum
[deliverable/binutils-gdb.git] / bfd / elf32-s390.c
index f608fb0aa6dbefaa88b6ca9a7e2ef2439bd114ff..af2c7ad63968aab33dc1a4b85227f717a1a99b8a 100644 (file)
@@ -1891,19 +1891,11 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section,
 
               skip = false;
 
-              if (elf_section_data (input_section)->stab_info == NULL)
-                outrel.r_offset = rel->r_offset;
-              else
-                {
-                  off = (_bfd_stab_section_offset
-                         (output_bfd, htab->elf.stab_info, input_section,
-                          &elf_section_data (input_section)->stab_info,
-                          rel->r_offset));
-                  if (off == (bfd_vma) -1)
-                    skip = true;
-                  outrel.r_offset = off;
-                }
-
+             outrel.r_offset =
+               _bfd_elf_section_offset (output_bfd, info, input_section,
+                                        rel->r_offset);
+             if (outrel.r_offset == (bfd_vma) -1)
+               skip = true;
               outrel.r_offset += (input_section->output_section->vma
                                   + input_section->output_offset);
 
@@ -2386,6 +2378,37 @@ elf_s390_object_p (abfd)
   return bfd_default_set_arch_mach (abfd, bfd_arch_s390, bfd_mach_s390_esa);
 }
 
+static boolean
+elf_s390_grok_prstatus (abfd, note)
+     bfd * abfd;
+     Elf_Internal_Note * note;
+{
+  int offset;
+  unsigned int raw_size;
+
+  switch (note->descsz)
+    {
+      default:
+       return false;
+
+      case 224:                /* S/390 Linux.  */
+       /* pr_cursig */
+       elf_tdata (abfd)->core_signal = bfd_get_16 (abfd, note->descdata + 12);
+
+       /* pr_pid */
+       elf_tdata (abfd)->core_pid = bfd_get_32 (abfd, note->descdata + 24);
+
+       /* pr_reg */
+       offset = 72;
+       raw_size = 144;
+       break;
+    }
+
+  /* Make a ".reg/999" section.  */
+  return _bfd_elfcore_make_pseudosection (abfd, ".reg",
+                                         raw_size, note->descpos + offset);
+}
+
 #define TARGET_BIG_SYM bfd_elf32_s390_vec
 #define TARGET_BIG_NAME        "elf32-s390"
 #define ELF_ARCH       bfd_arch_s390
@@ -2419,6 +2442,7 @@ elf_s390_object_p (abfd)
 #define elf_backend_relocate_section          elf_s390_relocate_section
 #define elf_backend_size_dynamic_sections     elf_s390_size_dynamic_sections
 #define elf_backend_reloc_type_class         elf_s390_reloc_type_class
+#define elf_backend_grok_prstatus            elf_s390_grok_prstatus
 
 #define elf_backend_object_p            elf_s390_object_p
 
This page took 0.023992 seconds and 4 git commands to generate.