2009-03-06 Paul Pluzhnikov <ppluzhnikov@google.com>
[deliverable/binutils-gdb.git] / include / plugin-api.h
index 9863086317ccb0a0b783a251182be37487d0aa78..f536d57d751f5bb98794b4d121f2da38539e574e 100644 (file)
@@ -39,8 +39,9 @@ extern "C"
 enum ld_plugin_status
 {
   LDPS_OK = 0,
-  LDPS_NO_SYMS,         // Attempt to get symbols that haven't been added.
-  LDPS_ERR,
+  LDPS_NO_SYMS,         /* Attempt to get symbols that haven't been added. */
+  LDPS_BAD_HANDLE,      /* No claimed object associated with given handle. */
+  LDPS_ERR
   /* Additional Error codes TBD.  */
 };
 
@@ -48,7 +49,7 @@ enum ld_plugin_status
 
 enum ld_plugin_api_version
 {
-  LD_PLUGIN_API_VERSION = 1,
+  LD_PLUGIN_API_VERSION = 1
 };
 
 /* The type of output file being generated by the linker.  */
@@ -57,7 +58,7 @@ enum ld_plugin_output_file_type
 {
   LDPO_REL,
   LDPO_EXEC,
-  LDPO_DYN,
+  LDPO_DYN
 };
 
 /* An input file managed by the plugin library.  */
@@ -92,7 +93,7 @@ enum ld_plugin_symbol_kind
   LDPK_WEAKDEF,
   LDPK_UNDEF,
   LDPK_WEAKUNDEF,
-  LDPK_COMMON,
+  LDPK_COMMON
 };
 
 /* The visibility of the symbol.  */
@@ -102,7 +103,7 @@ enum ld_plugin_symbol_visibility
   LDPV_DEFAULT,
   LDPV_PROTECTED,
   LDPV_INTERNAL,
-  LDPV_HIDDEN,
+  LDPV_HIDDEN
 };
 
 /* How a symbol is resolved.  */
@@ -117,7 +118,7 @@ enum ld_plugin_symbol_resolution
   LDPR_PREEMPTED_IR,
   LDPR_RESOLVED_IR,
   LDPR_RESOLVED_EXEC,
-  LDPR_RESOLVED_DYN,
+  LDPR_RESOLVED_DYN
 };
 
 /* The plugin library's "claim file" handler.  */
@@ -165,6 +166,20 @@ enum ld_plugin_status
 (*ld_plugin_add_symbols) (void *handle, int nsyms,
                           const struct ld_plugin_symbol *syms);
 
+/* The linker's interface for getting the input file information with
+   an open (possibly re-opened) file descriptor.  */
+
+typedef
+enum ld_plugin_status
+(*ld_plugin_get_input_file) (const void *handle,
+                             struct ld_plugin_input_file *file);
+
+/* The linker's interface for releasing the input file.  */
+
+typedef
+enum ld_plugin_status
+(*ld_plugin_release_input_file) (const void *handle);
+
 /* The linker's interface for retrieving symbol resolution information.  */
 
 typedef
@@ -182,14 +197,14 @@ enum ld_plugin_status
 
 typedef
 enum ld_plugin_status
-(*ld_plugin_message) (int level, char *format, ...);
+(*ld_plugin_message) (int level, const char *format, ...);
 
 enum ld_plugin_level
 {
   LDPL_INFO,
   LDPL_WARNING,
   LDPL_ERROR,
-  LDPL_FATAL,
+  LDPL_FATAL
 };
 
 /* Values for the tv_tag field of the transfer vector.  */
@@ -208,6 +223,8 @@ enum ld_plugin_tag
   LDPT_GET_SYMBOLS,
   LDPT_ADD_INPUT_FILE,
   LDPT_MESSAGE,
+  LDPT_GET_INPUT_FILE,
+  LDPT_RELEASE_INPUT_FILE
 };
 
 /* The plugin transfer vector.  */
@@ -226,6 +243,8 @@ struct ld_plugin_tv
     ld_plugin_get_symbols tv_get_symbols;
     ld_plugin_add_input_file tv_add_input_file;
     ld_plugin_message tv_message;
+    ld_plugin_get_input_file tv_get_input_file;
+    ld_plugin_release_input_file tv_release_input_file;
   } tv_u;
 };
 
@@ -236,7 +255,7 @@ enum ld_plugin_status
 (*ld_plugin_onload) (struct ld_plugin_tv *tv);
 
 #ifdef __cplusplus
-};
+}
 #endif
 
 #endif /* !defined(PLUGIN_API_H) */
This page took 0.024343 seconds and 4 git commands to generate.