PR25593, --as-needed breaks DT_NEEDED order with linker plugin
[deliverable/binutils-gdb.git] / ld / ldemul.h
index cc81728609423f8e8958789177e1b8b757fbbdf1..44e3a92aa7ef26436d71aa3dc6145ab8469e9d54 100644 (file)
@@ -1,7 +1,5 @@
 /* ld-emul.h - Linker emulation header file
-   Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000, 2001,
-   2002, 2003, 2004, 2005, 2007
-   Free Software Foundation, Inc.
+   Copyright (C) 1991-2020 Free Software Foundation, Inc.
 
    This file is part of the GNU Binutils.
 
@@ -36,6 +34,10 @@ extern void ldemul_before_parse
   (void);
 extern void ldemul_after_open
   (void);
+extern void ldemul_after_check_relocs
+  (void);
+extern void ldemul_before_place_orphans
+  (void);
 extern void ldemul_after_allocation
   (void);
 extern void ldemul_before_allocation
@@ -58,8 +60,8 @@ extern void ldemul_set_symbols
   (void);
 extern void ldemul_create_output_section_statements
   (void);
-extern bfd_boolean ldemul_place_orphan
-  (asection *);
+extern lang_output_section_statement_type *ldemul_place_orphan
+  (asection *, const char *, int);
 extern bfd_boolean ldemul_parse_args
   (int, char **);
 extern void ldemul_add_options
@@ -78,6 +80,10 @@ extern void after_parse_default
   (void);
 extern void after_open_default
   (void);
+extern void after_check_relocs_default
+  (void);
+extern void before_place_orphans_default
+  (void);
 extern void after_allocation_default
   (void);
 extern void before_allocation_default
@@ -96,6 +102,16 @@ extern int  ldemul_find_potential_libraries
   (char *, struct lang_input_statement_struct *);
 extern struct bfd_elf_version_expr *ldemul_new_vers_pattern
   (struct bfd_elf_version_expr *);
+extern void ldemul_extra_map_file_text
+  (bfd *, struct bfd_link_info *, FILE *);
+/* Return 1 if we are emitting CTF early, and 0 if ldemul_examine_strtab_for_ctf
+   will be called by the target.  */
+extern int ldemul_emit_ctf_early
+  (void);
+/* Called from per-target code to examine the strtab and symtab.  */
+extern void ldemul_examine_strtab_for_ctf
+  (struct ctf_file *, struct elf_sym_strtab *, bfd_size_type,
+   struct elf_strtab_hash *);
 
 typedef struct ld_emulation_xfer_struct {
   /* Run before parsing the command line and script file.
@@ -114,6 +130,12 @@ typedef struct ld_emulation_xfer_struct {
   /* Run after opening all input files, and loading the symbols.  */
   void   (*after_open) (void);
 
+  /* Run after checking relocations.  */
+  void   (*after_check_relocs)  (void);
+
+  /* Run before placing orphans.  */
+  void   (*before_place_orphans)  (void);
+
   /* Run after allocating output sections.  */
   void   (*after_allocation)  (void);
 
@@ -151,8 +173,8 @@ typedef struct ld_emulation_xfer_struct {
   /* Place an orphan section.  Return TRUE if it was placed, FALSE if
      the default action should be taken.  This field may be NULL, in
      which case the default action will always be taken.  */
-  bfd_boolean (*place_orphan)
-    (asection *);
+  lang_output_section_statement_type *(*place_orphan)
+    (asection *, const char *, int);
 
   /* Run after assigning parsing with the args, but before
      reading the script.  Used to initialize symbols used in the script.  */
@@ -196,6 +218,24 @@ typedef struct ld_emulation_xfer_struct {
   struct bfd_elf_version_expr * (*new_vers_pattern)
     (struct bfd_elf_version_expr *);
 
+  /* Called when printing the map file, in case there are
+     emulation-specific sections for it.  */
+  void (*extra_map_file_text)
+    (bfd *, struct bfd_link_info *, FILE *);
+
+  /* If this returns true, we emit CTF as early as possible: if false, we emit
+     CTF once the strtab and symtab are laid out.  */
+  int (*emit_ctf_early)
+    (void);
+
+  /* Called to examine the string and symbol table late enough in linking that
+     they are finally laid out.  If emit_ctf_early returns true, this is not
+     called and ldemul_maybe_emit_ctf() emits CTF in 'early' mode: otherwise, it
+     waits until 'late'. (Late mode needs explicit support at per-target link
+     time to get called at all).  If set, called by ld when the examine_strtab
+     bfd_link_callback is invoked by per-target code.  */
+  void (*examine_strtab_for_ctf) (struct ctf_file *, struct elf_sym_strtab *,
+                                 bfd_size_type, struct elf_strtab_hash *);
 } ld_emulation_xfer_type;
 
 typedef enum {
This page took 0.025583 seconds and 4 git commands to generate.