+ /* fprintf(stderr, "BSS anon section at 0x%x\n", zspace); */
+ }
+
+ /* Copy section information into the ObjectCode. */
+
+ for (i = 0; i < hdr->NumberOfSections; i++) {
+ UChar* start;
+ UChar* end;
+ UInt32 sz;
+
+ SectionKind kind
+ = SECTIONKIND_OTHER;
+ COFF_section* sectab_i
+ = (COFF_section*)
+ myindex ( sizeof_COFF_section, sectab, i );
+ IF_DEBUG(linker, belch("section name = %s\n", sectab_i->Name ));
+
+# if 0
+ /* I'm sure this is the Right Way to do it. However, the
+ alternative of testing the sectab_i->Name field seems to
+ work ok with Cygwin.
+ */
+ if (sectab_i->Characteristics & MYIMAGE_SCN_CNT_CODE ||
+ sectab_i->Characteristics & MYIMAGE_SCN_CNT_INITIALIZED_DATA)
+ kind = SECTIONKIND_CODE_OR_RODATA;
+# endif
+
+ if (0==strcmp(".text",sectab_i->Name) ||
+ 0==strcmp(".rodata",sectab_i->Name))
+ kind = SECTIONKIND_CODE_OR_RODATA;
+ if (0==strcmp(".data",sectab_i->Name) ||
+ 0==strcmp(".bss",sectab_i->Name))
+ kind = SECTIONKIND_RWDATA;
+
+ ASSERT(sectab_i->SizeOfRawData == 0 || sectab_i->VirtualSize == 0);
+ sz = sectab_i->SizeOfRawData;
+ if (sz < sectab_i->VirtualSize) sz = sectab_i->VirtualSize;
+
+ start = ((UChar*)(oc->image)) + sectab_i->PointerToRawData;
+ end = start + sz - 1;
+
+ if (kind == SECTIONKIND_OTHER) {
+ belch("Unknown PEi386 section name `%s'", sectab_i->Name);
+ return 0;
+ }
+
+ if (end >= start) {
+ addSection(oc, kind, start, end);
+ addProddableBlock(oc, start, end - start + 1);
+ }