Use ld_preload to save the accidentally deleted libc. so.6

Source: Internet
Author: User

C ({'fm ': 'as', 'F': '779717e8', 'f1': '9d73f1e4', 'F2': '4ca6be6b ', 'F3 ': '54e5243d ', 't': '123', 'title': This. innerhtml, 'url': This. href, 'p1': 3, 'y': '774f7fba '}) "href =" http://edu.codepub.com/2009/0704/8267.php "target =" _ blank ">

Use ld_preload to save the accidentally deleted libc. so.6
The symbolic link of libc. so.6 was accidentally deleted by a colleague ,.
Libc. so.6 contains not only the common C Runtime Library, but also the encapsulation of system calls.
As important as kernel32.dll in windows. After deletion by mistake, almost all new processes cannot start, because almost all programs depend on libc. so.6.
Therefore, SCP, CZ, CP, and LN are useless.

Writing such a file may be effective.

$ CAT/usr/lib/libc. So

/* Gnu ld script

Use the shared library, but some functions are only in

The static library, so try that secondarily .*/

Output_format (elf32-i386)

Group (/lib/libc. so.6/usr/lib/libc_nonshared.a as_needed (/lib/ld-linux.so.2 ))


I do not remember

The original file is still in
Lrwxrwxrwx 1 Root 11/lib/libc. so.6-> libc-2.4.so

So I think about ld_preload,
$ Ld_preload =/lib/libc-2.4.so ln-S/lib/libc-2.4.so/lib/libc. so.6

OK.

Linux includes some Solaris and other UNIX, will be preloaded from the ld_preload variable so, because the libc-2.4.so is the libc. so.6 object, so after loading
All symbols are fixed. Ld_preload can be used for Hook Functions and other purposes. I did not expect that the critical moment will be able to save lives.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.