summaryrefslogtreecommitdiff
path: root/bfd/xcofflink.c
diff options
context:
space:
mode:
authorTom Rix <trix@redhat.com>2001-12-22 17:18:34 +0000
committerTom Rix <trix@redhat.com>2001-12-22 17:18:34 +0000
commitb389db54556f12f3aa1efb67a3fdbfa951ecf9d6 (patch)
treeb2a12e8875cb29113f6f9b13fbe198bca8bcd34d /bfd/xcofflink.c
parentd5bfdcc382dc7d4da871e53c99809df55091abcf (diff)
downloadgdb-b389db54556f12f3aa1efb67a3fdbfa951ecf9d6.tar.gz
-binitfini emulation, put __rtinit symbol generation into linker.
Diffstat (limited to 'bfd/xcofflink.c')
-rw-r--r--bfd/xcofflink.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/bfd/xcofflink.c b/bfd/xcofflink.c
index af6ebb1818e..e27f648d048 100644
--- a/bfd/xcofflink.c
+++ b/bfd/xcofflink.c
@@ -3219,6 +3219,41 @@ bfd_xcoff_size_dynamic_sections (output_bfd, info, libpath, entry,
return false;
}
+boolean
+bfd_xcoff_link_generate_rtinit (abfd, init, fini)
+ bfd *abfd;
+ const char *init;
+ const char *fini;
+{
+ struct bfd_in_memory *bim;
+
+ bim = ((struct bfd_in_memory *)
+ bfd_malloc ((bfd_size_type) sizeof (struct bfd_in_memory)));
+ if (bim == NULL)
+ return false;
+
+ bim->size = 0;
+ bim->buffer = 0;
+
+ abfd->link_next = 0;
+ abfd->format = bfd_object;
+ abfd->iostream = (PTR) bim;
+ abfd->flags = BFD_IN_MEMORY;
+ abfd->direction = write_direction;
+ abfd->where = 0;
+
+ if (false == bfd_xcoff_generate_rtinit (abfd, init, fini))
+ return false;
+
+ /* need to reset to unknown or it will not be read back in correctly */
+ abfd->format = bfd_unknown;
+ abfd->direction = read_direction;
+ abfd->where = 0;
+
+ return true;
+}
+
+
/* Add a symbol to the .loader symbols, if necessary. */
static boolean