From 1d7bd94e2fe68b38ebcf712b56460c9c4c57621e Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo Date: Tue, 31 Mar 2009 16:04:27 -0300 Subject: [PATCH] elf_symtab: Introduce elf_sym__is_local_object Will be used when encoding the OBJECT symtab entries in the objects CTF section (varibles/data). Signed-off-by: Arnaldo Carvalho de Melo --- elf_symtab.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/elf_symtab.h b/elf_symtab.h index 6c1dd49..a2d456b 100644 --- a/elf_symtab.h +++ b/elf_symtab.h @@ -57,6 +57,13 @@ static inline bool elf_sym__is_local_function(const GElf_Sym *sym) sym->st_shndx != SHN_UNDEF; } +static inline bool elf_sym__is_local_object(const GElf_Sym *sym) +{ + return elf_sym__type(sym) == STT_OBJECT && + sym->st_name != 0 && + sym->st_shndx != SHN_UNDEF; +} + /** * elf_symtab__for_each_symbol - iterate thru all the symbols *