binfmt/libelf/libelf_bind.c: Make naming of internal type compliant with coding standard. Yes, the ELF32 types do not follow the standard for historical reasons (and will be fixed someday), but let's not perpetuate the naming violation.

This commit is contained in:
Gregory Nutt
2019-03-20 09:34:08 -06:00
parent b174373faa
commit da1a561b6e
+23 -25
View File
@@ -74,16 +74,14 @@
* Private Types * Private Types
****************************************************************************/ ****************************************************************************/
/* REVISIT: This naming breaks the NuttX coding standard, but is consistent struct elf32_symcache_s
* with legacy naming of other ELF32 types.
*/
typedef struct
{ {
dq_entry_t entry; dq_entry_t entry;
Elf32_Sym sym; Elf32_Sym sym;
int idx; int idx;
} Elf32_SymCache; };
typedef struct elf32_symcache_s elf32_symcache_t;
/**************************************************************************** /****************************************************************************
* Private Data * Private Data
@@ -148,19 +146,19 @@ static int elf_relocate(FAR struct elf_loadinfo_s *loadinfo, int relidx,
FAR const struct symtab_s *exports, int nexports) FAR const struct symtab_s *exports, int nexports)
{ {
FAR Elf32_Shdr *relsec = &loadinfo->shdr[relidx]; FAR Elf32_Shdr *relsec = &loadinfo->shdr[relidx];
FAR Elf32_Shdr *dstsec = &loadinfo->shdr[relsec->sh_info]; FAR Elf32_Shdr *dstsec = &loadinfo->shdr[relsec->sh_info];
FAR Elf32_Rel *rels; FAR Elf32_Rel *rels;
FAR Elf32_Rel *rel; FAR Elf32_Rel *rel;
FAR Elf32_SymCache *cache; FAR elf32_symcache_t *cache;
FAR Elf32_Sym *sym; FAR Elf32_Sym *sym;
FAR dq_entry_t *e; FAR dq_entry_t *e;
dq_queue_t q; dq_queue_t q;
uintptr_t addr; uintptr_t addr;
int symidx; int symidx;
int ret; int ret;
int i; int i;
int j; int j;
rels = kmm_malloc(CONFIG_ELF_RELOCATION_BUFFERCOUNT * sizeof(Elf32_Rel)); rels = kmm_malloc(CONFIG_ELF_RELOCATION_BUFFERCOUNT * sizeof(Elf32_Rel));
if (rels == NULL) if (rels == NULL)
@@ -207,7 +205,7 @@ static int elf_relocate(FAR struct elf_loadinfo_s *loadinfo, int relidx,
sym = NULL; sym = NULL;
for (e = dq_peek(&q); e; e = dq_next(e)) for (e = dq_peek(&q); e; e = dq_next(e))
{ {
cache = (FAR Elf32_SymCache *)e; cache = (FAR elf32_symcache_t *)e;
if (cache->idx == symidx) if (cache->idx == symidx)
{ {
dq_rem(&cache->entry, &q); dq_rem(&cache->entry, &q);
@@ -225,7 +223,7 @@ static int elf_relocate(FAR struct elf_loadinfo_s *loadinfo, int relidx,
{ {
if (j < CONFIG_ELF_SYMBOL_CACHECOUNT) if (j < CONFIG_ELF_SYMBOL_CACHECOUNT)
{ {
cache = kmm_malloc(sizeof(Elf32_SymCache)); cache = kmm_malloc(sizeof(elf32_symcache_t));
if (!cache) if (!cache)
{ {
berr("Failed to allocate memory for elf symbols\n"); berr("Failed to allocate memory for elf symbols\n");
@@ -237,7 +235,7 @@ static int elf_relocate(FAR struct elf_loadinfo_s *loadinfo, int relidx,
} }
else else
{ {
cache = (FAR Elf32_SymCache *)dq_remlast(&q); cache = (FAR elf32_symcache_t *)dq_remlast(&q);
} }
sym = &cache->sym; sym = &cache->sym;