asection *current;
asection *previous = (asection *) NULL;
file_ptr sofar = FILHSZ;
- int page_size;
+
#ifndef I960
file_ptr old_sofar;
#endif
#ifdef COFF_IMAGE_WITH_PE
+ int page_size;
if (coff_data (abfd)->link_info)
{
page_size = pe_value (&(coff_data (abfd)->link_info->pe_info->file_alignment),
}
else
page_size = PE_DEF_FILE_ALIGNMENT;
-#else
- page_size = COFF_PAGE_SIZE;
+#elif defined (COFF_PAGE_SIZE)
+ int page_size = COFF_PAGE_SIZE;
#endif
+
if (bfd_get_start_address (abfd))
{
/* A start address may have been added to the original file. In this
/* In demand paged files the low order bits of the file offset
must match the low order bits of the virtual address. */
+#ifdef COFF_PAGE_SIZE
if ((abfd->flags & D_PAGED) != 0
&& (current->flags & SEC_ALLOC) != 0)
sofar += (current->vma - sofar) % page_size;
+#endif
current->filepos = sofar;
internal_a->entry -= ib;
- sa = internal_a->pe->SectionAlignment = pe_value (&pe_info->section_alignment,
- NT_SECTION_ALIGNMENT);
+ sa = internal_a->pe->SectionAlignment = pe_value (&pe_info->section_alignment,
+ NT_SECTION_ALIGNMENT);
- fa = internal_a->pe->FileAlignment = pe_value (&pe_info->file_alignment,
- NT_FILE_ALIGNMENT);
+ fa = internal_a->pe->FileAlignment = pe_value (&pe_info->file_alignment,
+ NT_FILE_ALIGNMENT);
#define FA(x) (((x) + fa -1 ) & (- fa))
#define SA(x) (((x) + sa -1 ) & (- sa))
structure are in order and that I have successfully saved the last
section's address and size. */
-
-
/* The headers go up to where the first section starts. */
internal_a->pe->SizeOfHeaders = abfd->sections->filepos;
bfd_vma dsize= 0;
bfd_vma isize = SA(abfd->sections->filepos);
bfd_vma tsize= 0;
- bfd_vma dstart = 0;
for (sec = abfd->sections; sec; sec = sec->next)
{
int rounded = FA(sec->_raw_size);