unsigned char *lib;
struct libent
{
- long len;
- long unk;
- char filename[1];
+ bfd_byte len[4];
+ bfd_byte nameoffset[4];
};
libsize = bfd_section_size (exec_bfd, libsect);
- lib = alloca (libsize);
+ lib = (unsigned char *) alloca (libsize);
bfd_get_section_contents (exec_bfd, libsect, lib, 0, libsize);
{
struct libent *ent;
struct objfile *objfile;
+ int len, nameoffset;
+ char *filename;
ent = (struct libent *)lib;
- if (ent->len <= 0)
+ len = bfd_get_32 (exec_bfd, ent->len);
+
+ nameoffset = bfd_get_32 (exec_bfd, ent->nameoffset);
+
+ if (len <= 0)
break;
- objfile = symbol_file_add (ent->filename, from_tty,
+ filename = (char *)ent + nameoffset * 4;
+
+ objfile = symbol_file_add (filename, from_tty,
0, /* addr */
0, /* not mainline */
0, /* not mapped */
0); /* Not readnow */
- libsize -= ent->len * 4;
- lib += ent->len * 4;
+ libsize -= len * 4;
+ lib += len * 4;
}
}
}