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

Function GetSymName

BaseTools/Source/C/GenFw/Elf32Convert.c:294–325  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

WriteSections32Function · 0.70

Calls 1

FindStrtabShdrFunction · 0.70

Tested by

no test coverage detected