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

Failed when modifying ld.so #743

Open
Yangff opened this issue Jul 3, 2022 · 1 comment
Open

Failed when modifying ld.so #743

Yangff opened this issue Jul 3, 2022 · 1 comment
Assignees

Comments

@Yangff
Copy link

Yangff commented Jul 3, 2022

Describe the bug
Just parse and write ld.so cause it stops to work

To Reproduce

[yangff@Yangff-Laptop tests]$ cp /lib64/ld-linux-x86-64.so.2 ./ld.so
[yangff@Yangff-Laptop tests]$ python
Python 3.10.4 (main, Mar 23 2022, 23:05:40) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import lief
>>> lief.parse('ld.so').write('ld1.so')
>>> exit()
[yangff@Yangff-Laptop tests]$ chmod +x ./ld1.so
[yangff@Yangff-Laptop tests]$ ./ld1.so
Inconsistency detected by ld.so: ../sysdeps/x86_64/dl-machine.h: 534: elf_machine_rela_relative: Assertion `ELFW(R_TYPE) (reloc->r_info) == R_X86_64_RELATIVE' failed!

Expected behavior

[yangff@Yangff-Laptop tests]$ ./ld.so
./ld.so: missing program name
Try './ld.so --help' for more information.

Environment (please complete the following information):

  • WSL2 with archlinux, ld.so (GNU libc) stable release version 2.35.
  • ELF
  • LIEF commit version: 0.12.1-c7b3ce3b

Additional context
Add any other context about the problem here.

@romainthomas
Copy link
Member

Modifying ld.so is challenging :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants