| 293 | } |
| 294 | |
| 295 | STATIC |
| 296 | const UINT8 * |
| 297 | GetSymName ( |
| 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 |
no test coverage detected