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