elf bfd.h tidy
authorAlan Modra <amodra@gmail.com>
Mon, 23 Sep 2019 00:42:31 +0000 (10:12 +0930)
committerAlan Modra <amodra@gmail.com>
Mon, 23 Sep 2019 00:57:22 +0000 (10:27 +0930)
bfd/
* bfd-in.h (enum notice_asneeded_action): Move to bfdlink.h.
Move most other elf declarations..
* elf-bfd.h: ..to here.
* bfd-in2.h: Regenerate.
include/
* bfdlink.h (enum notice_asneeded_action): Define.
ld/
* deffilep.y: Include bfdlink.h.
* ldelf.c: Likewise.
* ldelfgen.c: Likewise.
* ldver.c: Likewise.
* mri.c: Likewise.
* emultempl/irix.em: Don't include ld.h, ldmain.h, libiberty.h.
Comment.

13 files changed:
bfd/ChangeLog
bfd/bfd-in.h
bfd/bfd-in2.h
bfd/elf-bfd.h
include/ChangeLog
include/bfdlink.h
ld/ChangeLog
ld/deffilep.y
ld/emultempl/irix.em
ld/ldelf.c
ld/ldelfgen.c
ld/ldver.c
ld/mri.c

index fa67c70f7d2deaba408a02dc1bd3634fa6cdacfd..62115f25c665750cd73ab521c856bdfd7ab62ab5 100644 (file)
@@ -1,3 +1,10 @@
+2019-09-23  Alan Modra  <amodra@gmail.com>
+
+       * bfd-in.h (enum notice_asneeded_action): Move to bfdlink.h.
+       Move most other elf declarations..
+       * elf-bfd.h: ..to here.
+       * bfd-in2.h: Regenerate.
+
 2019-09-23  Alan Modra  <amodra@gmail.com>
 
        * bfd-in.h: Move m68k function declaration..
index d61467b5932bdc570436bae6e192569b363fc077..de8479cf727b8cd546ce954b1ebd3b3623b9fb1c 100644 (file)
@@ -570,72 +570,6 @@ extern bfd_boolean bfd_ecoff_write_accumulated_debug
 
 /* Externally visible ELF routines.  */
 
-struct bfd_link_needed_list
-{
-  struct bfd_link_needed_list *next;
-  bfd *by;
-  const char *name;
-};
-
-enum dynamic_lib_link_class {
-  DYN_NORMAL = 0,
-  DYN_AS_NEEDED = 1,
-  DYN_DT_NEEDED = 2,
-  DYN_NO_ADD_NEEDED = 4,
-  DYN_NO_NEEDED = 8
-};
-
-enum notice_asneeded_action {
-  notice_as_needed,
-  notice_not_needed,
-  notice_needed
-};
-
-extern bfd_boolean bfd_elf_record_link_assignment
-  (bfd *, struct bfd_link_info *, const char *, bfd_boolean,
-   bfd_boolean);
-extern struct bfd_link_needed_list *bfd_elf_get_needed_list
-  (bfd *, struct bfd_link_info *);
-extern bfd_boolean bfd_elf_get_bfd_needed_list
-  (bfd *, struct bfd_link_needed_list **);
-extern bfd_boolean bfd_elf_stack_segment_size (bfd *, struct bfd_link_info *,
-                                              const char *, bfd_vma);
-extern bfd_boolean bfd_elf_size_dynamic_sections
-  (bfd *, const char *, const char *, const char *, const char *, const char *,
-   const char * const *, struct bfd_link_info *, struct bfd_section **);
-extern bfd_boolean bfd_elf_size_dynsym_hash_dynstr
-  (bfd *, struct bfd_link_info *);
-extern void bfd_elf_set_dt_needed_name
-  (bfd *, const char *);
-extern const char *bfd_elf_get_dt_soname
-  (bfd *);
-extern void bfd_elf_set_dyn_lib_class
-  (bfd *, enum dynamic_lib_link_class);
-extern int bfd_elf_get_dyn_lib_class
-  (bfd *);
-extern struct bfd_link_needed_list *bfd_elf_get_runpath_list
-  (bfd *, struct bfd_link_info *);
-extern int bfd_elf_discard_info
-  (bfd *, struct bfd_link_info *);
-extern unsigned int _bfd_elf_default_action_discarded
-  (struct bfd_section *);
-
-/* Return an upper bound on the number of bytes required to store a
-   copy of ABFD's program header table entries.  Return -1 if an error
-   occurs; bfd_get_error will return an appropriate code.  */
-extern long bfd_get_elf_phdr_upper_bound
-  (bfd *abfd);
-
-/* Copy ABFD's program header table entries to *PHDRS.  The entries
-   will be stored as an array of Elf_Internal_Phdr structures, as
-   defined in include/elf/internal.h.  To find out how large the
-   buffer needs to be, call bfd_get_elf_phdr_upper_bound.
-
-   Return the number of program header table entries read, or -1 if an
-   error occurs; bfd_get_error will return an appropriate code.  */
-extern int bfd_get_elf_phdrs
-  (bfd *abfd, void *phdrs);
-
 /* 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
@@ -655,9 +589,6 @@ extern bfd *bfd_elf_bfd_from_remote_memory
    int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr,
                              bfd_size_type len));
 
-extern struct bfd_section *_bfd_elf_tls_setup
-  (bfd *, struct bfd_link_info *);
-
 extern struct bfd_section *
 _bfd_nearby_section (bfd *, struct bfd_section *, bfd_vma);
 
index 4d2707621f7aa87e3d069c0a7bf06431ff0f69f2..30b2685a83e86f7702834070f97657a79e677741 100644 (file)
@@ -577,72 +577,6 @@ extern bfd_boolean bfd_ecoff_write_accumulated_debug
 
 /* Externally visible ELF routines.  */
 
-struct bfd_link_needed_list
-{
-  struct bfd_link_needed_list *next;
-  bfd *by;
-  const char *name;
-};
-
-enum dynamic_lib_link_class {
-  DYN_NORMAL = 0,
-  DYN_AS_NEEDED = 1,
-  DYN_DT_NEEDED = 2,
-  DYN_NO_ADD_NEEDED = 4,
-  DYN_NO_NEEDED = 8
-};
-
-enum notice_asneeded_action {
-  notice_as_needed,
-  notice_not_needed,
-  notice_needed
-};
-
-extern bfd_boolean bfd_elf_record_link_assignment
-  (bfd *, struct bfd_link_info *, const char *, bfd_boolean,
-   bfd_boolean);
-extern struct bfd_link_needed_list *bfd_elf_get_needed_list
-  (bfd *, struct bfd_link_info *);
-extern bfd_boolean bfd_elf_get_bfd_needed_list
-  (bfd *, struct bfd_link_needed_list **);
-extern bfd_boolean bfd_elf_stack_segment_size (bfd *, struct bfd_link_info *,
-                                              const char *, bfd_vma);
-extern bfd_boolean bfd_elf_size_dynamic_sections
-  (bfd *, const char *, const char *, const char *, const char *, const char *,
-   const char * const *, struct bfd_link_info *, struct bfd_section **);
-extern bfd_boolean bfd_elf_size_dynsym_hash_dynstr
-  (bfd *, struct bfd_link_info *);
-extern void bfd_elf_set_dt_needed_name
-  (bfd *, const char *);
-extern const char *bfd_elf_get_dt_soname
-  (bfd *);
-extern void bfd_elf_set_dyn_lib_class
-  (bfd *, enum dynamic_lib_link_class);
-extern int bfd_elf_get_dyn_lib_class
-  (bfd *);
-extern struct bfd_link_needed_list *bfd_elf_get_runpath_list
-  (bfd *, struct bfd_link_info *);
-extern int bfd_elf_discard_info
-  (bfd *, struct bfd_link_info *);
-extern unsigned int _bfd_elf_default_action_discarded
-  (struct bfd_section *);
-
-/* Return an upper bound on the number of bytes required to store a
-   copy of ABFD's program header table entries.  Return -1 if an error
-   occurs; bfd_get_error will return an appropriate code.  */
-extern long bfd_get_elf_phdr_upper_bound
-  (bfd *abfd);
-
-/* Copy ABFD's program header table entries to *PHDRS.  The entries
-   will be stored as an array of Elf_Internal_Phdr structures, as
-   defined in include/elf/internal.h.  To find out how large the
-   buffer needs to be, call bfd_get_elf_phdr_upper_bound.
-
-   Return the number of program header table entries read, or -1 if an
-   error occurs; bfd_get_error will return an appropriate code.  */
-extern int bfd_get_elf_phdrs
-  (bfd *abfd, void *phdrs);
-
 /* 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
@@ -662,9 +596,6 @@ extern bfd *bfd_elf_bfd_from_remote_memory
    int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr,
                              bfd_size_type len));
 
-extern struct bfd_section *_bfd_elf_tls_setup
-  (bfd *, struct bfd_link_info *);
-
 extern struct bfd_section *
 _bfd_nearby_section (bfd *, struct bfd_section *, bfd_vma);
 
index 4458ff7b2ae61c78ab13c30afa52110487b41027..0a83c173327c23b8078c124a890512d08ac00ab7 100644 (file)
@@ -529,6 +529,13 @@ struct elf_sym_strtab
   unsigned long destshndx_index;
 };
 
+struct bfd_link_needed_list
+{
+  struct bfd_link_needed_list *next;
+  bfd *by;
+  const char *name;
+};
+
 /* ELF linker hash table.  */
 
 struct elf_link_hash_table
@@ -1828,6 +1835,14 @@ typedef struct elf_section_list
   struct elf_section_list *  next;
 } elf_section_list;
 
+enum dynamic_lib_link_class {
+  DYN_NORMAL = 0,
+  DYN_AS_NEEDED = 1,
+  DYN_DT_NEEDED = 2,
+  DYN_NO_ADD_NEEDED = 4,
+  DYN_NO_NEEDED = 8
+};
+
 /* Some private data is stashed away for future use using the tdata pointer
    in the bfd structure.  */
 
@@ -2287,6 +2302,37 @@ extern file_ptr _bfd_elf_assign_file_position_for_section
 extern bfd_boolean _bfd_elf_validate_reloc
   (bfd *, arelent *);
 
+extern bfd_boolean bfd_elf_record_link_assignment
+  (bfd *, struct bfd_link_info *, const char *, bfd_boolean,
+   bfd_boolean);
+extern bfd_boolean bfd_elf_stack_segment_size (bfd *, struct bfd_link_info *,
+                                              const char *, bfd_vma);
+extern bfd_boolean bfd_elf_size_dynamic_sections
+  (bfd *, const char *, const char *, const char *, const char *, const char *,
+   const char * const *, struct bfd_link_info *, struct bfd_section **);
+extern bfd_boolean bfd_elf_size_dynsym_hash_dynstr
+  (bfd *, struct bfd_link_info *);
+extern bfd_boolean bfd_elf_get_bfd_needed_list
+  (bfd *, struct bfd_link_needed_list **);
+extern struct bfd_link_needed_list *bfd_elf_get_needed_list
+  (bfd *, struct bfd_link_info *);
+extern void bfd_elf_set_dt_needed_name
+  (bfd *, const char *);
+extern const char *bfd_elf_get_dt_soname
+  (bfd *);
+extern void bfd_elf_set_dyn_lib_class
+  (bfd *, enum dynamic_lib_link_class);
+extern int bfd_elf_get_dyn_lib_class
+  (bfd *);
+extern struct bfd_link_needed_list *bfd_elf_get_runpath_list
+  (bfd *, struct bfd_link_info *);
+extern int bfd_elf_discard_info
+  (bfd *, struct bfd_link_info *);
+extern unsigned int _bfd_elf_default_action_discarded
+  (struct bfd_section *);
+extern struct bfd_section *_bfd_elf_tls_setup
+  (bfd *, struct bfd_link_info *);
+
 extern bfd_boolean _bfd_elf_link_create_dynamic_sections
   (bfd *, struct bfd_link_info *);
 extern bfd_boolean _bfd_elf_omit_section_dynsym_default
@@ -2557,6 +2603,22 @@ extern bfd_boolean _bfd_elf_ppc_set_arch (bfd *);
 extern bfd_boolean _bfd_elf_ppc_merge_fp_attributes
   (bfd *, struct bfd_link_info *);
 
+/* Return an upper bound on the number of bytes required to store a
+   copy of ABFD's program header table entries.  Return -1 if an error
+   occurs; bfd_get_error will return an appropriate code.  */
+extern long bfd_get_elf_phdr_upper_bound
+  (bfd *abfd);
+
+/* Copy ABFD's program header table entries to *PHDRS.  The entries
+   will be stored as an array of Elf_Internal_Phdr structures, as
+   defined in include/elf/internal.h.  To find out how large the
+   buffer needs to be, call bfd_get_elf_phdr_upper_bound.
+
+   Return the number of program header table entries read, or -1 if an
+   error occurs; bfd_get_error will return an appropriate code.  */
+extern int bfd_get_elf_phdrs
+  (bfd *abfd, void *phdrs);
+
 /* Exported interface for writing elf corefile notes.  */
 extern char *elfcore_write_note
   (bfd *, char *, int *, const char *, int, const void *, int);
index c725bfbbc7533af77e6969e8df2da5ad736fbcc7..580eeb004735dc2b84e353dd63b539b981624f28 100644 (file)
@@ -1,3 +1,7 @@
+2019-09-23  Alan Modra  <amodra@gmail.com>
+
+       * bfdlink.h (enum notice_asneeded_action): Define.
+
 2019-09-17  Maxim Blinov  <maxim.blinov@embecosm.com>
 
        * opcode/riscv.h (riscv_insn_class): New enum.
index c35469dd11ef49e5faa827cdd5a8638819667740..bb7909a9e2f7ca961ea574f74013008a059a2cf7 100644 (file)
@@ -42,6 +42,12 @@ enum bfd_link_discard
   discard_all          /* Discard all locals.  */
 };
 
+enum notice_asneeded_action {
+  notice_as_needed,
+  notice_not_needed,
+  notice_needed
+};
+
 /* Whether to generate ELF common symbols with the STT_COMMON type
    during a relocatable link.  */
 enum bfd_link_elf_stt_common
index 07e4611e005155789ac3650cf05d305c7140cb07..fe27434bf275a816546ac4177053bf82247a95b0 100644 (file)
@@ -1,3 +1,13 @@
+2019-09-23  Alan Modra  <amodra@gmail.com>
+
+       * deffilep.y: Include bfdlink.h.
+       * ldelf.c: Likewise.
+       * ldelfgen.c: Likewise.
+       * ldver.c: Likewise.
+       * mri.c: Likewise.
+       * emultempl/irix.em: Don't include ld.h, ldmain.h, libiberty.h.
+       Comment.
+
 2019-09-23  Alan Modra  <amodra@gmail.com>
 
        * emultempl/m68kelf.em: Include elf32-m68k.h.
index 7f74157065642c351c9270639948bc7d0b0f05fe..92116e68a8e6d063704113235e70e8ae71503780 100644 (file)
@@ -23,6 +23,7 @@
 #include "libiberty.h"
 #include "safe-ctype.h"
 #include "bfd.h"
+#include "bfdlink.h"
 #include "ld.h"
 #include "ldmisc.h"
 #include "deffile.h"
index ddd5fd69e5c512458b1f558fefb453abb985cf87..e52c4a2d694987e7e86c1a98c9c9521de37deca0 100644 (file)
 # MA 02110-1301, USA.
 #
 
-fragment <<EOF
+# This file is sourced from elf.em, and defines extra irix specific
+# functions.
 
-#include "ld.h"
-#include "ldmain.h"
-#include "libiberty.h"
+fragment <<EOF
 
 /* The native IRIX linker will always create a DT_SONAME for shared objects.
    While this shouldn't really be necessary for ABI conformance, some versions
index e43d33d4325a3548327df9371d257c4a2338b629..3d12e3aa708e8129cbf32811741f3bdeed808971 100644 (file)
@@ -23,6 +23,7 @@
 #include "libiberty.h"
 #include "filenames.h"
 #include "safe-ctype.h"
+#include "bfdlink.h"
 #include "ld.h"
 #include "ldmain.h"
 #include "ldmisc.h"
index 98bcecd89fce8f2c0ca85422ce438df08727ddd5..142a669db9cdc1688a3081132986222e2f6b5344 100644 (file)
@@ -20,6 +20,7 @@
 
 #include "sysdep.h"
 #include "bfd.h"
+#include "bfdlink.h"
 #include "ld.h"
 #include "ldmain.h"
 #include "ldmisc.h"
index fb2e52f4c5072c5ce911ace4e8cfd3cb63ed9b0f..7be0242ab20874c24e66e652d92262bd42640c30 100644 (file)
@@ -21,7 +21,7 @@
 #include "sysdep.h"
 #include "bfd.h"
 #include "bfdver.h"
-
+#include "bfdlink.h"
 #include "ld.h"
 #include "ldver.h"
 #include "ldexp.h"
index 37821e8f4c5e873dd5448ee36342d387adc33b75..7f8d7064e83656614beff94a4074338039494797 100644 (file)
--- a/ld/mri.c
+++ b/ld/mri.c
@@ -25,6 +25,7 @@
 
 #include "sysdep.h"
 #include "bfd.h"
+#include "bfdlink.h"
 #include "ld.h"
 #include "ldexp.h"
 #include "ldlang.h"
This page took 0.031534 seconds and 4 git commands to generate.