+2013-02-21 Alan Modra <amodra@gmail.com>
+
+ * elf-bfd.h (struct core_elf_obj_tdata): New.
+ (struct elf_obj_tdata): Delete core_signal, core_pid, core_lwpid,
+ core_program, and core_command. Add "core".
+ * elf.c (bfd_elf_mkcorefile): Allocate "core" struct.
+ Update all refs to tdata core fields.
+ * elf32-am33lin.c, * elf32-arm.c, * elf32-cris.c, * elf32-frv.c,
+ * elf32-hppa.c, * elf32-i386.c, * elf32-m68k.c, * elf32-mips.c,
+ * elf32-nios2.c, * elf32-ppc.c, * elf32-s390.c, * elf32-score.c,
+ * elf32-score7.c, * elf32-sh.c, * elf32-sparc.c, * elf32-tilegx.c,
+ * elf32-tilepro.c, * elf32-xtensa.c, * elf64-aarch64.c,
+ * elf64-hppa.c, * elf64-mips.c, * elf64-ppc.c, * elf64-tilegx.c,
+ * elf64-x86-64.c, * elfcore.h, * elfn32-mips.c: Update all refs
+ to tdata core fields.
+
2013-02-21 Alan Modra <amodra@gmail.com>
* elf-bfd.h (struct elf_obj_tdata): Rename segment_map to seg_map.
} u;
};
+/* tdata information grabbed from an elf core file. */
+struct core_elf_obj_tdata
+{
+ int signal;
+ int pid;
+ int lwpid;
+ char* program;
+ char* command;
+};
+
/* Some private data is stashed away for future use using the tdata pointer
in the bfd structure. */
bfd_vma gp; /* The gp value */
unsigned int gp_size; /* The gp size */
- /* Information grabbed from an elf core file. */
- int core_signal;
- int core_pid;
- int core_lwpid;
- char* core_program;
- char* core_command;
-
/* A mapping from external symbols to entries in the linker hash
table, used when linking. This is indexed by the symbol index
minus the sh_info field of the symbol table header. */
/* An identifier used to distinguish different target
specific extensions to this structure. */
enum elf_target_id object_id;
+
+ /* Information grabbed from an elf core file. */
+ struct core_elf_obj_tdata *core;
};
#define elf_tdata(bfd) ((bfd) -> tdata.elf_obj_data)
bfd_elf_mkcorefile (bfd *abfd)
{
/* I think this can be done just like an object file. */
- return abfd->xvec->_bfd_set_format[(int) bfd_object] (abfd);
+ if (!abfd->xvec->_bfd_set_format[(int) bfd_object] (abfd))
+ return FALSE;
+ elf_tdata (abfd)->core = bfd_zalloc (abfd, sizeof (*elf_tdata (abfd)->core));
+ return elf_tdata (abfd)->core != NULL;
}
static char *
{
int pid;
- pid = elf_tdata (abfd)->core_lwpid;
+ pid = elf_tdata (abfd)->core->lwpid;
if (pid == 0)
- pid = elf_tdata (abfd)->core_pid;
+ pid = elf_tdata (abfd)->core->pid;
return pid;
}
/* Do not overwrite the core signal if it
has already been set by another thread. */
- if (elf_tdata (abfd)->core_signal == 0)
- elf_tdata (abfd)->core_signal = prstat.pr_cursig;
- if (elf_tdata (abfd)->core_pid == 0)
- elf_tdata (abfd)->core_pid = prstat.pr_pid;
+ if (elf_tdata (abfd)->core->signal == 0)
+ elf_tdata (abfd)->core->signal = prstat.pr_cursig;
+ if (elf_tdata (abfd)->core->pid == 0)
+ elf_tdata (abfd)->core->pid = prstat.pr_pid;
/* pr_who exists on:
solaris 2.5+
linux 2.[01]
*/
#if defined (HAVE_PRSTATUS_T_PR_WHO)
- elf_tdata (abfd)->core_lwpid = prstat.pr_who;
+ elf_tdata (abfd)->core->lwpid = prstat.pr_who;
#else
- elf_tdata (abfd)->core_lwpid = prstat.pr_pid;
+ elf_tdata (abfd)->core->lwpid = prstat.pr_pid;
#endif
}
#if defined (HAVE_PRSTATUS32_T)
/* Do not overwrite the core signal if it
has already been set by another thread. */
- if (elf_tdata (abfd)->core_signal == 0)
- elf_tdata (abfd)->core_signal = prstat.pr_cursig;
- if (elf_tdata (abfd)->core_pid == 0)
- elf_tdata (abfd)->core_pid = prstat.pr_pid;
+ if (elf_tdata (abfd)->core->signal == 0)
+ elf_tdata (abfd)->core->signal = prstat.pr_cursig;
+ if (elf_tdata (abfd)->core->pid == 0)
+ elf_tdata (abfd)->core->pid = prstat.pr_pid;
/* pr_who exists on:
solaris 2.5+
linux 2.[01]
*/
#if defined (HAVE_PRSTATUS32_T_PR_WHO)
- elf_tdata (abfd)->core_lwpid = prstat.pr_who;
+ elf_tdata (abfd)->core->lwpid = prstat.pr_who;
#else
- elf_tdata (abfd)->core_lwpid = prstat.pr_pid;
+ elf_tdata (abfd)->core->lwpid = prstat.pr_pid;
#endif
}
#endif /* HAVE_PRSTATUS32_T */
memcpy (&psinfo, note->descdata, sizeof (psinfo));
#if defined (HAVE_PSINFO_T_PR_PID) || defined (HAVE_PRPSINFO_T_PR_PID)
- elf_tdata (abfd)->core_pid = psinfo.pr_pid;
+ elf_tdata (abfd)->core->pid = psinfo.pr_pid;
#endif
- elf_tdata (abfd)->core_program
+ elf_tdata (abfd)->core->program
= _bfd_elfcore_strndup (abfd, psinfo.pr_fname,
sizeof (psinfo.pr_fname));
- elf_tdata (abfd)->core_command
+ elf_tdata (abfd)->core->command
= _bfd_elfcore_strndup (abfd, psinfo.pr_psargs,
sizeof (psinfo.pr_psargs));
}
memcpy (&psinfo, note->descdata, sizeof (psinfo));
#if defined (HAVE_PSINFO32_T_PR_PID) || defined (HAVE_PRPSINFO32_T_PR_PID)
- elf_tdata (abfd)->core_pid = psinfo.pr_pid;
+ elf_tdata (abfd)->core->pid = psinfo.pr_pid;
#endif
- elf_tdata (abfd)->core_program
+ elf_tdata (abfd)->core->program
= _bfd_elfcore_strndup (abfd, psinfo.pr_fname,
sizeof (psinfo.pr_fname));
- elf_tdata (abfd)->core_command
+ elf_tdata (abfd)->core->command
= _bfd_elfcore_strndup (abfd, psinfo.pr_psargs,
sizeof (psinfo.pr_psargs));
}
implementations, so strip it off if it exists. */
{
- char *command = elf_tdata (abfd)->core_command;
+ char *command = elf_tdata (abfd)->core->command;
int n = strlen (command);
if (0 < n && command[n - 1] == ' ')
memcpy (&pstat, note->descdata, sizeof (pstat));
- elf_tdata (abfd)->core_pid = pstat.pr_pid;
+ elf_tdata (abfd)->core->pid = pstat.pr_pid;
}
#if defined (HAVE_PSTATUS32_T)
else if (note->descsz == sizeof (pstatus32_t))
memcpy (&pstat, note->descdata, sizeof (pstat));
- elf_tdata (abfd)->core_pid = pstat.pr_pid;
+ elf_tdata (abfd)->core->pid = pstat.pr_pid;
}
#endif
/* Could grab some more details from the "representative"
memcpy (&lwpstat, note->descdata, sizeof (lwpstat));
- elf_tdata (abfd)->core_lwpid = lwpstat.pr_lwpid;
+ elf_tdata (abfd)->core->lwpid = lwpstat.pr_lwpid;
/* Do not overwrite the core signal if it has already been set by
another thread. */
- if (elf_tdata (abfd)->core_signal == 0)
- elf_tdata (abfd)->core_signal = lwpstat.pr_cursig;
+ if (elf_tdata (abfd)->core->signal == 0)
+ elf_tdata (abfd)->core->signal = lwpstat.pr_cursig;
/* Make a ".reg/999" section. */
switch (type)
{
case 1 /* NOTE_INFO_PROCESS */:
- /* FIXME: need to add ->core_command. */
+ /* FIXME: need to add ->core->command. */
/* process_info.pid */
- elf_tdata (abfd)->core_pid = bfd_get_32 (abfd, note->descdata + 8);
+ elf_tdata (abfd)->core->pid = bfd_get_32 (abfd, note->descdata + 8);
/* process_info.signal */
- elf_tdata (abfd)->core_signal = bfd_get_32 (abfd, note->descdata + 12);
+ elf_tdata (abfd)->core->signal = bfd_get_32 (abfd, note->descdata + 12);
break;
case 2 /* NOTE_INFO_THREAD */:
elfcore_grok_netbsd_procinfo (bfd *abfd, Elf_Internal_Note *note)
{
/* Signal number at offset 0x08. */
- elf_tdata (abfd)->core_signal
+ elf_tdata (abfd)->core->signal
= bfd_h_get_32 (abfd, (bfd_byte *) note->descdata + 0x08);
/* Process ID at offset 0x50. */
- elf_tdata (abfd)->core_pid
+ elf_tdata (abfd)->core->pid
= bfd_h_get_32 (abfd, (bfd_byte *) note->descdata + 0x50);
/* Command name at 0x7c (max 32 bytes, including nul). */
- elf_tdata (abfd)->core_command
+ elf_tdata (abfd)->core->command
= _bfd_elfcore_strndup (abfd, note->descdata + 0x7c, 31);
return elfcore_make_note_pseudosection (abfd, ".note.netbsdcore.procinfo",
int lwp;
if (elfcore_netbsd_get_lwpid (note, &lwp))
- elf_tdata (abfd)->core_lwpid = lwp;
+ elf_tdata (abfd)->core->lwpid = lwp;
if (note->type == NT_NETBSDCORE_PROCINFO)
{
elfcore_grok_openbsd_procinfo (bfd *abfd, Elf_Internal_Note *note)
{
/* Signal number at offset 0x08. */
- elf_tdata (abfd)->core_signal
+ elf_tdata (abfd)->core->signal
= bfd_h_get_32 (abfd, (bfd_byte *) note->descdata + 0x08);
/* Process ID at offset 0x20. */
- elf_tdata (abfd)->core_pid
+ elf_tdata (abfd)->core->pid
= bfd_h_get_32 (abfd, (bfd_byte *) note->descdata + 0x20);
/* Command name at 0x48 (max 32 bytes, including nul). */
- elf_tdata (abfd)->core_command
+ elf_tdata (abfd)->core->command
= _bfd_elfcore_strndup (abfd, note->descdata + 0x48, 31);
return TRUE;
unsigned flags;
/* nto_procfs_status 'pid' field is at offset 0. */
- elf_tdata (abfd)->core_pid = bfd_get_32 (abfd, (bfd_byte *) ddata);
+ elf_tdata (abfd)->core->pid = bfd_get_32 (abfd, (bfd_byte *) ddata);
/* nto_procfs_status 'tid' field is at offset 4. Pass it back. */
*tid = bfd_get_32 (abfd, (bfd_byte *) ddata + 4);
/* nto_procfs_status 'what' field is at offset 14. */
if ((sig = bfd_get_16 (abfd, (bfd_byte *) ddata + 14)) > 0)
{
- elf_tdata (abfd)->core_signal = sig;
- elf_tdata (abfd)->core_lwpid = *tid;
+ elf_tdata (abfd)->core->signal = sig;
+ elf_tdata (abfd)->core->lwpid = *tid;
}
/* _DEBUG_FLAG_CURTID (current thread) is 0x80. Some cores
do not come from signals so we make sure we set the current
thread just in case. */
if (flags & 0x00000080)
- elf_tdata (abfd)->core_lwpid = *tid;
+ elf_tdata (abfd)->core->lwpid = *tid;
/* Make a ".qnx_core_status/%d" section. */
sprintf (buf, ".qnx_core_status/%ld", *tid);
sect->alignment_power = 2;
/* This is the current thread. */
- if (elf_tdata (abfd)->core_lwpid == tid)
+ if (elf_tdata (abfd)->core->lwpid == tid)
return elfcore_maybe_make_sect (abfd, base, sect);
return TRUE;
case 184:
case 188: /* Linux/am33 */
/* pr_cursig */
- elf_tdata (abfd)->core_signal = bfd_get_16 (abfd, note->descdata + 12);
+ elf_tdata (abfd)->core->signal = bfd_get_16 (abfd, note->descdata + 12);
/* pr_pid */
- elf_tdata (abfd)->core_lwpid = bfd_get_32 (abfd, note->descdata + 24);
+ elf_tdata (abfd)->core->lwpid = bfd_get_32 (abfd, note->descdata + 24);
/* pr_reg */
offset = 72;
return FALSE;
case 124: /* Linux/am33 elf_prpsinfo */
- elf_tdata (abfd)->core_program
+ elf_tdata (abfd)->core->program
= _bfd_elfcore_strndup (abfd, note->descdata + 28, 16);
- elf_tdata (abfd)->core_command
+ elf_tdata (abfd)->core->command
= _bfd_elfcore_strndup (abfd, note->descdata + 44, 80);
}
implementations, so strip it off if it exists. */
{
- char *command = elf_tdata (abfd)->core_command;
+ char *command = elf_tdata (abfd)->core->command;
int n = strlen (command);
if (0 < n && command[n - 1] == ' ')
case 148: /* Linux/ARM 32-bit. */
/* pr_cursig */
- elf_tdata (abfd)->core_signal = bfd_get_16 (abfd, note->descdata + 12);
+ elf_tdata (abfd)->core->signal = bfd_get_16 (abfd, note->descdata + 12);
/* pr_pid */
- elf_tdata (abfd)->core_lwpid = bfd_get_32 (abfd, note->descdata + 24);
+ elf_tdata (abfd)->core->lwpid = bfd_get_32 (abfd, note->descdata + 24);
/* pr_reg */
offset = 72;
return FALSE;
case 124: /* Linux/ARM elf_prpsinfo. */
- elf_tdata (abfd)->core_pid
+ elf_tdata (abfd)->core->pid
= bfd_get_32 (abfd, note->descdata + 12);
- elf_tdata (abfd)->core_program
+ elf_tdata (abfd)->core->program
= _bfd_elfcore_strndup (abfd, note->descdata + 28, 16);
- elf_tdata (abfd)->core_command
+ elf_tdata (abfd)->core->command
= _bfd_elfcore_strndup (abfd, note->descdata + 44, 80);
}
onto the end of the args in some (at least one anyway)
implementations, so strip it off if it exists. */
{
- char *command = elf_tdata (abfd)->core_command;
+ char *command = elf_tdata (abfd)->core->command;
int n = strlen (command);
if (0 < n && command[n - 1] == ' ')
case 202: /* Linux/CRISv32 */
/* pr_cursig */
- elf_tdata (abfd)->core_signal = bfd_get_16 (abfd, note->descdata + 12);
+ elf_tdata (abfd)->core->signal = bfd_get_16 (abfd, note->descdata + 12);
/* pr_pid */
- elf_tdata (abfd)->core_lwpid = bfd_get_32 (abfd, note->descdata + 22);
+ elf_tdata (abfd)->core->lwpid = bfd_get_32 (abfd, note->descdata + 22);
/* pr_reg */
offset = 70;
case 214: /* Linux/CRIS */
/* pr_cursig */
- elf_tdata (abfd)->core_signal = bfd_get_16 (abfd, note->descdata + 12);
+ elf_tdata (abfd)->core->signal = bfd_get_16 (abfd, note->descdata + 12);
/* pr_pid */
- elf_tdata (abfd)->core_lwpid = bfd_get_32 (abfd, note->descdata + 22);
+ elf_tdata (abfd)->core->lwpid = bfd_get_32 (abfd, note->descdata + 22);
/* pr_reg */
offset = 70;
return FALSE;
case 124: /* Linux/CRISv32 elf_prpsinfo */
- elf_tdata (abfd)->core_program
+ elf_tdata (abfd)->core->program
= _bfd_elfcore_strndup (abfd, note->descdata + 28, 16);
- elf_tdata (abfd)->core_command
+ elf_tdata (abfd)->core->command
= _bfd_elfcore_strndup (abfd, note->descdata + 44, 80);
}
else
return FALSE;
case 124: /* Linux/CRIS elf_prpsinfo */
- elf_tdata (abfd)->core_program
+ elf_tdata (abfd)->core->program
= _bfd_elfcore_strndup (abfd, note->descdata + 28, 16);
- elf_tdata (abfd)->core_command
+ elf_tdata (abfd)->core->command
= _bfd_elfcore_strndup (abfd, note->descdata + 44, 80);
}
implementations, so strip it off if it exists. */
{
- char *command = elf_tdata (abfd)->core_command;
+ char *command = elf_tdata (abfd)->core->command;
int n = strlen (command);
if (0 < n && command[n - 1] == ' ')
struct. */
case 268:
/* `pr_cursig' is at offset 12. */
- elf_tdata (abfd)->core_signal = bfd_get_16 (abfd, note->descdata + 12);
+ elf_tdata (abfd)->core->signal = bfd_get_16 (abfd, note->descdata + 12);
/* `pr_pid' is at offset 24. */
- elf_tdata (abfd)->core_lwpid = bfd_get_32 (abfd, note->descdata + 24);
+ elf_tdata (abfd)->core->lwpid = bfd_get_32 (abfd, note->descdata + 24);
/* `pr_reg' is at offset 72. */
offset = 72;
case 124:
/* `pr_fname' is found at offset 28 and is 16 bytes long. */
- elf_tdata (abfd)->core_program
+ elf_tdata (abfd)->core->program
= _bfd_elfcore_strndup (abfd, note->descdata + 28, 16);
/* `pr_psargs' is found at offset 44 and is 80 bytes long. */
- elf_tdata (abfd)->core_command
+ elf_tdata (abfd)->core->command
= _bfd_elfcore_strndup (abfd, note->descdata + 44, 80);
}
implementations, so strip it off if it exists. */
{
- char *command = elf_tdata (abfd)->core_command;
+ char *command = elf_tdata (abfd)->core->command;
int n = strlen (command);
if (0 < n && command[n - 1] == ' ')
case 396: /* Linux/hppa */
/* pr_cursig */
- elf_tdata (abfd)->core_signal = bfd_get_16 (abfd, note->descdata + 12);
+ elf_tdata (abfd)->core->signal = bfd_get_16 (abfd, note->descdata + 12);
/* pr_pid */
- elf_tdata (abfd)->core_lwpid = bfd_get_32 (abfd, note->descdata + 24);
+ elf_tdata (abfd)->core->lwpid = bfd_get_32 (abfd, note->descdata + 24);
/* pr_reg */
offset = 72;
return FALSE;
case 124: /* Linux/hppa elf_prpsinfo. */
- elf_tdata (abfd)->core_program
+ elf_tdata (abfd)->core->program
= _bfd_elfcore_strndup (abfd, note->descdata + 28, 16);
- elf_tdata (abfd)->core_command
+ elf_tdata (abfd)->core->command
= _bfd_elfcore_strndup (abfd, note->descdata + 44, 80);
}
onto the end of the args in some (at least one anyway)
implementations, so strip it off if it exists. */
{
- char *command = elf_tdata (abfd)->core_command;
+ char *command = elf_tdata (abfd)->core->command;
int n = strlen (command);
if (0 < n && command[n - 1] == ' ')
return FALSE;
/* pr_cursig */
- elf_tdata (abfd)->core_signal = bfd_get_32 (abfd, note->descdata + 20);
+ elf_tdata (abfd)->core->signal = bfd_get_32 (abfd, note->descdata + 20);
/* pr_pid */
- elf_tdata (abfd)->core_lwpid = bfd_get_32 (abfd, note->descdata + 24);
+ elf_tdata (abfd)->core->lwpid = bfd_get_32 (abfd, note->descdata + 24);
/* pr_reg */
offset = 28;
case 144: /* Linux/i386 */
/* pr_cursig */
- elf_tdata (abfd)->core_signal = bfd_get_16 (abfd, note->descdata + 12);
+ elf_tdata (abfd)->core->signal = bfd_get_16 (abfd, note->descdata + 12);
/* pr_pid */
- elf_tdata (abfd)->core_lwpid = bfd_get_32 (abfd, note->descdata + 24);
+ elf_tdata (abfd)->core->lwpid = bfd_get_32 (abfd, note->descdata + 24);
/* pr_reg */
offset = 72;
if (pr_version != 1)
return FALSE;
- elf_tdata (abfd)->core_program
+ elf_tdata (abfd)->core->program
= _bfd_elfcore_strndup (abfd, note->descdata + 8, 17);
- elf_tdata (abfd)->core_command
+ elf_tdata (abfd)->core->command
= _bfd_elfcore_strndup (abfd, note->descdata + 25, 81);
}
else
return FALSE;
case 124: /* Linux/i386 elf_prpsinfo. */
- elf_tdata (abfd)->core_pid
+ elf_tdata (abfd)->core->pid
= bfd_get_32 (abfd, note->descdata + 12);
- elf_tdata (abfd)->core_program
+ elf_tdata (abfd)->core->program
= _bfd_elfcore_strndup (abfd, note->descdata + 28, 16);
- elf_tdata (abfd)->core_command
+ elf_tdata (abfd)->core->command
= _bfd_elfcore_strndup (abfd, note->descdata + 44, 80);
}
}
onto the end of the args in some (at least one anyway)
implementations, so strip it off if it exists. */
{
- char *command = elf_tdata (abfd)->core_command;
+ char *command = elf_tdata (abfd)->core->command;
int n = strlen (command);
if (0 < n && command[n - 1] == ' ')
case 154: /* Linux/m68k */
/* pr_cursig */
- elf_tdata (abfd)->core_signal = bfd_get_16 (abfd, note->descdata + 12);
+ elf_tdata (abfd)->core->signal = bfd_get_16 (abfd, note->descdata + 12);
/* pr_pid */
- elf_tdata (abfd)->core_lwpid = bfd_get_32 (abfd, note->descdata + 22);
+ elf_tdata (abfd)->core->lwpid = bfd_get_32 (abfd, note->descdata + 22);
/* pr_reg */
offset = 70;
return FALSE;
case 124: /* Linux/m68k elf_prpsinfo. */
- elf_tdata (abfd)->core_pid
+ elf_tdata (abfd)->core->pid
= bfd_get_32 (abfd, note->descdata + 12);
- elf_tdata (abfd)->core_program
+ elf_tdata (abfd)->core->program
= _bfd_elfcore_strndup (abfd, note->descdata + 28, 16);
- elf_tdata (abfd)->core_command
+ elf_tdata (abfd)->core->command
= _bfd_elfcore_strndup (abfd, note->descdata + 44, 80);
}
onto the end of the args in some (at least one anyway)
implementations, so strip it off if it exists. */
{
- char *command = elf_tdata (abfd)->core_command;
+ char *command = elf_tdata (abfd)->core->command;
int n = strlen (command);
if (n > 0 && command[n - 1] == ' ')
case 256: /* Linux/MIPS */
/* pr_cursig */
- elf_tdata (abfd)->core_signal = bfd_get_16 (abfd, note->descdata + 12);
+ elf_tdata (abfd)->core->signal = bfd_get_16 (abfd, note->descdata + 12);
/* pr_pid */
- elf_tdata (abfd)->core_lwpid = bfd_get_32 (abfd, note->descdata + 24);
+ elf_tdata (abfd)->core->lwpid = bfd_get_32 (abfd, note->descdata + 24);
/* pr_reg */
offset = 72;
return FALSE;
case 128: /* Linux/MIPS elf_prpsinfo */
- elf_tdata (abfd)->core_program
+ elf_tdata (abfd)->core->program
= _bfd_elfcore_strndup (abfd, note->descdata + 32, 16);
- elf_tdata (abfd)->core_command
+ elf_tdata (abfd)->core->command
= _bfd_elfcore_strndup (abfd, note->descdata + 48, 80);
}
implementations, so strip it off if it exists. */
{
- char *command = elf_tdata (abfd)->core_command;
+ char *command = elf_tdata (abfd)->core->command;
int n = strlen (command);
if (0 < n && command[n - 1] == ' ')
case 212: /* Linux/Nios II */
/* pr_cursig */
- elf_tdata (abfd)->core_signal = bfd_get_16 (abfd, note->descdata + 12);
+ 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);
+ elf_tdata (abfd)->core->pid = bfd_get_32 (abfd, note->descdata + 24);
/* pr_reg */
offset = 72;
return FALSE;
case 124: /* Linux/Nios II elf_prpsinfo */
- elf_tdata (abfd)->core_program
+ elf_tdata (abfd)->core->program
= _bfd_elfcore_strndup (abfd, note->descdata + 28, 16);
- elf_tdata (abfd)->core_command
+ elf_tdata (abfd)->core->command
= _bfd_elfcore_strndup (abfd, note->descdata + 44, 80);
}
implementations, so strip it off if it exists. */
{
- char *command = elf_tdata (abfd)->core_command;
+ char *command = elf_tdata (abfd)->core->command;
int n = strlen (command);
if (0 < n && command[n - 1] == ' ')
case 268: /* Linux/PPC. */
/* pr_cursig */
- elf_tdata (abfd)->core_signal = bfd_get_16 (abfd, note->descdata + 12);
+ elf_tdata (abfd)->core->signal = bfd_get_16 (abfd, note->descdata + 12);
/* pr_pid */
- elf_tdata (abfd)->core_lwpid = bfd_get_32 (abfd, note->descdata + 24);
+ elf_tdata (abfd)->core->lwpid = bfd_get_32 (abfd, note->descdata + 24);
/* pr_reg */
offset = 72;
return FALSE;
case 128: /* Linux/PPC elf_prpsinfo. */
- elf_tdata (abfd)->core_pid
+ elf_tdata (abfd)->core->pid
= bfd_get_32 (abfd, note->descdata + 16);
- elf_tdata (abfd)->core_program
+ elf_tdata (abfd)->core->program
= _bfd_elfcore_strndup (abfd, note->descdata + 32, 16);
- elf_tdata (abfd)->core_command
+ elf_tdata (abfd)->core->command
= _bfd_elfcore_strndup (abfd, note->descdata + 48, 80);
}
implementations, so strip it off if it exists. */
{
- char *command = elf_tdata (abfd)->core_command;
+ char *command = elf_tdata (abfd)->core->command;
int n = strlen (command);
if (0 < n && command[n - 1] == ' ')
case 224: /* S/390 Linux. */
/* pr_cursig */
- elf_tdata (abfd)->core_signal = bfd_get_16 (abfd, note->descdata + 12);
+ elf_tdata (abfd)->core->signal = bfd_get_16 (abfd, note->descdata + 12);
/* pr_pid */
- elf_tdata (abfd)->core_lwpid = bfd_get_32 (abfd, note->descdata + 24);
+ elf_tdata (abfd)->core->lwpid = bfd_get_32 (abfd, note->descdata + 24);
/* pr_reg */
offset = 72;
case 148: /* Linux/Score 32-bit. */
/* pr_cursig */
- elf_tdata (abfd)->core_signal = score_bfd_get_16 (abfd, note->descdata + 12);
+ elf_tdata (abfd)->core->signal
+ = score_bfd_get_16 (abfd, note->descdata + 12);
/* pr_pid */
- elf_tdata (abfd)->core_lwpid = score_bfd_get_32 (abfd, note->descdata + 24);
+ elf_tdata (abfd)->core->lwpid
+ = score_bfd_get_32 (abfd, note->descdata + 24);
/* pr_reg */
offset = 72;
}
/* Make a ".reg/999" section. */
- return _bfd_elfcore_make_pseudosection (abfd, ".reg", raw_size, note->descpos + offset);
+ return _bfd_elfcore_make_pseudosection (abfd, ".reg", raw_size,
+ note->descpos + offset);
}
static bfd_boolean
return FALSE;
case 124: /* Linux/Score elf_prpsinfo. */
- elf_tdata (abfd)->core_program = _bfd_elfcore_strndup (abfd, note->descdata + 28, 16);
- elf_tdata (abfd)->core_command = _bfd_elfcore_strndup (abfd, note->descdata + 44, 80);
+ elf_tdata (abfd)->core->program
+ = _bfd_elfcore_strndup (abfd, note->descdata + 28, 16);
+ elf_tdata (abfd)->core->command
+ = _bfd_elfcore_strndup (abfd, note->descdata + 44, 80);
}
/* Note that for some reason, a spurious space is tacked
implementations, so strip it off if it exists. */
{
- char *command = elf_tdata (abfd)->core_command;
+ char *command = elf_tdata (abfd)->core->command;
int n = strlen (command);
if (0 < n && command[n - 1] == ' ')
case 272: /* Linux/Score elf_prstatus */
/* pr_cursig */
- elf_tdata (abfd)->core_signal = bfd_get_16 (abfd, note->descdata + 12);
+ elf_tdata (abfd)->core->signal = bfd_get_16 (abfd, note->descdata + 12);
/* pr_pid */
- elf_tdata (abfd)->core_lwpid = bfd_get_32 (abfd, note->descdata + 24);
+ elf_tdata (abfd)->core->lwpid = bfd_get_32 (abfd, note->descdata + 24);
/* pr_reg */
offset = 72;
}
/* Make a ".reg/999" section. */
- return _bfd_elfcore_make_pseudosection (abfd, ".reg", raw_size, note->descpos + offset);
+ return _bfd_elfcore_make_pseudosection (abfd, ".reg", raw_size,
+ note->descpos + offset);
}
bfd_boolean
case 128: /* Linux/Score elf_prpsinfo. */
/* pr_fname */
- elf_tdata (abfd)->core_program = _bfd_elfcore_strndup (abfd, note->descdata + 32, 16);
+ elf_tdata (abfd)->core->program
+ = _bfd_elfcore_strndup (abfd, note->descdata + 32, 16);
/* pr_psargs */
- elf_tdata (abfd)->core_command = _bfd_elfcore_strndup (abfd, note->descdata + 48, 80);
+ elf_tdata (abfd)->core->command
+ = _bfd_elfcore_strndup (abfd, note->descdata + 48, 80);
break;
}
implementations, so strip it off if it exists. */
{
- char *command = elf_tdata (abfd)->core_command;
+ char *command = elf_tdata (abfd)->core->command;
int n = strlen (command);
if (0 < n && command[n - 1] == ' ')
case 168: /* Linux/SH */
/* pr_cursig */
- elf_tdata (abfd)->core_signal = bfd_get_16 (abfd, note->descdata + 12);
+ elf_tdata (abfd)->core->signal = bfd_get_16 (abfd, note->descdata + 12);
/* pr_pid */
- elf_tdata (abfd)->core_lwpid = bfd_get_32 (abfd, note->descdata + 24);
+ elf_tdata (abfd)->core->lwpid = bfd_get_32 (abfd, note->descdata + 24);
/* pr_reg */
offset = 72;
return FALSE;
case 124: /* Linux/SH elf_prpsinfo */
- elf_tdata (abfd)->core_program
+ elf_tdata (abfd)->core->program
= _bfd_elfcore_strndup (abfd, note->descdata + 28, 16);
- elf_tdata (abfd)->core_command
+ elf_tdata (abfd)->core->command
= _bfd_elfcore_strndup (abfd, note->descdata + 44, 80);
}
implementations, so strip it off if it exists. */
{
- char *command = elf_tdata (abfd)->core_command;
+ char *command = elf_tdata (abfd)->core->command;
int n = strlen (command);
if (0 < n && command[n - 1] == ' ')
return FALSE;
case 260: /* Solaris prpsinfo_t. */
- elf_tdata (abfd)->core_program
+ elf_tdata (abfd)->core->program
= _bfd_elfcore_strndup (abfd, note->descdata + 84, 16);
- elf_tdata (abfd)->core_command
+ elf_tdata (abfd)->core->command
= _bfd_elfcore_strndup (abfd, note->descdata + 100, 80);
break;
case 336: /* Solaris psinfo_t. */
- elf_tdata (abfd)->core_program
+ elf_tdata (abfd)->core->program
= _bfd_elfcore_strndup (abfd, note->descdata + 88, 16);
- elf_tdata (abfd)->core_command
+ elf_tdata (abfd)->core->command
= _bfd_elfcore_strndup (abfd, note->descdata + 104, 80);
break;
}
return FALSE;
/* pr_cursig */
- elf_tdata (abfd)->core_signal =
+ elf_tdata (abfd)->core->signal =
bfd_get_16 (abfd, note->descdata + TILEGX_PRSTATUS_OFFSET_PR_CURSIG);
/* pr_pid */
- elf_tdata (abfd)->core_pid =
+ elf_tdata (abfd)->core->pid =
bfd_get_32 (abfd, note->descdata + TILEGX_PRSTATUS_OFFSET_PR_PID);
/* pr_reg */
if (note->descsz != TILEGX_PRPSINFO_SIZEOF)
return FALSE;
- elf_tdata (abfd)->core_program
+ elf_tdata (abfd)->core->program
= _bfd_elfcore_strndup (abfd, note->descdata + TILEGX_PRPSINFO_OFFSET_PR_FNAME, 16);
- elf_tdata (abfd)->core_command
+ elf_tdata (abfd)->core->command
= _bfd_elfcore_strndup (abfd, note->descdata + TILEGX_PRPSINFO_OFFSET_PR_PSARGS, ELF_PR_PSARGS_SIZE);
onto the end of the args in some (at least one anyway)
implementations, so strip it off if it exists. */
{
- char *command = elf_tdata (abfd)->core_command;
+ char *command = elf_tdata (abfd)->core->command;
int n = strlen (command);
if (0 < n && command[n - 1] == ' ')
return FALSE;
/* pr_cursig */
- elf_tdata (abfd)->core_signal =
+ elf_tdata (abfd)->core->signal =
bfd_get_16 (abfd, note->descdata + TILEPRO_PRSTATUS_OFFSET_PR_CURSIG);
/* pr_pid */
- elf_tdata (abfd)->core_pid =
+ elf_tdata (abfd)->core->pid =
bfd_get_32 (abfd, note->descdata + TILEPRO_PRSTATUS_OFFSET_PR_PID);
/* pr_reg */
if (note->descsz != TILEPRO_PRPSINFO_SIZEOF)
return FALSE;
- elf_tdata (abfd)->core_program
+ elf_tdata (abfd)->core->program
= _bfd_elfcore_strndup (abfd,
note->descdata + TILEPRO_PRPSINFO_OFFSET_PR_FNAME,
16);
- elf_tdata (abfd)->core_command
+ elf_tdata (abfd)->core->command
= _bfd_elfcore_strndup (abfd,
note->descdata + TILEPRO_PRPSINFO_OFFSET_PR_PSARGS,
ELF_PR_PSARGS_SIZE);
onto the end of the args in some (at least one anyway)
implementations, so strip it off if it exists. */
{
- char *command = elf_tdata (abfd)->core_command;
+ char *command = elf_tdata (abfd)->core->command;
int n = strlen (command);
if (0 < n && command[n - 1] == ' ')
based on the size. Just assume this is GNU/Linux. */
/* pr_cursig */
- elf_tdata (abfd)->core_signal = bfd_get_16 (abfd, note->descdata + 12);
+ elf_tdata (abfd)->core->signal = bfd_get_16 (abfd, note->descdata + 12);
/* pr_pid */
- elf_tdata (abfd)->core_lwpid = bfd_get_32 (abfd, note->descdata + 24);
+ elf_tdata (abfd)->core->lwpid = bfd_get_32 (abfd, note->descdata + 24);
/* pr_reg */
offset = 72;
return FALSE;
case 128: /* GNU/Linux elf_prpsinfo */
- elf_tdata (abfd)->core_program
+ elf_tdata (abfd)->core->program
= _bfd_elfcore_strndup (abfd, note->descdata + 32, 16);
- elf_tdata (abfd)->core_command
+ elf_tdata (abfd)->core->command
= _bfd_elfcore_strndup (abfd, note->descdata + 48, 80);
}
implementations, so strip it off if it exists. */
{
- char *command = elf_tdata (abfd)->core_command;
+ char *command = elf_tdata (abfd)->core->command;
int n = strlen (command);
if (0 < n && command[n - 1] == ' ')
case 408: /* sizeof(struct elf_prstatus) on Linux/arm64. */
/* pr_cursig */
- elf_tdata (abfd)->core_signal
+ elf_tdata (abfd)->core->signal
= bfd_get_16 (abfd, note->descdata + 12);
/* pr_pid */
- elf_tdata (abfd)->core_lwpid
+ elf_tdata (abfd)->core->lwpid
= bfd_get_32 (abfd, note->descdata + 32);
/* pr_reg */
case 760: /* Linux/hppa */
/* pr_cursig */
- elf_tdata (abfd)->core_signal = bfd_get_16 (abfd, note->descdata + 12);
+ elf_tdata (abfd)->core->signal = bfd_get_16 (abfd, note->descdata + 12);
/* pr_pid */
- elf_tdata (abfd)->core_lwpid = bfd_get_32 (abfd, note->descdata + 32);
+ elf_tdata (abfd)->core->lwpid = bfd_get_32 (abfd, note->descdata + 32);
/* pr_reg */
offset = 112;
return FALSE;
case 136: /* Linux/hppa elf_prpsinfo. */
- elf_tdata (abfd)->core_program
+ elf_tdata (abfd)->core->program
= _bfd_elfcore_strndup (abfd, note->descdata + 40, 16);
- elf_tdata (abfd)->core_command
+ elf_tdata (abfd)->core->command
= _bfd_elfcore_strndup (abfd, note->descdata + 56, 80);
}
/* Note that for some reason, a spurious space is tacked
onto the end of the args in some (at least one anyway)
implementations, so strip it off if it exists. */
- command = elf_tdata (abfd)->core_command;
+ command = elf_tdata (abfd)->core->command;
n = strlen (command);
if (0 < n && command[n - 1] == ' ')
if (bfd_bread (&sig, 4, abfd) != 4)
return FALSE;
- elf_tdata (abfd)->core_signal = sig;
+ elf_tdata (abfd)->core->signal = sig;
if (!_bfd_elf_make_section_from_phdr (abfd, hdr, sec_index, typename))
return FALSE;
case 480: /* Linux/MIPS - N64 kernel */
/* pr_cursig */
- elf_tdata (abfd)->core_signal = bfd_get_16 (abfd, note->descdata + 12);
+ elf_tdata (abfd)->core->signal = bfd_get_16 (abfd, note->descdata + 12);
/* pr_pid */
- elf_tdata (abfd)->core_lwpid = bfd_get_32 (abfd, note->descdata + 32);
+ elf_tdata (abfd)->core->lwpid = bfd_get_32 (abfd, note->descdata + 32);
/* pr_reg */
offset = 112;
return FALSE;
case 136: /* Linux/MIPS - N64 kernel elf_prpsinfo */
- elf_tdata (abfd)->core_program
+ elf_tdata (abfd)->core->program
= _bfd_elfcore_strndup (abfd, note->descdata + 40, 16);
- elf_tdata (abfd)->core_command
+ elf_tdata (abfd)->core->command
= _bfd_elfcore_strndup (abfd, note->descdata + 56, 80);
}
implementations, so strip it off if it exists. */
{
- char *command = elf_tdata (abfd)->core_command;
+ char *command = elf_tdata (abfd)->core->command;
int n = strlen (command);
if (0 < n && command[n - 1] == ' ')
return FALSE;
/* pr_cursig */
- elf_tdata (abfd)->core_signal = bfd_get_16 (abfd, note->descdata + 12);
+ elf_tdata (abfd)->core->signal = bfd_get_16 (abfd, note->descdata + 12);
/* pr_pid */
- elf_tdata (abfd)->core_lwpid = bfd_get_32 (abfd, note->descdata + 32);
+ elf_tdata (abfd)->core->lwpid = bfd_get_32 (abfd, note->descdata + 32);
/* pr_reg */
offset = 112;
if (note->descsz != 136)
return FALSE;
- elf_tdata (abfd)->core_pid
+ elf_tdata (abfd)->core->pid
= bfd_get_32 (abfd, note->descdata + 24);
- elf_tdata (abfd)->core_program
+ elf_tdata (abfd)->core->program
= _bfd_elfcore_strndup (abfd, note->descdata + 40, 16);
- elf_tdata (abfd)->core_command
+ elf_tdata (abfd)->core->command
= _bfd_elfcore_strndup (abfd, note->descdata + 56, 80);
return TRUE;
return FALSE;
/* pr_cursig */
- elf_tdata (abfd)->core_signal =
+ elf_tdata (abfd)->core->signal =
bfd_get_16 (abfd, note->descdata + TILEGX_PRSTATUS_OFFSET_PR_CURSIG);
/* pr_pid */
- elf_tdata (abfd)->core_pid =
+ elf_tdata (abfd)->core->pid =
bfd_get_32 (abfd, note->descdata + TILEGX_PRSTATUS_OFFSET_PR_PID);
/* pr_reg */
if (note->descsz != TILEGX_PRPSINFO_SIZEOF)
return FALSE;
- elf_tdata (abfd)->core_program
+ elf_tdata (abfd)->core->program
= _bfd_elfcore_strndup (abfd, note->descdata + TILEGX_PRPSINFO_OFFSET_PR_FNAME, 16);
- elf_tdata (abfd)->core_command
+ elf_tdata (abfd)->core->command
= _bfd_elfcore_strndup (abfd, note->descdata + TILEGX_PRPSINFO_OFFSET_PR_PSARGS, ELF_PR_PSARGS_SIZE);
onto the end of the args in some (at least one anyway)
implementations, so strip it off if it exists. */
{
- char *command = elf_tdata (abfd)->core_command;
+ char *command = elf_tdata (abfd)->core->command;
int n = strlen (command);
if (0 < n && command[n - 1] == ' ')
case 296: /* sizeof(istruct elf_prstatus) on Linux/x32 */
/* pr_cursig */
- elf_tdata (abfd)->core_signal = bfd_get_16 (abfd, note->descdata + 12);
+ elf_tdata (abfd)->core->signal = bfd_get_16 (abfd, note->descdata + 12);
/* pr_pid */
- elf_tdata (abfd)->core_lwpid = bfd_get_32 (abfd, note->descdata + 24);
+ elf_tdata (abfd)->core->lwpid = bfd_get_32 (abfd, note->descdata + 24);
/* pr_reg */
offset = 72;
case 336: /* sizeof(istruct elf_prstatus) on Linux/x86_64 */
/* pr_cursig */
- elf_tdata (abfd)->core_signal
+ elf_tdata (abfd)->core->signal
= bfd_get_16 (abfd, note->descdata + 12);
/* pr_pid */
- elf_tdata (abfd)->core_lwpid
+ elf_tdata (abfd)->core->lwpid
= bfd_get_32 (abfd, note->descdata + 32);
/* pr_reg */
return FALSE;
case 124: /* sizeof(struct elf_prpsinfo) on Linux/x32 */
- elf_tdata (abfd)->core_pid
+ elf_tdata (abfd)->core->pid
= bfd_get_32 (abfd, note->descdata + 12);
- elf_tdata (abfd)->core_program
+ elf_tdata (abfd)->core->program
= _bfd_elfcore_strndup (abfd, note->descdata + 28, 16);
- elf_tdata (abfd)->core_command
+ elf_tdata (abfd)->core->command
= _bfd_elfcore_strndup (abfd, note->descdata + 44, 80);
break;
case 136: /* sizeof(struct elf_prpsinfo) on Linux/x86_64 */
- elf_tdata (abfd)->core_pid
+ elf_tdata (abfd)->core->pid
= bfd_get_32 (abfd, note->descdata + 24);
- elf_tdata (abfd)->core_program
+ elf_tdata (abfd)->core->program
= _bfd_elfcore_strndup (abfd, note->descdata + 40, 16);
- elf_tdata (abfd)->core_command
+ elf_tdata (abfd)->core->command
= _bfd_elfcore_strndup (abfd, note->descdata + 56, 80);
}
implementations, so strip it off if it exists. */
{
- char *command = elf_tdata (abfd)->core_command;
+ char *command = elf_tdata (abfd)->core->command;
int n = strlen (command);
if (0 < n && command[n - 1] == ' ')
char*
elf_core_file_failing_command (bfd *abfd)
{
- return elf_tdata (abfd)->core_command;
+ return elf_tdata (abfd)->core->command;
}
int
elf_core_file_failing_signal (bfd *abfd)
{
- return elf_tdata (abfd)->core_signal;
+ return elf_tdata (abfd)->core->signal;
}
int
elf_core_file_pid (bfd *abfd)
{
- return elf_tdata (abfd)->core_pid;
+ return elf_tdata (abfd)->core->pid;
}
bfd_boolean
}
/* See if the name in the corefile matches the executable name. */
- corename = elf_tdata (core_bfd)->core_program;
+ corename = elf_tdata (core_bfd)->core->program;
if (corename != NULL)
{
const char* execname = strrchr (exec_bfd->filename, '/');
case 440: /* Linux/MIPS N32 */
/* pr_cursig */
- elf_tdata (abfd)->core_signal = bfd_get_16 (abfd, note->descdata + 12);
+ elf_tdata (abfd)->core->signal = bfd_get_16 (abfd, note->descdata + 12);
/* pr_pid */
- elf_tdata (abfd)->core_lwpid = bfd_get_32 (abfd, note->descdata + 24);
+ elf_tdata (abfd)->core->lwpid = bfd_get_32 (abfd, note->descdata + 24);
/* pr_reg */
offset = 72;
return FALSE;
case 128: /* Linux/MIPS elf_prpsinfo */
- elf_tdata (abfd)->core_program
+ elf_tdata (abfd)->core->program
= _bfd_elfcore_strndup (abfd, note->descdata + 32, 16);
- elf_tdata (abfd)->core_command
+ elf_tdata (abfd)->core->command
= _bfd_elfcore_strndup (abfd, note->descdata + 48, 80);
}
implementations, so strip it off if it exists. */
{
- char *command = elf_tdata (abfd)->core_command;
+ char *command = elf_tdata (abfd)->core->command;
int n = strlen (command);
if (0 < n && command[n - 1] == ' ')