gcl-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gcl-devel] BFD related issues


From: Aurelien Chanudet
Subject: Re: [Gcl-devel] BFD related issues
Date: Sat, 21 Feb 2004 08:38:27 +0100

> Hi Aurelien!  What's the status of your bfd patches?

Hi Camm !

I'm planning to apply my patches to the local bfd tree during the week-end. On top of that, I'm using the following patch. Everything is up and running.

Aurelien

Index: sfaslbfd.c
===================================================================
RCS file: /cvsroot/gcl/gcl/o/sfaslbfd.c,v
retrieving revision 1.13
diff -u -r1.13 sfaslbfd.c
--- sfaslbfd.c  6 Aug 2003 17:03:40 -0000       1.13
+++ sfaslbfd.c  21 Feb 2004 07:29:53 -0000
@@ -40,7 +40,13 @@
 #include "gclincl.h"
 #include <string.h>

-
+#if defined(DARWIN)
+asection *
+bfd_mach_o_craft_fp_branch_islands PARAMS ((bfd *));
+
+MY_BFD_BOOLEAN
+bfd_mach_o_inject_fp_branch_islands PARAMS ((bfd *, asection *, asymbol **));
+#endif

 /* align for power of two n */
 static void *
@@ -194,6 +200,11 @@
   static union lispunion dum;
   static struct bfd_link_callbacks link_callbacks;
   static struct bfd_link_order link_order;
+  char entry_name [256];
+
+#if defined(DARWIN)
+  asection *bi;
+#endif

   if (!nbfd) {

@@ -232,6 +243,11 @@
     FEerror("Unknown bfd error code on check_format",0);
   bfd_set_error(0);

+#if defined(DARWIN)
+  if ((bi = bfd_mach_o_craft_fp_branch_islands (b)) == NULL)
+    FEerror ("Could not craft fp register preservation stubs",0);
+#endif
+
   current=NULL;
   for (s=b->sections;s;s=s->next) {

@@ -281,11 +297,17 @@
   q=(asymbol **)alloca(u);
   if ((v=bfd_canonicalize_symtab(b,q))<0)
     FEerror("cannot canonicalize symtab",0);
+
+  if (bfd_get_symbol_leading_char (b) != 0)
+ snprintf (entry_name, 255, "%cinit_", bfd_get_symbol_leading_char (b));
+  else
+    snprintf (entry_name, 255, "init_");
+
   for (u=0;u<v;u++) {

     struct bfd_link_hash_entry *h;

-    if (!strncmp("init_",q[u]->name,5)) {
+    if (!strncmp(entry_name, q[u]->name,5)) {
       init_address=q[u]->value;
       continue;
     }
@@ -303,6 +325,11 @@
       FEerror("Symbol without section",0);

   }
+
+  #if defined(DARWIN)
+  if (!bfd_mach_o_inject_fp_branch_islands (b, bi, q))
+    FEerror("Could not inject fp register preservation sutbs",0);
+  #endif

 #ifndef HAVE_ALLOCA
 #error Cannot use bfd relocations without alloca at present





reply via email to

[Prev in Thread] Current Thread [Next in Thread]