From edaf06b435332e1bf89566b82099baf5255fcc7b Mon Sep 17 00:00:00 2001 From: Tao Sang Date: Thu, 9 Apr 2020 16:47:29 -0400 Subject: [PATCH] Hide elf Apis for internal use only Hide elf Apis so that there won't be mixing with external libelf Change-Id: I2b3d25a8ab3b161f4dd969e31ad45e8aa627263b [ROCm/clr commit: 02cd18813f438e4110f5c346e50338c5135178b7] --- projects/clr/rocclr/elf/utils/libelf/gelf.h | 2 ++ projects/clr/rocclr/elf/utils/libelf/libelf.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/projects/clr/rocclr/elf/utils/libelf/gelf.h b/projects/clr/rocclr/elf/utils/libelf/gelf.h index 152973824f..0a3a635bc5 100644 --- a/projects/clr/rocclr/elf/utils/libelf/gelf.h +++ b/projects/clr/rocclr/elf/utils/libelf/gelf.h @@ -72,6 +72,7 @@ typedef Elf64_Syminfo GElf_Syminfo; /* Symbol information */ #define GELF_ST_TYPE ELF64_ST_TYPE #define GELF_ST_VISIBILITY ELF64_ST_VISIBILITY +#pragma GCC visibility push(hidden) __BEGIN_DECLS long gelf_checksum(Elf *_elf); size_t gelf_fsize(Elf *_elf, Elf_Type _type, size_t _count, @@ -110,5 +111,6 @@ int gelf_update_move(Elf_Data *_dst, int _index, GElf_Move *_src); int gelf_update_syminfo(Elf_Data *_dst, int _index, GElf_Syminfo *_src); #endif __END_DECLS +#pragma GCC visibility pop #endif /* _GELF_H_ */ diff --git a/projects/clr/rocclr/elf/utils/libelf/libelf.h b/projects/clr/rocclr/elf/utils/libelf/libelf.h index a13c9d45c4..09fd2ebed7 100644 --- a/projects/clr/rocclr/elf/utils/libelf/libelf.h +++ b/projects/clr/rocclr/elf/utils/libelf/libelf.h @@ -187,6 +187,7 @@ enum Elf_Error { #define ELF_F_ARCHIVE 0x100U /* archive creation */ #define ELF_F_ARCHIVE_SYSV 0x200U /* SYSV style archive */ +#pragma GCC visibility push(hidden) __BEGIN_DECLS Elf *elf_begin(int _fd, Elf_Cmd _cmd, Elf *_elf, Elf_Mem *_mem); int elf_cntl(Elf *_elf, Elf_Cmd _cmd); @@ -258,5 +259,6 @@ Elf_Data *elf64_xlatetof(Elf_Data *_dst, const Elf_Data *_src, Elf_Data *elf64_xlatetom(Elf_Data *_dst, const Elf_Data *_src, unsigned int _enc); __END_DECLS +#pragma GCC visibility pop #endif /* _LIBELF_H_ */