Rename CamelCase symbols to lowercase
This commit is contained in:
parent
35ec548033
commit
a5c92582a4
@ -61,13 +61,13 @@ typedef struct
|
|||||||
|
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
int strOff; /* Offset to string table */
|
int stroff; /* offset to string table */
|
||||||
int symOff; /* Offset to symbol table */
|
int symoff; /* offset to symbol table */
|
||||||
int lSymTab; /* Size of symbol table */
|
int lsymtab; /* size of symbol table */
|
||||||
int relEntSz; /* Size of relocation entry */
|
int relentsz; /* size of relocation entry */
|
||||||
int relOff[2]; /* Offset to the relocation section */
|
int reloff[2]; /* offset to the relocation section */
|
||||||
int relSz[2]; /* Size of relocation table */
|
int relsz[2]; /* size of relocation table */
|
||||||
} relData;
|
} reldata;
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Functions
|
* Private Functions
|
||||||
@ -586,32 +586,32 @@ static int modlib_relocatedyn(FAR struct module_s *modp,
|
|||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
memset((void *) &relData, 0, sizeof(relData));
|
memset((void *) &reldata, 0, sizeof(reldata));
|
||||||
|
|
||||||
for (i = 0; dyn[i].d_tag != DT_NULL; i++)
|
for (i = 0; dyn[i].d_tag != DT_NULL; i++)
|
||||||
{
|
{
|
||||||
switch (dyn[i].d_tag)
|
switch (dyn[i].d_tag)
|
||||||
{
|
{
|
||||||
case DT_REL :
|
case DT_REL :
|
||||||
relData.relOff[I_REL] = dyn[i].d_un.d_val;
|
reldata.reloff[I_REL] = dyn[i].d_un.d_val;
|
||||||
break;
|
break;
|
||||||
case DT_RELSZ :
|
case DT_RELSZ :
|
||||||
relData.relSz[I_REL] = dyn[i].d_un.d_val;
|
reldata.relsz[I_REL] = dyn[i].d_un.d_val;
|
||||||
break;
|
break;
|
||||||
case DT_RELENT :
|
case DT_RELENT :
|
||||||
relData.relEntSz = dyn[i].d_un.d_val;
|
reldata.relentsz = dyn[i].d_un.d_val;
|
||||||
break;
|
break;
|
||||||
case DT_SYMTAB :
|
case DT_SYMTAB :
|
||||||
relData.symOff = dyn[i].d_un.d_val;
|
reldata.symoff = dyn[i].d_un.d_val;
|
||||||
break;
|
break;
|
||||||
case DT_STRTAB :
|
case DT_STRTAB :
|
||||||
relData.strOff = dyn[i].d_un.d_val;
|
reldata.stroff = dyn[i].d_un.d_val;
|
||||||
break;
|
break;
|
||||||
case DT_JMPREL :
|
case DT_JMPREL :
|
||||||
relData.relOff[I_PLT] = dyn[i].d_un.d_val;
|
reldata.reloff[I_PLT] = dyn[i].d_un.d_val;
|
||||||
break;
|
break;
|
||||||
case DT_PLTRELSZ :
|
case DT_PLTRELSZ :
|
||||||
relData.relSz[I_PLT] = dyn[i].d_un.d_val;
|
reldata.relsz[I_PLT] = dyn[i].d_un.d_val;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -637,11 +637,11 @@ static int modlib_relocatedyn(FAR struct module_s *modp,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
relData.lSymTab = relData.strOff - relData.symOff;
|
reldata.lsymtab = reldata.stroff - reldata.symoff;
|
||||||
|
|
||||||
for (idx_rel = 0; idx_rel < N_RELS; idx_rel++)
|
for (idx_rel = 0; idx_rel < N_RELS; idx_rel++)
|
||||||
{
|
{
|
||||||
if (relData.relOff[idx_rel] == 0)
|
if (reldata.reloff[idx_rel] == 0)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -650,7 +650,7 @@ static int modlib_relocatedyn(FAR struct module_s *modp,
|
|||||||
|
|
||||||
ret = OK;
|
ret = OK;
|
||||||
|
|
||||||
for (i = 0; i < relData.relSz[idx_rel] / relData.relEntSz; i++)
|
for (i = 0; i < reldata.relsz[idx_rel] / reldata.relentsz; i++)
|
||||||
{
|
{
|
||||||
/* Process each relocation entry */
|
/* Process each relocation entry */
|
||||||
|
|
||||||
@ -658,17 +658,17 @@ static int modlib_relocatedyn(FAR struct module_s *modp,
|
|||||||
|
|
||||||
if (!(i % CONFIG_MODLIB_RELOCATION_BUFFERCOUNT))
|
if (!(i % CONFIG_MODLIB_RELOCATION_BUFFERCOUNT))
|
||||||
{
|
{
|
||||||
size_t relSize = (sizeof(Elf_Rel) *
|
size_t relsize = (sizeof(Elf_Rel) *
|
||||||
CONFIG_MODLIB_RELOCATION_BUFFERCOUNT);
|
CONFIG_MODLIB_RELOCATION_BUFFERCOUNT);
|
||||||
|
|
||||||
if (relData.relSz[idx_rel] < relSize)
|
if (reldata.relsz[idx_rel] < relsize)
|
||||||
{
|
{
|
||||||
relSize = relData.relSz[idx_rel];
|
relsize = reldata.relsz[idx_rel];
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = modlib_read(loadinfo, (FAR uint8_t *) rels,
|
ret = modlib_read(loadinfo, (FAR uint8_t *) rels,
|
||||||
relSize,
|
relsize,
|
||||||
relData.relOff[idx_rel] +
|
reldata.reloff[idx_rel] +
|
||||||
i * sizeof(Elf_Rel));
|
i * sizeof(Elf_Rel));
|
||||||
|
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
@ -722,16 +722,16 @@ static int modlib_relocatedyn(FAR struct module_s *modp,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Elf_Sym dynSym;
|
Elf_Sym dynsym;
|
||||||
|
|
||||||
addr = rel->r_offset - loadinfo->datasec + loadinfo->datastart;
|
addr = rel->r_offset - loadinfo->datasec + loadinfo->datastart;
|
||||||
|
|
||||||
if ((*(uint32_t *) addr) < loadinfo->datasec)
|
if ((*(uint32_t *) addr) < loadinfo->datasec)
|
||||||
dynSym.st_value = *(uint32_t *) addr + loadinfo->textalloc;
|
dynsym.st_value = *(uint32_t *) addr + loadinfo->textalloc;
|
||||||
else
|
else
|
||||||
dynSym.st_value = *(uint32_t *) addr -
|
dynsym.st_value = *(uint32_t *) addr -
|
||||||
loadinfo->datasec + loadinfo->datastart;
|
loadinfo->datasec + loadinfo->datastart;
|
||||||
ret = up_relocate(rel, &dynSym, addr);
|
ret = up_relocate(rel, &dynsym, addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
|
@ -191,11 +191,11 @@ static inline int modlib_loadfile(FAR struct mod_loadinfo_s *loadinfo)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int bssSize = phdr->p_memsz - phdr->p_filesz;
|
int bsssize = phdr->p_memsz - phdr->p_filesz;
|
||||||
ret = modlib_read(loadinfo, data, phdr->p_filesz,
|
ret = modlib_read(loadinfo, data, phdr->p_filesz,
|
||||||
phdr->p_offset);
|
phdr->p_offset);
|
||||||
memset((FAR void *)((uintptr_t) data + phdr->p_filesz), 0,
|
memset((FAR void *)((uintptr_t) data + phdr->p_filesz), 0,
|
||||||
bssSize);
|
bsssize);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user