1 /* Hitachi SH specific support for 32-bit Linux
2 Copyright 2000, 2001 Free Software Foundation, Inc.
4 This file is part of BFD, the Binary File Descriptor library.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
20 #define TARGET_BIG_SYM bfd_elf32_shblin_vec
21 #define TARGET_BIG_NAME "elf32-shbig-linux"
22 #define TARGET_LITTLE_SYM bfd_elf32_shlin_vec
23 #define TARGET_LITTLE_NAME "elf32-sh-linux"
24 #define ELF_ARCH bfd_arch_sh
25 #define ELF_MACHINE_CODE EM_SH
26 #define ELF_MAXPAGESIZE 0x10000
27 #define elf_symbol_leading_char 0
31 #include "elf/internal.h"
34 static boolean elf32_shlin_grok_prstatus
35 PARAMS ((bfd
*abfd
, Elf_Internal_Note
*note
));
36 static boolean elf32_shlin_grok_psinfo
37 PARAMS ((bfd
*abfd
, Elf_Internal_Note
*note
));
39 /* Support for core dump NOTE sections */
41 elf32_shlin_grok_prstatus (abfd
, note
)
43 Elf_Internal_Note
*note
;
46 unsigned int raw_size
;
53 case 168: /* Linux/SH */
55 elf_tdata (abfd
)->core_signal
= bfd_get_16 (abfd
, note
->descdata
+ 12);
58 elf_tdata (abfd
)->core_pid
= bfd_get_32 (abfd
, note
->descdata
+ 24);
67 /* Make a ".reg/999" section. */
68 return _bfd_elfcore_make_pseudosection (abfd
, ".reg",
69 raw_size
, note
->descpos
+ offset
);
73 elf32_shlin_grok_psinfo (abfd
, note
)
75 Elf_Internal_Note
*note
;
82 case 124: /* Linux/SH elf_prpsinfo */
83 elf_tdata (abfd
)->core_program
84 = _bfd_elfcore_strndup (abfd
, note
->descdata
+ 28, 16);
85 elf_tdata (abfd
)->core_command
86 = _bfd_elfcore_strndup (abfd
, note
->descdata
+ 44, 80);
89 /* Note that for some reason, a spurious space is tacked
90 onto the end of the args in some (at least one anyway)
91 implementations, so strip it off if it exists. */
94 char *command
= elf_tdata (abfd
)->core_command
;
95 int n
= strlen (command
);
97 if (0 < n
&& command
[n
- 1] == ' ')
98 command
[n
- 1] = '\0';
105 #define elf_backend_grok_prstatus elf32_shlin_grok_prstatus
106 #define elf_backend_grok_psinfo elf32_shlin_grok_psinfo
110 #include "elf32-sh.c"