aboutsummaryrefslogtreecommitdiff
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
commit9a4c7f16697de0aea00870e4b6b183b149596ceb (patch)
tree40946176390a99333d4e9c514238c947a632b913 /bfd/xcofflink.c
parentf3989180859c653c4c59720a0bf706479561884c (diff)
downloadfsf-binutils-gdb-9a4c7f16697de0aea00870e4b6b183b149596ceb.zip
fsf-binutils-gdb-9a4c7f16697de0aea00870e4b6b183b149596ceb.tar.gz
fsf-binutils-gdb-9a4c7f16697de0aea00870e4b6b183b149596ceb.tar.bz2
-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 af6ebb1..e27f648 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