]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gas/config/obj-elf.h
Update year range in copyright notice of binutils files
[thirdparty/binutils-gdb.git] / gas / config / obj-elf.h
index 29356ab3b06a040f968e8820e6c62914ecb82807..50eb47554a8d36d804d8d70d1d44af746f28d012 100644 (file)
@@ -1,12 +1,11 @@
 /* ELF object file format.
-   Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
-   2002, 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
+   Copyright (C) 1992-2021 Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
 
    GAS 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 2, or (at your option)
+   the Free Software Foundation; either version 3, or (at your option)
    any later version.
 
    GAS is distributed in the hope that it will be useful,
@@ -56,18 +55,41 @@ extern int mips_flag_mdebug;
 #endif
 #endif
 
+enum elf_visibility
+{
+  visibility_unchanged = 0,
+  visibility_local,
+  visibility_hidden,
+  visibility_remove
+};
+
+struct elf_versioned_name_list
+{
+  char *name;
+  struct elf_versioned_name_list *next;
+};
+
 /* Additional information we keep for each symbol.  */
 struct elf_obj_sy
 {
   /* Whether the symbol has been marked as local.  */
-  int local;
+  unsigned int local : 1;
+
+  /* Whether the symbol has been marked for rename with @@@.  */
+  unsigned int rename : 1;
+
+  /* Whether the symbol has a bad version name.  */
+  unsigned int bad_version : 1;
+
+  /* Whether visibility of the symbol should be changed.  */
+  ENUM_BITFIELD (elf_visibility) visibility : 2;
 
   /* Use this to keep track of .size expressions that involve
      differences that we can't compute yet.  */
   expressionS *size;
 
-  /* The name specified by the .symver directive.  */
-  char *versioned_name;
+  /* The list of names specified by the .symver directive.  */
+  struct elf_versioned_name_list *versioned_name;
 
 #ifdef ECOFF_DEBUGGING
   /* If we are generating ECOFF debugging information, we need some
@@ -78,15 +100,19 @@ struct elf_obj_sy
 #endif
 };
 
-#define OBJ_SYMFIELD_TYPE struct elf_obj_sy
-
-/* Symbol fields used by the ELF back end.  */
-#define ELF_TARGET_SYMBOL_FIELDS unsigned int local:1;
+/* Match section group name, the sh_info field and the section_id
+   field.  */
+struct elf_section_match
+{
+  const char *   group_name;
+  const char *   linked_to_symbol_name;
+  unsigned int   section_id;
+  unsigned int   sh_info;              /* ELF section information.  */
+  bfd_vma        sh_flags;             /* ELF section flags.  */
+  flagword       flags;
+};
 
-/* Don't change this; change ELF_TARGET_SYMBOL_FIELDS instead.  */
-#ifndef TARGET_SYMBOL_FIELDS
-#define TARGET_SYMBOL_FIELDS ELF_TARGET_SYMBOL_FIELDS
-#endif
+#define OBJ_SYMFIELD_TYPE struct elf_obj_sy
 
 #ifndef FALSE
 #define FALSE 0
@@ -98,6 +124,10 @@ struct elf_obj_sy
 #endif
 extern void elf_begin (void);
 
+#ifndef LOCAL_LABEL_PREFIX
+#define LOCAL_LABEL_PREFIX '.'
+#endif
+
 /* should be conditional on address size! */
 #define elf_symbol(asymbol) ((elf_symbol_type *) (&(asymbol)->the_bfd))
 
@@ -160,15 +190,22 @@ extern void elf_file_symbol (const char *, int);
 extern void obj_elf_section_change_hook (void);
 
 extern void obj_elf_section (int);
+extern const char * obj_elf_section_name (void);
 extern void obj_elf_previous (int);
 extern void obj_elf_version (int);
 extern void obj_elf_common (int);
 extern void obj_elf_data (int);
 extern void obj_elf_text (int);
 extern void obj_elf_change_section
-  (const char *, int, int, int, const char *, int, int);
-extern struct fix *obj_elf_vtable_inherit (int);
-extern struct fix *obj_elf_vtable_entry (int);
+  (const char *, unsigned int, bfd_vma, int, struct elf_section_match *,
+   int, int);
+extern void obj_elf_vtable_inherit (int);
+extern void obj_elf_vtable_entry (int);
+extern struct fix * obj_elf_get_vtable_inherit (void);
+extern struct fix * obj_elf_get_vtable_entry (void);
+extern bfd_boolean obj_elf_seen_attribute
+  (int, unsigned int);
+extern int obj_elf_vendor_attribute (int);
 
 /* BFD wants to write the udata field, which is a no-no for the
    predefined section symbols in bfd/section.c.  They are read-only.  */
@@ -186,12 +223,22 @@ void elf_obj_symbol_new_hook (symbolS *);
 #define obj_symbol_new_hook    elf_obj_symbol_new_hook
 #endif
 
+void elf_obj_symbol_clone_hook (symbolS *, symbolS *);
+#ifndef obj_symbol_clone_hook
+#define obj_symbol_clone_hook  elf_obj_symbol_clone_hook
+#endif
+
 void elf_copy_symbol_attributes (symbolS *, symbolS *);
 #ifndef OBJ_COPY_SYMBOL_ATTRIBUTES
 #define OBJ_COPY_SYMBOL_ATTRIBUTES(DEST, SRC) \
   (elf_copy_symbol_attributes (DEST, SRC))
 #endif
 
+void elf_adjust_symtab (void);
+#ifndef obj_adjust_symtab
+#define obj_adjust_symtab      elf_adjust_symtab
+#endif
+
 #ifndef SEPARATE_STAB_SECTIONS
 /* Avoid ifndef each separate macro setting by wrapping the whole of the
    stab group on the assumption that whoever sets SEPARATE_STAB_SECTIONS