/* THIS MODULE IS NOT FINISHED. IT PROBABLY DOESN'T EVEN COMPILE. */
#if 0
-#define PAGE_SIZE 4096
-#define SEGMENT_SIZE PAGE_SIZE
+#define TARGET_PAGE_SIZE 4096
+#define SEGMENT_SIZE TARGET_PAGE_SIZE
#define TEXT_START_ADDR 0
#define BYTES_IN_WORD 4
#endif
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define TARGET_IS_BIG_ENDIAN_P
-#define PAGE_SIZE 4096
+#define TARGET_PAGE_SIZE 4096
#define SEGMENT_SIZE 4096
#define TEXT_START_ADDR 0x0
/* #define N_HEADER_IN_TEXT(x) 0 */
/* Don't set sizes now -- can't be sure until we know arch & mach.
Sizes get set in set_sizes callback, later. */
#if 0
- adata(abfd).page_size = PAGE_SIZE;
+ adata(abfd).page_size = TARGET_PAGE_SIZE;
#ifdef SEGMENT_SIZE
adata(abfd).segment_size = SEGMENT_SIZE;
#else
- adata(abfd).segment_size = PAGE_SIZE;
+ adata(abfd).segment_size = TARGET_PAGE_SIZE;
#endif
adata(abfd).exec_bytes_size = EXEC_BYTES_SIZE;
#endif
return false;
#if 0 /* Sizes get set in set_sizes callback, later, after we know
the architecture and machine. */
- adata(abfd).page_size = PAGE_SIZE;
+ adata(abfd).page_size = TARGET_PAGE_SIZE;
#ifdef SEGMENT_SIZE
adata(abfd).segment_size = SEGMENT_SIZE;
#else
- adata(abfd).segment_size = PAGE_SIZE;
+ adata(abfd).segment_size = TARGET_PAGE_SIZE;
#endif
adata(abfd).exec_bytes_size = EXEC_BYTES_SIZE;
#endif
MY(set_sizes) (abfd)
bfd *abfd;
{
- adata(abfd).page_size = PAGE_SIZE;
+ adata(abfd).page_size = TARGET_PAGE_SIZE;
#ifdef SEGMENT_SIZE
adata(abfd).segment_size = SEGMENT_SIZE;
#else
- adata(abfd).segment_size = PAGE_SIZE;
+ adata(abfd).segment_size = TARGET_PAGE_SIZE;
#endif
#ifdef ZMAGIC_DISK_BLOCK_SIZE
adata(abfd).zmagic_disk_block_size = ZMAGIC_DISK_BLOCK_SIZE;
#else
- adata(abfd).zmagic_disk_block_size = PAGE_SIZE;
+ adata(abfd).zmagic_disk_block_size = TARGET_PAGE_SIZE;
#endif
adata(abfd).exec_bytes_size = EXEC_BYTES_SIZE;
#ifndef MY_write_armap
#define MY_write_armap bsd_write_armap
#endif
+#ifndef MY_read_ar_hdr
+#define MY_read_ar_hdr _bfd_generic_read_ar_hdr
+#endif
#ifndef MY_truncate_arname
#define MY_truncate_arname bfd_bsd_truncate_arname
#endif
#define MY_swap_std_reloc_out NAME(aout,swap_std_reloc_out)
#endif
+#ifndef MY_final_link_relocate
+#define MY_final_link_relocate _bfd_final_link_relocate
+#endif
+
+#ifndef MY_relocate_contents
+#define MY_relocate_contents _bfd_relocate_contents
+#endif
+
#define howto_table_ext NAME(aout,ext_howto_table)
#define howto_table_std NAME(aout,std_howto_table)
break;
}
- adata(abfd)->page_size = PAGE_SIZE;
+ adata(abfd)->page_size = TARGET_PAGE_SIZE;
adata(abfd)->segment_size = SEGMENT_SIZE;
adata(abfd)->exec_bytes_size = EXEC_BYTES_SIZE;
/* Rule (heuristic) for when to pad to a new page. Note that there
are (at least) two ways demand-paged (ZMAGIC) files have been
handled. Most Berkeley-based systems start the text segment at
- (PAGE_SIZE). However, newer versions of SUNOS start the text
+ (TARGET_PAGE_SIZE). However, newer versions of SUNOS start the text
segment right after the exec header; the latter is counted in the
text segment size, and is paged in by the kernel with the rest of
the text. */
goto error_return;
}
+ /* If we have a symbol named __DYNAMIC, force it out now. This is
+ required by SunOS. Doing this here rather than in sunos.c is a
+ hack, but it's easier than exporting everything which would be
+ needed. */
+ {
+ struct aout_link_hash_entry *h;
+
+ h = aout_link_hash_lookup (aout_hash_table (info), "__DYNAMIC",
+ false, false, false);
+ if (h != NULL)
+ aout_link_write_other_symbol (h, &aout_info);
+ }
+
/* The most time efficient way to do the link would be to read all
the input object files into memory and then sort out the
information into the output file. Unfortunately, that will
if (relocation == 0)
r = bfd_reloc_ok;
else
- r = _bfd_relocate_contents (howto,
+ r = MY_relocate_contents (howto,
input_bfd, relocation,
contents + r_addr);
}
return false;
}
- r = _bfd_final_link_relocate (howto,
+ r = MY_final_link_relocate (howto,
input_bfd, input_section,
contents, r_addr, relocation,
(bfd_vma) 0);
return false;
}
- r = _bfd_final_link_relocate (howto_table_ext + r_type,
+ r = MY_final_link_relocate (howto_table_ext + r_type,
input_bfd, input_section,
contents, r_addr, relocation,
r_addend);
bfd_set_error (bfd_error_no_memory);
return false;
}
- r = _bfd_relocate_contents (howto, finfo->output_bfd,
+ r = MY_relocate_contents (howto, finfo->output_bfd,
pr->addend, buf);
switch (r)
{
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-#define PAGE_SIZE 4096
+#define TARGET_PAGE_SIZE 4096
#define ZMAGIC_DISK_BLOCK_SIZE 1024
#define SEGMENT_SIZE 4096
#define TEXT_START_ADDR 0x0
if (p != NULL)
alloc = (char *) malloc (strlen (name) + 1);
- /* FIXME! BFD should not call printf! */
if (p == NULL || alloc == NULL)
- fprintf (stderr, "Output file requires shared library `%s'\n", name);
+ (*_bfd_error_handler) ("Output file requires shared library `%s'\n",
+ name);
else
{
strcpy (alloc, name);
p = strrchr (alloc, '_');
*p++ = '\0';
- fprintf (stderr,
- "Output file requires shared library `%s.so.%s'\n",
- alloc, p);
+ (*_bfd_error_handler)
+ ("Output file requires shared library `%s.so.%s'\n",
+ alloc, p);
free (alloc);
}
if (f->h->root.root.type != bfd_link_hash_defined
&& f->h->root.root.type != bfd_link_hash_defweak)
{
- /* FIXME! */
- fprintf (stderr,
- "Symbol %s not defined for fixups\n",
- f->h->root.root.root.string);
+ (*_bfd_error_handler)
+ ("Symbol %s not defined for fixups\n",
+ f->h->root.root.root.string);
continue;
}
if (f->h->root.root.type != bfd_link_hash_defined
&& f->h->root.root.type != bfd_link_hash_defweak)
{
- /* FIXME! */
- fprintf (stderr,
- "Symbol %s not defined for fixups\n",
- f->h->root.root.root.string);
+ (*_bfd_error_handler)
+ ("Symbol %s not defined for fixups\n",
+ f->h->root.root.root.string);
continue;
}
if (linux_hash_table (info)->fixup_count != fixups_written)
{
- /* FIXME! */
- fprintf (stderr, "Warning: fixup count mismatch\n");
+ (*_bfd_error_handler) ("Warning: fixup count mismatch\n");
while (linux_hash_table (info)->fixup_count > fixups_written)
{
bfd_put_32 (output_bfd, 0, fixup_table);
#define N_SHARED_LIB(x) 0
#define TEXT_START_ADDR 0
-#define PAGE_SIZE 4096
-#define SEGMENT_SIZE PAGE_SIZE
+#define TARGET_PAGE_SIZE 4096
+#define SEGMENT_SIZE TARGET_PAGE_SIZE
#define DEFAULT_ARCH bfd_arch_m68k
#define MY(OP) CAT(m68klynx_aout_,OP)