]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - ld/ldemul.h
Generated files
[thirdparty/binutils-gdb.git] / ld / ldemul.h
index 1a42cb63dea157ab5ada2013b272379ad333fbc3..368b725a36780fd7d11b817478017c3d2571c7b7 100644 (file)
@@ -1,19 +1,22 @@
 /* ld-emul.h - Linker emulation header file
-   Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000, 2001,
-   2002, 2003, 2004, 2005
-   Free Software Foundation, Inc.
+   Copyright (C) 1991-2018 Free Software Foundation, Inc.
 
-   This file is part of GLD, the Gnu Linker.
+   This file is part of the GNU Binutils.
 
-   GLD is free software; you can redistribute it and/or modify
+   This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 1, or (at your option)
-   any later version.
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
 
-   GLD is distributed in the hope that it will be useful,
+   This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.  */
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
+   MA 02110-1301, USA.  */
 
 #ifndef LDEMUL_H
 #define LDEMUL_H
@@ -31,12 +34,12 @@ extern void ldemul_before_parse
   (void);
 extern void ldemul_after_open
   (void);
+extern void ldemul_after_check_relocs
+  (void);
 extern void ldemul_after_allocation
   (void);
 extern void ldemul_before_allocation
   (void);
-extern void ldemul_do_assignments
-  (void);
 extern void ldemul_set_output_arch
   (void);
 extern char *ldemul_choose_target
@@ -55,8 +58,8 @@ extern void ldemul_set_symbols
   (void);
 extern void ldemul_create_output_section_statements
   (void);
-extern bfd_boolean ldemul_place_orphan
-  (struct lang_input_statement_struct *, 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
@@ -75,11 +78,15 @@ extern void after_parse_default
   (void);
 extern void after_open_default
   (void);
+extern void after_check_relocs_default
+  (void);
 extern void after_allocation_default
   (void);
 extern void before_allocation_default
   (void);
-extern void do_assignments_default
+extern void finish_default
+  (void);
+extern void finish_default
   (void);
 extern void set_output_arch_default
   (void);
@@ -91,6 +98,8 @@ 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 *);
 
 typedef struct ld_emulation_xfer_struct {
   /* Run before parsing the command line and script file.
@@ -109,6 +118,9 @@ 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 after allocating output sections.  */
   void   (*after_allocation)  (void);
 
@@ -121,9 +133,6 @@ typedef struct ld_emulation_xfer_struct {
   /* Run before allocating output sections.  */
   void   (*before_allocation) (void);
 
-  /* Run to set special symbols at the same time as link script syms.  */
-  void   (*do_assignments) (void);
-
   /* Return the appropriate linker script.  */
   char * (*get_script) (int *isfile);
 
@@ -149,8 +158,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)
-    (struct lang_input_statement_struct *, 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.  */
@@ -194,6 +203,11 @@ 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 *);
+
 } ld_emulation_xfer_type;
 
 typedef enum {