@@ -43,6 +43,7 @@ struct var_info {
uint64_t addr;
const char *name;
uint32_t sz;
+ uint32_t shndx;
};
struct elf_secinfo {
@@ -1145,7 +1146,7 @@ static bool btf_encoder__percpu_var_exists(struct btf_encoder *encoder, uint64_t
return true;
}
-static int btf_encoder__collect_percpu_var(struct btf_encoder *encoder, GElf_Sym *sym, size_t sym_sec_idx)
+static int btf_encoder__collect_percpu_var(struct btf_encoder *encoder, GElf_Sym *sym, uint32_t sym_sec_idx)
{
const char *sym_name;
uint64_t addr;
@@ -1195,6 +1196,7 @@ static int btf_encoder__collect_percpu_var(struct btf_encoder *encoder, GElf_Sym
encoder->variables.vars[encoder->variables.var_cnt].addr = addr;
encoder->variables.vars[encoder->variables.var_cnt].sz = size;
encoder->variables.vars[encoder->variables.var_cnt].name = sym_name;
+ encoder->variables.vars[encoder->variables.var_cnt].shndx = sym_sec_idx;
encoder->variables.var_cnt++;
return 0;
@@ -1202,7 +1204,7 @@ static int btf_encoder__collect_percpu_var(struct btf_encoder *encoder, GElf_Sym
static int btf_encoder__collect_symbols(struct btf_encoder *encoder, bool collect_percpu_vars)
{
- Elf32_Word sym_sec_idx;
+ uint32_t sym_sec_idx;
uint32_t core_id;
GElf_Sym sym;
Signed-off-by: Stephen Brennan <stephen.s.brennan@oracle.com> --- btf_encoder.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)