#include "xcoffsolib.h"
#include "symfile.h"
#include "objfiles.h"
-#include "libbfd.h" /* BFD internals (sigh!) FIXME */
+#include "libbfd.h" /* For bfd_cache_lookup (FIXME) */
#include "bfd.h"
#include <sys/ptrace.h>
fatal ("cannot find BFD's iostream for %s", vp->name);
/* See if we are referring to the same file. */
+ /* An error here is innocuous, most likely meaning that
+ the file descriptor has become worthless. */
if (fstat (fileno(io), &vi) < 0)
- fatal ("cannot fstat(fd=%d) the BFD for %s (errno=%d)",
- fileno(io), vp->name, errno);
+ continue;
if (ii.st_dev != vi.st_dev || ii.st_ino != vi.st_ino)
continue;
from the core file. */
void
-xcoff_relocate_core ()
+xcoff_relocate_core (target)
+ struct target_ops *target;
{
/* Offset of member MEMBER in a struct of type TYPE. */
#ifndef offsetof
vp->dstart = (CORE_ADDR) ldip->ldinfo_dataorg;
vp->dend = vp->dstart + ldip->ldinfo_datasize;
- if (vp->tadj != 0) {
- vp->tstart += vp->tadj;
- vp->tend += vp->tadj;
- }
+ if (vp->tadj != 0)
+ {
+ vp->tstart += vp->tadj;
+ vp->tend += vp->tadj;
+ }
/* Unless this is the exec file,
add our sections to the section table for the core target. */
int count;
struct section_table *stp;
- count = core_ops.to_sections_end - core_ops.to_sections;
+ count = target->to_sections_end - target->to_sections;
count += 2;
- core_ops.to_sections = (struct section_table *)
- xrealloc (core_ops.to_sections,
+ target->to_sections = (struct section_table *)
+ xrealloc (target->to_sections,
sizeof (struct section_table) * count);
- core_ops.to_sections_end = core_ops.to_sections + count;
- stp = core_ops.to_sections_end - 2;
+ target->to_sections_end = target->to_sections + count;
+ stp = target->to_sections_end - 2;
/* "Why do we add bfd_section_vma?", I hear you cry.
Well, the start of the section in the file is actually