Include: Sync lto-symtab.h and plugin-api.h with GCC
authorMartin Liska <mliska@suse.cz>
Thu, 19 Mar 2020 15:55:59 +0000 (16:55 +0100)
committerH.J. Lu <hjl.tools@gmail.com>
Thu, 19 Mar 2020 16:16:04 +0000 (09:16 -0700)
2020-03-19  Martin Liska  <mliska@suse.cz>

* lto-symtab.h (enum gcc_plugin_symbol_type): New.
(enum gcc_plugin_symbol_section_kind): Likewise.

2020-03-19  Martin Liska  <mliska@suse.cz>

* plugin-api.h (struct ld_plugin_symbol): Split
int def into 4 char fields.
(enum ld_plugin_symbol_type): New.
(enum ld_plugin_symbol_section_kind): New.
(enum ld_plugin_tag): Add LDPT_ADD_SYMBOLS_V2.

include/ChangeLog
include/lto-symtab.h
include/plugin-api.h

index c19d4d4881c802ec105ad838e267e564e67bc2ba..16521ea040f664a1417b6d6952b714f57f3ad4e3 100644 (file)
@@ -1,3 +1,16 @@
+2020-03-19  Martin Liska  <mliska@suse.cz>
+
+       * lto-symtab.h (enum gcc_plugin_symbol_type): New.
+       (enum gcc_plugin_symbol_section_kind): Likewise.
+
+2020-03-19  Martin Liska  <mliska@suse.cz>
+
+       * plugin-api.h (struct ld_plugin_symbol): Split
+       int def into 4 char fields.
+       (enum ld_plugin_symbol_type): New.
+       (enum ld_plugin_symbol_section_kind): New.
+       (enum ld_plugin_tag): Add LDPT_ADD_SYMBOLS_V2.
+
 2020-03-13  Kamil Rytarowski  <n54@gmx.com>
 
        * elf/common.h (NT_NETBSDCORE_LWPSTATUS): New define.
index 0ce0de10121dbd7d1e86e6cd8bd58a920a1284d3..ef2e35f19c3ecffab000b4322e565bbfa015bc91 100644 (file)
@@ -38,4 +38,17 @@ enum gcc_plugin_symbol_visibility
     GCCPV_HIDDEN
   };
 
+enum gcc_plugin_symbol_type
+{
+  GCCST_UNKNOWN,
+  GCCST_FUNCTION,
+  GCCST_VARIABLE,
+};
+
+enum gcc_plugin_symbol_section_kind
+{
+  GCCSSK_DEFAULT,
+  GCCSSK_BSS
+};
+
 #endif /* GCC_LTO_SYMTAB_H  */
index 09e1202df07a032ded8cbf136d0ff2f60b52897e..f0f9667bf3b9f3db30f6d1457f77ce1cf40991e2 100644 (file)
@@ -87,7 +87,19 @@ struct ld_plugin_symbol
 {
   char *name;
   char *version;
-  int def;
+  /* This is for compatibility with older ABIs.  The older ABI defined
+     only 'def' field.  */
+#ifdef __BIG_ENDIAN__
+  char unused;
+  char section_kind;
+  char symbol_type;
+  char def;
+#else
+  char def;
+  char symbol_type;
+  char section_kind;
+  char unused;
+#endif
   int visibility;
   uint64_t size;
   char *comdat_key;
@@ -123,6 +135,21 @@ enum ld_plugin_symbol_visibility
   LDPV_HIDDEN
 };
 
+/* The type of the symbol.  */
+
+enum ld_plugin_symbol_type
+{
+  LDST_UNKNOWN,
+  LDST_FUNCTION,
+  LDST_VARIABLE,
+};
+
+enum ld_plugin_symbol_section_kind
+{
+  LDSSK_DEFAULT,
+  LDSSK_BSS
+};
+
 /* How a symbol is resolved.  */
 
 enum ld_plugin_symbol_resolution
@@ -431,7 +458,8 @@ enum ld_plugin_tag
   LDPT_GET_INPUT_SECTION_ALIGNMENT = 29,
   LDPT_GET_INPUT_SECTION_SIZE = 30,
   LDPT_REGISTER_NEW_INPUT_HOOK = 31,
-  LDPT_GET_WRAP_SYMBOLS = 32
+  LDPT_GET_WRAP_SYMBOLS = 32,
+  LDPT_ADD_SYMBOLS_V2 = 33
 };
 
 /* The plugin transfer vector.  */