From 6dd2819ffc282e644e7feb476cc803d4f39d9f17 Mon Sep 17 00:00:00 2001 From: Nick Alcock Date: Fri, 5 Jun 2020 18:15:26 +0100 Subject: libctf, link: add the ability to filter out variables from the link The CTF variables section (containing variables that have no corresponding symtab entries) can cause the string table to get very voluminous if the names of variables are long. Some callers want to filter out particular variables they know they won't need. So add a "variable filter" callback that does that: it's passed the name of the variable and a corresponding ctf_file_t / ctf_id_t pair, and should return 1 to filter it out. ld doesn't use this machinery yet, but we could easily add it later if desired. (But see later for a commit that turns off CTF variable- section linking in ld entirely by default.) include/ * ctf-api.h (ctf_link_variable_filter_t): New. (ctf_link_set_variable_filter): Likewise. libctf/ * libctf.ver (ctf_link_set_variable_filter): Add. * ctf-impl.h (ctf_file_t) : New. : Likewise. * ctf-create.c (ctf_serialize): Adjust. * ctf-link.c (ctf_link_set_variable_filter): New, set it. (ctf_link_one_variable): Call it if set. --- libctf/libctf.ver | 1 + 1 file changed, 1 insertion(+) (limited to 'libctf/libctf.ver') diff --git a/libctf/libctf.ver b/libctf/libctf.ver index 7eed14a..62f9977 100644 --- a/libctf/libctf.ver +++ b/libctf/libctf.ver @@ -159,6 +159,7 @@ LIBCTF_1.0 { ctf_link_add_ctf; ctf_link_add_cu_mapping; ctf_link_set_memb_name_changer; + ctf_link_set_variable_filter; ctf_link; ctf_link_add_strtab; ctf_link_shuffle_syms; -- cgit v1.1