if (strncmp (p, "-export:", 8) == 0 || strncmp (p, "/EXPORT:", 8) == 0) {
+ struct name_list *name_list;
char *q, saved_ch;
- int data;
- struct name_list *name_list;
char *comma;
+ int data = 0;
p += 8;
fseek (outfile, sizeof (struct ar_header), SEEK_CUR);
offset2 = ftell (outfile);
- symbol_count = swap_bytes (3 + num_names, 4);
+ symbol_count = swap_bytes (3 + (num_names * 2), 4);
offset2 += write_data (outfile, &symbol_count, 4);
- fseek (outfile, (3 + num_names) * 4, SEEK_CUR);
+ fseek (outfile, (3 + (num_names * 2)) * 4, SEEK_CUR);
offset2 = ftell (outfile);
- for (info = info_list; info; info = info->next) {
+ for (info = info_list, i = 0; info; info = info->next, i++) {
+
+ if (i >= 3) {
+ offset2 += write_data (outfile, info->name + 6, (info->name_length - 6) + 1);
+ }
+
offset2 += write_data (outfile, info->name, info->name_length + 1);
+
}
fseek (outfile, offset, SEEK_SET);
}
- if (kill_at) {
- type |= IMPORT_NAME_UNDECORATE << 2;
- }
+ type |= (kill_at ? IMPORT_NAME_UNDECORATE : IMPORT_NAME_NOPREFIX) << 2;
- integer_to_array (type | (IMPORT_NAME_NOPREFIX << 2), import_hdr.Type, 2);
+ integer_to_array (type, import_hdr.Type, 2);
offset2 += write_data (outfile, &import_hdr, sizeof (import_hdr));
name = xmalloc (1 + strlen (export_names[i].name) + 1);
offset3 = offsets[1 + i];
offset3 = swap_bytes (offset3, 4);
+ if (i >= 3) {
+ offset2 += write_data (outfile, &offset3, 4);
+ }
+
offset2 += write_data (outfile, &offset3, 4);
}