]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
linker bfd.h tidy
authorAlan Modra <amodra@gmail.com>
Mon, 23 Sep 2019 00:44:20 +0000 (10:14 +0930)
committerAlan Modra <amodra@gmail.com>
Mon, 23 Sep 2019 00:57:22 +0000 (10:27 +0930)
bfd/
* bfd-in.h (bfd_symbol, bfd_section_already_linked),
(bfd_elf_version_tree): Delete forward declarations.
Move other forward decls and remaining elf function decl later.
(bfd_section_already_linked_table_init),
(bfd_section_already_linked_table_free),
(_bfd_handle_already_linked, _bfd_nearby_section),
(_bfd_fix_excluded_sec_syms): Move to bfdlink.h.
include/
* bfdlink.h (struct bfd_section_already_linked): Forward declare.
(bfd_section_already_linked_table_init),
(bfd_section_already_linked_table_free),
(_bfd_handle_already_linked, _bfd_nearby_section),
(_bfd_fix_excluded_sec_syms): Declare.

bfd/ChangeLog
bfd/bfd-in.h
bfd/bfd-in2.h
include/ChangeLog
include/bfdlink.h

index 923adb4ea6fb4f64a8e678b20cc0cdb72ad34a0e..43544743ce3b0cfcf1cf22eeada7dd86777b2ee5 100644 (file)
@@ -1,3 +1,13 @@
+2019-09-23  Alan Modra  <amodra@gmail.com>
+
+       * bfd-in.h (bfd_symbol, bfd_section_already_linked),
+       (bfd_elf_version_tree): Delete forward declarations.
+       Move other forward decls and remaining elf function decl later.
+       (bfd_section_already_linked_table_init),
+       (bfd_section_already_linked_table_free),
+       (_bfd_handle_already_linked, _bfd_nearby_section),
+       (_bfd_fix_excluded_sec_syms): Move to bfdlink.h.
+
 2019-09-23  Alan Modra  <amodra@gmail.com>
 
        * bfd-in.h: Move ecoff function declarations..
index 4d2f09f7183a00305371e252c5ecd4255a7cf93b..d81cbb791fd6177bb624115ec4154e20e01f78f1 100644 (file)
@@ -509,49 +509,6 @@ void bfd_putl16 (bfd_vma, void *);
 bfd_uint64_t bfd_get_bits (const void *, int, bfd_boolean);
 void bfd_put_bits (bfd_uint64_t, void *, int, bfd_boolean);
 
-#if defined(__STDC__) || defined(ALMOST_STDC)
-struct ecoff_debug_info;
-struct ecoff_debug_swap;
-struct ecoff_extr;
-struct bfd_symbol;
-struct bfd_link_info;
-struct bfd_link_hash_entry;
-struct bfd_section_already_linked;
-struct bfd_elf_version_tree;
-#endif
-
-extern bfd_boolean bfd_section_already_linked_table_init (void);
-extern void bfd_section_already_linked_table_free (void);
-extern bfd_boolean _bfd_handle_already_linked
-  (struct bfd_section *, struct bfd_section_already_linked *,
-   struct bfd_link_info *);
-\f
-/* Externally visible ELF routines.  */
-
-/* Create a new BFD as if by bfd_openr.  Rather than opening a file,
-   reconstruct an ELF file by reading the segments out of remote
-   memory based on the ELF file header at EHDR_VMA and the ELF program
-   headers it points to.  If non-zero, SIZE is the known extent of the
-   object.  If not null, *LOADBASEP is filled in with the difference
-   between the VMAs from which the segments were read, and the VMAs
-   the file headers (and hence BFD's idea of each section's VMA) put
-   them at.
-
-   The function TARGET_READ_MEMORY is called to copy LEN bytes from
-   the remote memory at target address VMA into the local buffer at
-   MYADDR; it should return zero on success or an `errno' code on
-   failure.  TEMPL must be a BFD for a target with the word size and
-   byte order found in the remote memory.  */
-extern bfd *bfd_elf_bfd_from_remote_memory
-  (bfd *templ, bfd_vma ehdr_vma, bfd_size_type size, bfd_vma *loadbasep,
-   int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr,
-                             bfd_size_type len));
-
-extern struct bfd_section *
-_bfd_nearby_section (bfd *, struct bfd_section *, bfd_vma);
-
-extern void _bfd_fix_excluded_sec_syms
-  (bfd *, struct bfd_link_info *);
 
 /* mmap hacks */
 
@@ -579,3 +536,31 @@ extern void bfd_free_window
   (bfd_window *);
 extern bfd_boolean bfd_get_file_window
   (bfd *, file_ptr, bfd_size_type, bfd_window *, bfd_boolean);
+\f
+/* Externally visible ELF routines.  */
+
+/* Create a new BFD as if by bfd_openr.  Rather than opening a file,
+   reconstruct an ELF file by reading the segments out of remote
+   memory based on the ELF file header at EHDR_VMA and the ELF program
+   headers it points to.  If non-zero, SIZE is the known extent of the
+   object.  If not null, *LOADBASEP is filled in with the difference
+   between the VMAs from which the segments were read, and the VMAs
+   the file headers (and hence BFD's idea of each section's VMA) put
+   them at.
+
+   The function TARGET_READ_MEMORY is called to copy LEN bytes from
+   the remote memory at target address VMA into the local buffer at
+   MYADDR; it should return zero on success or an `errno' code on
+   failure.  TEMPL must be a BFD for a target with the word size and
+   byte order found in the remote memory.  */
+extern bfd *bfd_elf_bfd_from_remote_memory
+  (bfd *templ, bfd_vma ehdr_vma, bfd_size_type size, bfd_vma *loadbasep,
+   int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr,
+                             bfd_size_type len));
+
+/* Forward declarations.  */
+struct ecoff_debug_info;
+struct ecoff_debug_swap;
+struct ecoff_extr;
+struct bfd_link_info;
+struct bfd_link_hash_entry;
index 16fa46243023d81758b6093aafec0da0de223a72..1c468dc68b6cb891dc71e582c1c5ddb3a701bfbb 100644 (file)
@@ -516,49 +516,6 @@ void bfd_putl16 (bfd_vma, void *);
 bfd_uint64_t bfd_get_bits (const void *, int, bfd_boolean);
 void bfd_put_bits (bfd_uint64_t, void *, int, bfd_boolean);
 
-#if defined(__STDC__) || defined(ALMOST_STDC)
-struct ecoff_debug_info;
-struct ecoff_debug_swap;
-struct ecoff_extr;
-struct bfd_symbol;
-struct bfd_link_info;
-struct bfd_link_hash_entry;
-struct bfd_section_already_linked;
-struct bfd_elf_version_tree;
-#endif
-
-extern bfd_boolean bfd_section_already_linked_table_init (void);
-extern void bfd_section_already_linked_table_free (void);
-extern bfd_boolean _bfd_handle_already_linked
-  (struct bfd_section *, struct bfd_section_already_linked *,
-   struct bfd_link_info *);
-\f
-/* Externally visible ELF routines.  */
-
-/* Create a new BFD as if by bfd_openr.  Rather than opening a file,
-   reconstruct an ELF file by reading the segments out of remote
-   memory based on the ELF file header at EHDR_VMA and the ELF program
-   headers it points to.  If non-zero, SIZE is the known extent of the
-   object.  If not null, *LOADBASEP is filled in with the difference
-   between the VMAs from which the segments were read, and the VMAs
-   the file headers (and hence BFD's idea of each section's VMA) put
-   them at.
-
-   The function TARGET_READ_MEMORY is called to copy LEN bytes from
-   the remote memory at target address VMA into the local buffer at
-   MYADDR; it should return zero on success or an `errno' code on
-   failure.  TEMPL must be a BFD for a target with the word size and
-   byte order found in the remote memory.  */
-extern bfd *bfd_elf_bfd_from_remote_memory
-  (bfd *templ, bfd_vma ehdr_vma, bfd_size_type size, bfd_vma *loadbasep,
-   int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr,
-                             bfd_size_type len));
-
-extern struct bfd_section *
-_bfd_nearby_section (bfd *, struct bfd_section *, bfd_vma);
-
-extern void _bfd_fix_excluded_sec_syms
-  (bfd *, struct bfd_link_info *);
 
 /* mmap hacks */
 
@@ -586,6 +543,34 @@ extern void bfd_free_window
   (bfd_window *);
 extern bfd_boolean bfd_get_file_window
   (bfd *, file_ptr, bfd_size_type, bfd_window *, bfd_boolean);
+\f
+/* Externally visible ELF routines.  */
+
+/* Create a new BFD as if by bfd_openr.  Rather than opening a file,
+   reconstruct an ELF file by reading the segments out of remote
+   memory based on the ELF file header at EHDR_VMA and the ELF program
+   headers it points to.  If non-zero, SIZE is the known extent of the
+   object.  If not null, *LOADBASEP is filled in with the difference
+   between the VMAs from which the segments were read, and the VMAs
+   the file headers (and hence BFD's idea of each section's VMA) put
+   them at.
+
+   The function TARGET_READ_MEMORY is called to copy LEN bytes from
+   the remote memory at target address VMA into the local buffer at
+   MYADDR; it should return zero on success or an `errno' code on
+   failure.  TEMPL must be a BFD for a target with the word size and
+   byte order found in the remote memory.  */
+extern bfd *bfd_elf_bfd_from_remote_memory
+  (bfd *templ, bfd_vma ehdr_vma, bfd_size_type size, bfd_vma *loadbasep,
+   int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr,
+                             bfd_size_type len));
+
+/* Forward declarations.  */
+struct ecoff_debug_info;
+struct ecoff_debug_swap;
+struct ecoff_extr;
+struct bfd_link_info;
+struct bfd_link_hash_entry;
 /* Extracted from init.c.  */
 unsigned int bfd_init (void);
 
index 580eeb004735dc2b84e353dd63b539b981624f28..85405429e5210702da517bc67548fde48ca2256c 100644 (file)
@@ -1,3 +1,11 @@
+2019-09-23  Alan Modra  <amodra@gmail.com>
+
+       * bfdlink.h (struct bfd_section_already_linked): Forward declare.
+       (bfd_section_already_linked_table_init),
+       (bfd_section_already_linked_table_free),
+       (_bfd_handle_already_linked, _bfd_nearby_section),
+       (_bfd_fix_excluded_sec_syms): Declare.
+
 2019-09-23  Alan Modra  <amodra@gmail.com>
 
        * bfdlink.h (enum notice_asneeded_action): Define.
index bb7909a9e2f7ca961ea574f74013008a059a2cf7..68fc17f55e803268fdc52a2686593b231d9b0c69 100644 (file)
@@ -858,6 +858,20 @@ struct bfd_link_order_reloc
 /* Allocate a new link_order for a section.  */
 extern struct bfd_link_order *bfd_new_link_order (bfd *, asection *);
 
+struct bfd_section_already_linked;
+
+extern bfd_boolean bfd_section_already_linked_table_init (void);
+extern void bfd_section_already_linked_table_free (void);
+extern bfd_boolean _bfd_handle_already_linked
+  (struct bfd_section *, struct bfd_section_already_linked *,
+   struct bfd_link_info *);
+
+extern struct bfd_section *_bfd_nearby_section
+  (bfd *, struct bfd_section *, bfd_vma);
+
+extern void _bfd_fix_excluded_sec_syms
+  (bfd *, struct bfd_link_info *);
+
 /* These structures are used to describe version information for the
    ELF linker.  These structures could be manipulated entirely inside
    BFD, but it would be a pain.  Instead, the regular linker sets up