MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / GetSymName

Function GetSymName

BaseTools/Source/C/GenFw/Elf64Convert.c:295–326  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

293}
294
295STATIC
296const UINT8 *
297GetSymName (
298 Elf_Sym *Sym
299 )
300{
301 Elf_Shdr *StrtabShdr;
302 UINT8 *StrtabContents;
303 BOOLEAN foundEnd;
304 UINT32 i;
305
306 if (Sym->st_name == 0) {
307 return NULL;
308 }
309
310 StrtabShdr = FindStrtabShdr();
311 if (StrtabShdr == NULL) {
312 return NULL;
313 }
314
315 assert(Sym->st_name < StrtabShdr->sh_size);
316
317 StrtabContents = (UINT8*)mEhdr + StrtabShdr->sh_offset;
318
319 foundEnd = FALSE;
320 for (i= Sym->st_name; (i < StrtabShdr->sh_size) && !foundEnd; i++) {
321 foundEnd = (BOOLEAN)(StrtabContents[i] == 0);
322 }
323 assert(foundEnd);
324
325 return StrtabContents + Sym->st_name;
326}
327
328//
329// Find the ELF section hosting the GOT from an ELF Rva

Callers 1

WriteSections64Function · 0.70

Calls 1

FindStrtabShdrFunction · 0.70

Tested by

no test coverage detected