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