avast / avast/retdec

Show section name as symbol name in fileinfo relocation tables

Open
#544 3 comments 0 reactions 1 assignee View on GitHub

@PeterMatula is already working on this.

Since Jun 27, 2019.

C-fileformat enhancement T-format-elf
Dominant language
C++
Stars
8.6k
Forks
1k
PR merge metrics
No merged PRs in 30d

Description

Right now, fileinfo relocation tables show an empty symbol name if the relocation is referring to a section. This also causes some issues when it gets passed to the decoder.

Example from readelf:

Relocation section '.rel.text' at offset 0x2e54 contains 118 entries:
Offset Info Type Sym.Value Sym. Name
00000774 00000105 R_MIPS_HI16 00000000 .text
00000778 00000106 R_MIPS_LO16 00000000 .text
00000e90 00000405 R_MIPS_HI16 00000000 .rodata
00000e9c 00000406 R_MIPS_LO16 00000000 .rodata
00000f48 00000405 R_MIPS_HI16 00000000 .rodata
00000f50 00000406 R_MIPS_LO16 00000000 .rodata
00000ffc 00000105 R_MIPS_HI16 00000000 .text
00001008 00000106 R_MIPS_LO16 00000000 .text
00001110 00000705 R_MIPS_HI16 00000000 .bss
0000111c 00000706 R_MIPS_LO16 00000000 .bss
00001114 00001f05 R_MIPS_HI16 00000e90 abcd_1
00001124 00001f06 R_MIPS_LO16 00000e90 abcd_1

RetDec fileinfo output:

i type offset symbol name symValue addend calcValue

0 5 0x0774 0 0 0
1 6 0x0778 0 0 0
2 5 0x0e90 0 0 0
3 6 0x0e9c 0 0 0
4 5 0x0f48 0 0 0
5 6 0x0f50 0 0 0
6 5 0x0ffc 0 0 0
7 6 0x1008 0 0 0
8 5 0x1110 0 0 0
9 6 0x111c 0 0 0
10 5 0x1114 abcd_1 3728 0 0
11 6 0x1124 abcd_1 3728 0 3728

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.