libctf, link: add CTF_LINK_OMIT_VARIABLES_SECTION
authorNick Alcock <nick.alcock@oracle.com>
Fri, 5 Jun 2020 21:52:41 +0000 (22:52 +0100)
committerNick Alcock <nick.alcock@oracle.com>
Wed, 22 Jul 2020 17:02:19 +0000 (18:02 +0100)
This flag (not used anywhere yet) causes the variables section to be
omitted from the output CTF dict.

include/
* ctf-api.h (CTF_LINK_OMIT_VARIABLES_SECTION): New.
libctf/
* ctf-link.c (ctf_link_one_input_archive_member): Check
CTF_LINK_OMIT_VARIABLES_SECTION.

include/ChangeLog
include/ctf-api.h
libctf/ChangeLog
libctf/ctf-link.c

index daf0fe2a564331fa879c7916af672edbf4ffc6fb..896f33387b48ef25f40365094ffa1a0868dedb2a 100644 (file)
@@ -1,3 +1,7 @@
+2020-07-22  Nick Alcock  <nick.alcock@oracle.com>
+
+       * ctf-api.h (CTF_LINK_OMIT_VARIABLES_SECTION): New.
+
 2020-07-22  Nick Alcock  <nick.alcock@oracle.com>
 
        * ctf-api.h (CTF_LINK_SHARE_DUPLICATED): No longer unimplemented.
index c3683db0996371522969515b7621739a180ae6ff..f034f9859dd2632cc97b86f584672e0df76c7f6a 100644 (file)
@@ -90,6 +90,9 @@ typedef struct ctf_link_sym
    emitted into them.  */
 #define CTF_LINK_EMPTY_CU_MAPPINGS 0x4
 
+/* Omit the content of the variables section.  */
+#define CTF_LINK_OMIT_VARIABLES_SECTION 0x8
+
 /* Symbolic names for CTF sections.  */
 
 typedef enum ctf_sect_names
index 58eb2f61de39e2c740f8f1829743f2dfcf064262..4ec74427e51e9b3399a6f81525ff6a99bfbf5b26 100644 (file)
@@ -1,3 +1,8 @@
+2020-07-22  Nick Alcock  <nick.alcock@oracle.com>
+
+       * ctf-link.c (ctf_link_one_input_archive_member): Check
+       CTF_LINK_OMIT_VARIABLES_SECTION.
+
 2020-07-22  Nick Alcock  <nick.alcock@oracle.com>
 
        * ctf-impl.h (ctf_type_id_key): New, the key in the
index 886106cb478c38cb478b25a8b4a4a9964769b656..043d6a2f5300a1fbfb746d50ec63c3005e95bfd6 100644 (file)
@@ -685,7 +685,8 @@ ctf_link_one_input_archive_member (ctf_file_t *in_fp, const char *name, void *ar
   arg->in_fp = in_fp;
 
   if ((err = ctf_type_iter_all (in_fp, ctf_link_one_type, arg)) > -1)
-    err = ctf_variable_iter (in_fp, ctf_link_one_variable, arg);
+    if (!(in_fp->ctf_link_flags & CTF_LINK_OMIT_VARIABLES_SECTION))
+      err = ctf_variable_iter (in_fp, ctf_link_one_variable, arg);
 
   arg->in_input_cu_file = 0;