]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
include/
authorAlan Modra <amodra@gmail.com>
Thu, 31 May 2007 15:04:52 +0000 (15:04 +0000)
committerAlan Modra <amodra@gmail.com>
Thu, 31 May 2007 15:04:52 +0000 (15:04 +0000)
* bfdlink.h (struct bfd_link_info): Add input_bfds_tail.
bfd/
* simple.c (bfd_simple_get_relocated_section_content): Init
input_bfds_tail.
ld/
* ldlang.c (ldlang_add_file): Use input_bfds_tail.
* ldmain.c (main): Init input_bfds_tail.  Sort link_info
initialization.

bfd/ChangeLog
bfd/simple.c
include/ChangeLog
include/bfdlink.h
ld/ChangeLog
ld/ldlang.c
ld/ldmain.c

index a75421305b207b6280e64914afb34d26e3cbf096..e291ff153aee7d4fa464f59e0dae6f6c69f9d6bc 100644 (file)
@@ -1,3 +1,8 @@
+2007-06-01  Alan Modra  <amodra@bigpond.net.au>
+
+       * simple.c (bfd_simple_get_relocated_section_contents): Init
+       input_bfds_tail.
+
 2007-05-30  Alan Modra  <amodra@bigpond.net.au>
 
        * elf.c (elf_fake_sections): Adjust test for SHT_NOBITS sections
index fd2fca5d85f93ec2951495af18a35f659efb8125..8ebc47e0597e2bdbae3f23575f4ec20affd7f853 100644 (file)
@@ -183,6 +183,7 @@ bfd_simple_get_relocated_section_contents (bfd *abfd,
   /* Fill in the bare minimum number of fields for our purposes.  */
   memset (&link_info, 0, sizeof (link_info));
   link_info.input_bfds = abfd;
+  link_info.input_bfds_tail = &abfd->link_next;
 
   link_info.hash = _bfd_generic_link_hash_table_create (abfd);
   link_info.callbacks = &callbacks;
index 297e8b36fb3a7e6b18a0f25f0537e097dabf8401..8ab2717282e5e70dc92889a8f5eafd685b65ecbc 100644 (file)
@@ -1,3 +1,8 @@
+2007-06-01  Noah Misch  <noah@cs.caltech.edu>
+           Alan Modra  <amodra@bigpond.net.au>
+
+       * bfdlink.h (struct bfd_link_info): Add input_bfds_tail.
+
 2007-05-07  Nathan Froyd  <froydnj@codesourcery.com>
 
        * libiberty.h (writeargv): Declare.
index 82fdc5c2e444c523a959253bdcca5eaa12b95c5e..a373225a335c1460c36d6c0ab2876415963ac9c7 100644 (file)
@@ -395,6 +395,7 @@ struct bfd_link_info
   /* The list of input BFD's involved in the link.  These are chained
      together via the link_next field.  */
   bfd *input_bfds;
+  bfd **input_bfds_tail;
 
   /* If a symbol should be created for each input BFD, this is section
      where those symbols should be placed.  It must be a section in
index c2a14708dd90391a9fc9861b45f72fd4bdecd619..17cec6597a148ea5fad0e758d402ff12f7c1f204 100644 (file)
@@ -1,3 +1,10 @@
+2007-06-01  Noah Misch  <noah@cs.caltech.edu>
+           Alan Modra  <amodra@bigpond.net.au>
+
+       * ldlang.c (ldlang_add_file): Use input_bfds_tail.
+       * ldmain.c (main): Init input_bfds_tail.  Sort link_info
+       initialization.
+
 2007-05-29  Alan Modra  <amodra@bigpond.net.au>
 
        * emultempl/spuelf.em (base_name): New function, split out from..
index dfaf19bf6b9a37467447c9536855cd0a63f834a4..a732525b0b813168d4ade3cacac06c5447b9a3ae 100644 (file)
@@ -5435,8 +5435,6 @@ lang_for_each_file (void (*func) (lang_input_statement_type *))
 void
 ldlang_add_file (lang_input_statement_type *entry)
 {
-  bfd **pp;
-
   lang_statement_append (&file_chain,
                         (lang_statement_union_type *) entry,
                         &entry->next);
@@ -5445,9 +5443,9 @@ ldlang_add_file (lang_input_statement_type *entry)
      a link.  */
   ASSERT (entry->the_bfd->link_next == NULL);
   ASSERT (entry->the_bfd != output_bfd);
-  for (pp = &link_info.input_bfds; *pp != NULL; pp = &(*pp)->link_next)
-    ;
-  *pp = entry->the_bfd;
+
+  *link_info.input_bfds_tail = entry->the_bfd;
+  link_info.input_bfds_tail = &entry->the_bfd->link_next;
   entry->the_bfd->usrdata = entry;
   bfd_set_gp_size (entry->the_bfd, g_switch_value);
 
index bbd769fff22dfa82702148c5abd213f793193646..354c41aeccdadd138514ad9de63ee9ac4ebd871e 100644 (file)
@@ -265,15 +265,16 @@ main (int argc, char **argv)
   link_info.keep_memory = TRUE;
   link_info.combreloc = TRUE;
   link_info.strip_discarded = TRUE;
-  link_info.callbacks = &link_callbacks;
   link_info.emit_hash = TRUE;
+  link_info.callbacks = &link_callbacks;
+  link_info.input_bfds_tail = &link_info.input_bfds;
   /* SVR4 linkers seem to set DT_INIT and DT_FINI based on magic _init
      and _fini symbols.  We are compatible.  */
   link_info.init_function = "_init";
   link_info.fini_function = "_fini";
+  link_info.relax_pass = 1;
   link_info.pei386_auto_import = -1;
   link_info.spare_dynamic_tags = 5;
-  link_info.relax_pass = 1;
 
   ldfile_add_arch ("");
   emulation = get_emulation (argc, argv);