mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-25 16:57:52 +00:00
libctf: link: BTF support
This is in two parts, one new API function and one change. New API: +int ctf_link_output_is_btf (ctf_dict_t *); Changed API: unsigned char *ctf_link_write (ctf_dict_t *, size_t *size, - size_t threshold); + size_t threshold, int *is_btf); The idea here is that callers can call ctf_link_output_is_btf on a ctf_link()ed (deduplicated) dict to tell whether a link will yield BTF-compatible output before actually generating that output, so they can e.g. decide whether to avoid trying to compress the dict if they know it would be BTF otherwise (since compressing a dict renders it non-BTF-compatible). ctf_link_write() gains an optional is_btf output parameter that reports whether the dict that was finally generated is actually BTF after all, perhaps because the caller didn't call ctf_link_output_is_btf or wants to be robust against possible future changes that may add other reasons why a written-out dict can't be BTF at the last minute. These are simple wrappers around already-existing machinery earlier in this series.
This commit is contained in:
@@ -201,6 +201,7 @@ LIBCTF_2.0 {
|
||||
ctf_link;
|
||||
ctf_link_add_strtab;
|
||||
ctf_link_shuffle_syms;
|
||||
ctf_link_output_is_btf;
|
||||
ctf_link_write;
|
||||
|
||||
ctf_link_add_linker_symbol;
|
||||
|
||||
Reference in New Issue
Block a user