Linux perf编译not define GELF_ST_VISIBILITY问题解决方案

Posted smartvxworks

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Linux perf编译not define GELF_ST_VISIBILITY问题解决方案相关的知识,希望对你有一定的参考价值。

原因:

symbol-elf.c文件缺少对应GELF_ST_VISIBILITY定义

解决办法:

       添加如下定义:


#ifndef ELF32_ST_VISIBILITY
#define ELF32_ST_VISIBILITY(o)	((o) & 0x03)
#endif

/* For ELF64 the definitions are the same.  */
#ifndef ELF64_ST_VISIBILITY
#define ELF64_ST_VISIBILITY(o)	ELF32_ST_VISIBILITY (o)
#endif

/* How to extract information held in the st_other field.  */
#ifndef GELF_ST_VISIBILITY
#define GELF_ST_VISIBILITY(val)	ELF64_ST_VISIBILITY (val)
#endif

 参考代码:symbol-elf.c - tools/perf/util/symbol-elf.c - Linux source code (v5.17.8) - Bootlin

 

以上是关于Linux perf编译not define GELF_ST_VISIBILITY问题解决方案的主要内容,如果未能解决你的问题,请参考以下文章