bout_swap_exec_header_out (abfd, exec_hdr (abfd), &swapped_hdr);
- bfd_seek (abfd, 0L, SEEK_SET);
+ bfd_seek (abfd, (file_ptr) 0, SEEK_SET);
bfd_write ((PTR) &swapped_hdr, 1, EXEC_BYTES_SIZE, abfd);
/* Now write out reloc info, followed by syms and strings */
if (bfd_get_symcount (abfd) != 0)
{
- bfd_seek (abfd,
- (long)(N_SYMOFF(*exec_hdr(abfd))), SEEK_SET);
+ bfd_seek (abfd, (file_ptr)(N_SYMOFF(*exec_hdr(abfd))), SEEK_SET);
aout_32_write_syms (abfd);
- bfd_seek (abfd, (long)(N_TROFF(*exec_hdr(abfd))), SEEK_SET);
+ bfd_seek (abfd, (file_ptr)(N_TROFF(*exec_hdr(abfd))), SEEK_SET);
if (!b_out_squirt_out_relocs (abfd, obj_textsec (abfd))) return false;
- bfd_seek (abfd, (long)(N_DROFF(*exec_hdr(abfd))), SEEK_SET);
+ bfd_seek (abfd, (file_ptr)(N_DROFF(*exec_hdr(abfd))), SEEK_SET);
if (!b_out_squirt_out_relocs (abfd, obj_datasec (abfd))) return false;
}
return false;
doit:
- bfd_seek (abfd, (long)(asect->rel_filepos), SEEK_SET);
+ bfd_seek (abfd, (file_ptr)(asect->rel_filepos), SEEK_SET);
count = reloc_size / sizeof (struct relocation_info);
relocs = (struct relocation_info *) bfd_xmalloc (reloc_size);
{
bfd_vma value;
asymbol *symbol = *(reloc->sym_ptr_ptr);
+
/* A symbol holds a pointer to a section, and an offset from the
base of the section. To relocate, we find where the section will
live in the output and add that in */
symbol->section->output_offset +
symbol->section->output_section->vma;
}
-
-
+
/* Add the value contained in the relocation */
value += (short)((reloc->addend) & 0xffff);
if (-1<<23 < (long)gap && (long)gap < 1<<23 )
{
-
/* Change the reloc type from 32bitcode possible 24, to 24bit
possible 32 */
/* This will be four bytes smaller in the long run */
shrink += 4 ;
perform_slip(symbols, 4, input_section, r->address-shrink +4);
-
-
}
return shrink;
}
arelent *r AND
unsigned int shrink)
{
- bfd_vma value = get_value(r,0);
-
bfd_vma dot = input_section->output_section->vma + input_section->output_offset + r->address;
bfd_vma gap;
bfd_vma old_end;
bfd_vma new_end;
- int shrink_delta;
-int size = r->howto->size;
+ int shrink_delta;
+ int size = r->howto->size;
+
/* Reduce the size of the alignment so that it's still aligned but
smaller - the current size is already the same size as or bigger
than the alignment required. */
-
-
/* calculate the first byte following the padding before we optimize */
old_end = ((dot + size ) & ~size) + size+1;
/* work out where the new end will be - remember that we're smaller
if (shrink_delta)
{
-
/* Change the reloc so that it knows how far to align to */
r->howto = howto_done_align_table + (r->howto - howto_align_table);
r->addend = old_end ;
/* This will be N bytes smaller in the long run, adjust all the symbols */
-
-
-
perform_slip(symbols, shrink_delta, input_section, r->address - shrink );
shrink += shrink_delta;
}