aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorNiklas Hallqvist <niklas@cygnus>1995-10-28 00:26:12 +0000
committerNiklas Hallqvist <niklas@cygnus>1995-10-28 00:26:12 +0000
commit34e9ffbccc6dc8647f40b1f5468319b358337e48 (patch)
treee8c4bfbd4fd2810f8216437284a56b3690800f80 /bfd
parentcf79773cb15480249935afb17a25f847550570b7 (diff)
downloadgdb-34e9ffbccc6dc8647f40b1f5468319b358337e48.zip
gdb-34e9ffbccc6dc8647f40b1f5468319b358337e48.tar.gz
gdb-34e9ffbccc6dc8647f40b1f5468319b358337e48.tar.bz2
Change PAGE_SIZE to TARGET_PAGE_SIZE
Diffstat (limited to 'bfd')
-rw-r--r--bfd/aout-encap.c4
-rw-r--r--bfd/aout-rce.c2
-rw-r--r--bfd/aout-target.h17
-rw-r--r--bfd/aoutx.h33
-rw-r--r--bfd/i386linux.c29
-rw-r--r--bfd/m68klynx.c4
6 files changed, 55 insertions, 34 deletions
diff --git a/bfd/aout-encap.c b/bfd/aout-encap.c
index eb74608..c25f9037 100644
--- a/bfd/aout-encap.c
+++ b/bfd/aout-encap.c
@@ -20,8 +20,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* 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
diff --git a/bfd/aout-rce.c b/bfd/aout-rce.c
index f83e5f9..e8664f9 100644
--- a/bfd/aout-rce.c
+++ b/bfd/aout-rce.c
@@ -18,7 +18,7 @@ along with this program; if not, write to the Free Software
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 */
diff --git a/bfd/aout-target.h b/bfd/aout-target.h
index 6e0fccc..3813826 100644
--- a/bfd/aout-target.h
+++ b/bfd/aout-target.h
@@ -85,11 +85,11 @@ MY(callback) (abfd)
/* 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
@@ -170,11 +170,11 @@ MY(mkobject) (abfd)
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
@@ -236,18 +236,18 @@ static boolean
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;
@@ -365,6 +365,9 @@ MY_bfd_final_link (abfd, info)
#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
diff --git a/bfd/aoutx.h b/bfd/aoutx.h
index f5921cc..6571302 100644
--- a/bfd/aoutx.h
+++ b/bfd/aoutx.h
@@ -165,6 +165,14 @@ DESCRIPTION
#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)
@@ -549,7 +557,7 @@ NAME(aout,some_aout_object_p) (abfd, execp, callback_to_real_object_p)
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;
@@ -1048,7 +1056,7 @@ NAME(aout,adjust_sizes_and_vmas) (abfd, text_size, text_end)
/* 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. */
@@ -3548,6 +3556,19 @@ NAME(aout,final_link) (abfd, info, callback)
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
@@ -4566,7 +4587,7 @@ aout_link_input_section_std (finfo, input_bfd, input_section, relocs,
if (relocation == 0)
r = bfd_reloc_ok;
else
- r = _bfd_relocate_contents (howto,
+ r = MY_relocate_contents (howto,
input_bfd, relocation,
contents + r_addr);
}
@@ -4635,7 +4656,7 @@ aout_link_input_section_std (finfo, input_bfd, input_section, relocs,
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);
@@ -5019,7 +5040,7 @@ aout_link_input_section_ext (finfo, input_bfd, input_section, relocs,
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);
@@ -5207,7 +5228,7 @@ aout_link_reloc_link_order (finfo, o, p)
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)
{
diff --git a/bfd/i386linux.c b/bfd/i386linux.c
index ebc9388..d46f622 100644
--- a/bfd/i386linux.c
+++ b/bfd/i386linux.c
@@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License
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
@@ -441,17 +441,17 @@ linux_tally_symbols (h, data)
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);
}
@@ -637,10 +637,9 @@ linux_finish_dynamic_link (output_bfd, info)
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;
}
@@ -688,10 +687,9 @@ linux_finish_dynamic_link (output_bfd, info)
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;
}
@@ -714,8 +712,7 @@ linux_finish_dynamic_link (output_bfd, info)
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);
diff --git a/bfd/m68klynx.c b/bfd/m68klynx.c
index 33e1fcc..7acdfbc 100644
--- a/bfd/m68klynx.c
+++ b/bfd/m68klynx.c
@@ -21,8 +21,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#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)