]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
include/coff/
authorRichard Sandiford <rdsandiford@googlemail.com>
Wed, 1 Apr 2009 19:38:11 +0000 (19:38 +0000)
committerRichard Sandiford <rdsandiford@googlemail.com>
Wed, 1 Apr 2009 19:38:11 +0000 (19:38 +0000)
* xcoff.h (xcoff_link_hash_table): Move to bfd/xcofflink.c.

bfd/
* xcofflink.c (xcoff_link_hash_table): Moved from include/coff/xcoff.h.

bfd/ChangeLog
bfd/xcofflink.c
include/coff/ChangeLog
include/coff/xcoff.h

index cbfad171d3abbfa0462183dae1aa9a0327fa1bcf..217730145ce2107efb42324d1513840524132c57 100644 (file)
@@ -1,3 +1,32 @@
+2009-04-01  Richard Sandiford  <r.sandiford@uk.ibm.com>
+
+       * xcofflink.c (xcoff_link_hash_table): Moved from include/coff/xcoff.h.
+
+2009-04-01  Richard Sandiford  <r.sandiford@uk.ibm.com>
+
+       * xcofflink.c (xcoff_link_create_extra_sections): Don't create
+       a .loader section for relocatable links.
+       (xcoff_need_ldrel_p): New function.
+       (xcoff_mark): Use it.
+       (bfd_xcoff_link_count_reloc): Only count loader relocs if there's
+       a loader section.
+       (xcoff_build_ldsym): New function, split out from...
+       (xcoff_build_ldsyms): ...here.  Rename to...
+       (xcoff_post_gc_symbol): ...this.  Only export symbols, and only
+       call xcoff_build_ldsym, if there's a loader section.
+       (xcoff_build_loader_section): New function, extracted verbatim from...
+       (bfd_xcoff_size_dynamic_sections): ...here.  Only call it if
+       there's a loader section.  Only add an __rtinit loader symbol
+       if there's a loader section.  Update after above name change.
+       (xcoff_symbol_section, xcoff_create_ldrel): New functions.
+       (bfd_link_input_bfd): Use xcoff_need_ldrel_p, xcoff_symbol_section
+       and xcoff_create_ldrel.
+       (xcoff_write_global_symbol): Use xcoff_create_ldrel.
+       (xcoff_reloc_link_order): Likewise, but only call it if there's
+       a loader section.  Use xcoff_symbol_section.
+       (_bfd_xcoff_bfd_final_link): Only use fdinfo.ldrel and fdinfo.ldsym
+       if there's a loader section.
+
 2009-04-01  Richard Sandiford  <rdsandiford@googlemail.com>
 
        * xcofflink.c (bfd_link_input_bfd): Fix buffer overrun.
index 6905a3a815338a899379a862cd983bf5e8293e9e..1c205f934b85b7c100478d36c6c6f2a941acd70c 100644 (file)
@@ -75,6 +75,67 @@ struct xcoff_link_section_info
   } *toc_rel_hashes;
 };
 
+struct xcoff_link_hash_table
+{
+  struct bfd_link_hash_table root;
+
+  /* The .debug string hash table.  We need to compute this while
+     reading the input files, so that we know how large the .debug
+     section will be before we assign section positions.  */
+  struct bfd_strtab_hash *debug_strtab;
+
+  /* The .debug section we will use for the final output.  */
+  asection *debug_section;
+
+  /* The .loader section we will use for the final output.  */
+  asection *loader_section;
+
+  /* A count of non TOC relative relocs which will need to be
+     allocated in the .loader section.  */
+  size_t ldrel_count;
+
+  /* The .loader section header.  */
+  struct internal_ldhdr ldhdr;
+
+  /* The .gl section we use to hold global linkage code.  */
+  asection *linkage_section;
+
+  /* The .tc section we use to hold toc entries we build for global
+     linkage code.  */
+  asection *toc_section;
+
+  /* The .ds section we use to hold function descriptors which we
+     create for exported symbols.  */
+  asection *descriptor_section;
+
+  /* The list of import files.  */
+  struct xcoff_import_file *imports;
+
+  /* Required alignment of sections within the output file.  */
+  unsigned long file_align;
+
+  /* Whether the .text section must be read-only.  */
+  bfd_boolean textro;
+
+  /* Whether -brtl was specified.  */
+  bfd_boolean rtld;
+
+  /* Whether garbage collection was done.  */
+  bfd_boolean gc;
+
+  /* A linked list of symbols for which we have size information.  */
+  struct xcoff_link_size_list
+  {
+    struct xcoff_link_size_list *next;
+    struct xcoff_link_hash_entry *h;
+    bfd_size_type size;
+  } 
+  *size_list;
+
+  /* Magic sections: _text, _etext, _data, _edata, _end, end. */
+  asection *special_sections[XCOFF_NUMBER_OF_SPECIAL_SECTIONS];
+};
+
 /* Information that we pass around while doing the final link step.  */
 
 struct xcoff_final_link_info
index ba5fa3fe08b1cdcbbc81b25493c3f8cb40738389..acfc3dcb748c37967a5d5f641ba01da1664a34ac 100644 (file)
@@ -1,3 +1,7 @@
+2009-04-01  Richard Sandiford  <r.sandiford@uk.ibm.com>
+
+       * xcoff.h (xcoff_link_hash_table): Move to bfd/xcofflink.c.
+
 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
 
        * xcoff.h (XCOFF_EXPALL, XCOFF_EXPFULL): New flags.
index 4439dc99b1fa38074289168da029c96ba1338ec5..f072b2541c2c447f18f296091ef7b63b22d85abe 100644 (file)
@@ -333,67 +333,6 @@ struct xcoff_link_hash_entry
 #define XCOFF_SPECIAL_SECTION_END        4
 #define XCOFF_SPECIAL_SECTION_END2       5
 
-struct xcoff_link_hash_table
-{
-  struct bfd_link_hash_table root;
-
-  /* The .debug string hash table.  We need to compute this while
-     reading the input files, so that we know how large the .debug
-     section will be before we assign section positions.  */
-  struct bfd_strtab_hash *debug_strtab;
-
-  /* The .debug section we will use for the final output.  */
-  asection *debug_section;
-
-  /* The .loader section we will use for the final output.  */
-  asection *loader_section;
-
-  /* A count of non TOC relative relocs which will need to be
-     allocated in the .loader section.  */
-  size_t ldrel_count;
-
-  /* The .loader section header.  */
-  struct internal_ldhdr ldhdr;
-
-  /* The .gl section we use to hold global linkage code.  */
-  asection *linkage_section;
-
-  /* The .tc section we use to hold toc entries we build for global
-     linkage code.  */
-  asection *toc_section;
-
-  /* The .ds section we use to hold function descriptors which we
-     create for exported symbols.  */
-  asection *descriptor_section;
-
-  /* The list of import files.  */
-  struct xcoff_import_file *imports;
-
-  /* Required alignment of sections within the output file.  */
-  unsigned long file_align;
-
-  /* Whether the .text section must be read-only.  */
-  bfd_boolean textro;
-
-  /* Whether -brtl was specified.  */
-  bfd_boolean rtld;
-
-  /* Whether garbage collection was done.  */
-  bfd_boolean gc;
-
-  /* A linked list of symbols for which we have size information.  */
-  struct xcoff_link_size_list
-  {
-    struct xcoff_link_size_list *next;
-    struct xcoff_link_hash_entry *h;
-    bfd_size_type size;
-  } 
-  *size_list;
-
-  /* Magic sections: _text, _etext, _data, _edata, _end, end. */
-  asection *special_sections[XCOFF_NUMBER_OF_SPECIAL_SECTIONS];
-};
-
 /* These flags indicate which of -bexpall and -bexpfull are in effect.  */
 #define XCOFF_EXPALL 1
 #define XCOFF_EXPFULL 2