Slide 3
Slide 3 text
How do we link struct_ops programs? (Read ELF)
1. Reading ELF file:
a. Classify ‘.struct_ops‘ and ‘.struct_ops.link’ as structOpsSection
b. Load BTF data from the ELF file to obtain type information (datasec name , map size, struct
members…)
2. Processing the ‘struct_ops’ section
a. The ‘struct_ops’ section is used to create Map instance
b. A function that processes the section should be generate ‘sturct_ops_spec’ which contains
‘user-defined struct data’ and related program information.
c. Collecting ‘relo’: each relo entry, it determines which StructOps program corresponds to which
member of the StructOps Map.
d. Associating Programs with Maps: based on the ‘relo’ information, programs should be associated with
the appropriate the StructOps Map.