]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
btf: expose get_btf_id
authorDavid Faust <david.faust@oracle.com>
Tue, 3 Aug 2021 17:04:10 +0000 (10:04 -0700)
committerDavid Faust <david.faust@oracle.com>
Tue, 7 Sep 2021 20:48:58 +0000 (13:48 -0700)
Expose the function get_btf_id, so that it may be used by the BPF
backend. This enables the BPF CO-RE machinery in the BPF backend to
lookup BTF type IDs, in order to create CO-RE relocation records.

A prototype is added in ctfc.h

gcc/ChangeLog:

* btfout.c (get_btf_id): Function is no longer static.
* ctfc.h: Expose it here.

gcc/btfout.c
gcc/ctfc.h

index 8cdd9905fb6ca853d3f9119f50dc2e71a860c5fe..cdc6c6378c099264968d9ce97bd81fd3dff77468 100644 (file)
@@ -156,7 +156,7 @@ init_btf_id_map (size_t len)
 /* Return the BTF type ID of CTF type ID KEY, or BTF_INVALID_TYPEID if the CTF
    type with ID KEY does not map to a BTF type.  */
 
-static inline ctf_id_t
+ctf_id_t
 get_btf_id (ctf_id_t key)
 {
   return btf_id_map[key];
index 14180c1e5de3fc5737d724fbea288537d5d3252c..a0b7e4105a8704b0a07d5d6c5c6f41cceffef2bc 100644 (file)
@@ -431,6 +431,7 @@ extern int ctf_add_variable (ctf_container_ref, const char *, ctf_id_t,
                             dw_die_ref, unsigned int);
 
 extern ctf_id_t ctf_lookup_tree_type (ctf_container_ref, const tree);
+extern ctf_id_t get_btf_id (ctf_id_t);
 
 /* CTF section does not emit location information; at this time, location
    information is needed for BTF CO-RE use-cases.  */