Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] RetroWrite omits data sections #38

Open
miksh opened this issue Jun 6, 2022 · 0 comments
Open

[BUG] RetroWrite omits data sections #38

miksh opened this issue Jun 6, 2022 · 0 comments
Labels
analysis-needed This issue needs analysis and possible research to solve. bug Something isn't working

Comments

@miksh
Copy link

miksh commented Jun 6, 2022

Description:
RetroWrite did not create data sections, like .data.rel.ro.local, .fini.array
As a result, RetroWrite not only recover certain relocation information,
but also emit incorrect assembly code.

My test program has relocation information in .data.rel.ro.local

$ readelf -r  hello  | grep .data.rel.ro.local -A 20
Relocation section '.rela.data.rel.ro.local' at offset 0x9a3d8 contains 165 entries:
  Offset          Info           Type           Sym. Value    Sym. Name + Addend
000000020360  000100000001 R_X86_64_64       0000000000003c90 .text + 26a0
000000020368  000100000001 R_X86_64_64       0000000000003c90 .text + 2d60
000000020370  000100000001 R_X86_64_64       0000000000003c90 .text + 26b0
000000020378  000100000001 R_X86_64_64       0000000000003c90 .text + 2e20
...

Its binary code refers .data.rel.ro.local section.

  • Disassembly code
    61ec:	48 8d 05 6d a1 01 00 	lea    0x1a16d(%rip),%rax        # 20360 <sort_functions>

However, RetroWrite emited weird assembly code.

  • Reassembled code
.LC61ec:
	leaq 41984+.LC15f60(%rip), %rax

I examined the reassembly file and found that RetroWrite did not create .data.rel.ro.local section.

I hope to fix the errors.

Thanks.

@miksh miksh added analysis-needed This issue needs analysis and possible research to solve. bug Something isn't working labels Jun 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analysis-needed This issue needs analysis and possible research to solve. bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant