linux tutorial

Linux Tutorials and FAQ

 
Linux Tutorial and FAQ's

Homepage

The Linux tutorial section. More than 150 free linux tutorial and linux book for you to download here

Linux tutorial Info page

free Linux Tutorials Guides and FAQ's
The Linux FAQ
Linux Administration Guide 1
Linux Administration Guide 2

 

The Linux FAQ page 6 System Libraries

<previous Page 6 of 18 next>

This is the list of Frequently Asked Questions for Linux, the Free/Open Source UNIX-like operating system kernel that runs on many modern computer systems..

Table of Contents

2. General Information 8. Booting the OS. 14. Solutions to Common Problems.
3. The Linux Kernel 9. Application Software Management 15. Tips And Tricks
4. Disk Drives 10. Directory And File Management. 16. The X Window System
5. Partitions And Filesystem 11. Connecting To A Network 17. Frequently Encountered Error Messages
6. System Libraries 12. Troubleshooting 18. Online Resources

 

6. System Libraries

Q: Where Can I Find Linux System Specifications?
Q: What Is ld.so and How Do I Get It?
Q: How Do I Upgrade the Libraries without Trashing the System?
Q: What's All This about ELF? glibc?
Q: Where Can I Find Linux System Specifications?

Q: Where Can I Find Linux System Specifications?

A: As a start, look at the Linux Standards Base, http://www.linuxbase.org.  The site contains information about test software, file system organization, and shared library naming conventions.

Q: What Is ld.so and How Do I Get It?

A: ld.so is the dynamic library loader. Each binary using shared libraries used to have about 3K of start-upcode to find and load the shared libraries. Now that code has been put in a special shared library,/lib/ld.so, where all binaries can look for it, so that it wastes less disk space, and can be upgraded moreeasily.
The latestversion at the time of writing is ld.so.1.9.5.tar.gz./lib/ld-linux.so.1 is the same thing for ELF ("What's all this about ELF? ") and comes in the same
package as the a.out loader.

Q: How Do I Upgrade the Libraries without Trashing the System?

A:You should always have a rescue disk set ready when you perform this procedure, in the likely event thatsomething goes wrong!This procedure is especially difficult if you're upgrading very old libraries like libc4. But you should be ableto keep libc4 on the same system with libc5 libraries for the programs that still need them. The same holdstrue for upgrading from libc5 to the newer-yet glibc2 libraries.The problem with upgrading dynamic libraries is that the moment you remove the old libraries, the utilitiesthat you need to upgrade to the new version of the libraries don't work. There are ways around around this.One is to temporarily place a spare copy of the run time libraries, which are in /lib/, in /usr/lib/, or/usr/local/lib/, or another directory that is listed in the /etc/ld.so.conf file.For example, when upgrading libc5 libraries, the files in /lib/ might look something like:libc.so.5 libc.so.5.4.33 libm.so.5 libm.so.5.0.9These are the C libraries and the math libraries. Copy them to another directory that is listed in/etc/ld.so.conf, like /usr/lib/:$ cp -df /lib/libc.so.5* /usr/lib/$ cp -df /lib/libm.so.5* /usr/lib/6. System Libraries 20.$ ldconfig
Be sure to run ldconfig to upgrade the library configuration.
The files libc.so.5 and libm.so.5 are symbolic links to the actual library files. When you upgrade, the
new links will not be created if the old links are still there, unless you use the -f flag with cp. The -d flag to
cp will copy the symbolic link itself, and not the file it points to.
If you need to overwrite the link to the library directly, use the -f flag with ln.
For example, to copy new libraries over the old ones, try this. Make a symbolic link to the new libraries first,then copy both the libraries and the links to /lib/, with the following commands.$ ln -sf ./libm.so.5.0.48 libm.so.5$ ln -sf ./libc.so.5.0.48 libc.so.5$ cp -df libm.so.5* /lib$ cp -df libc.so.5* /lib
Again, remember to run ldconfig after you copy the libraries.
If you are satisfied that everything is working correctly, you can remove the temporary copies of the old
libraries from /usr/lib/ or wherever you copied them.

Q: What's All This about ELF? glibc?

A: See the ELF HOWTO by Daniel Barlow. Note that this is not the file move-to-elf, which is a
blow-by-blow account of how to upgrade to ELF manually.Linux has two different formats for executables, object files, and object code libraries, known as, "ELF". (Theold format is called "a.out".) They have advantages, including better support for shared libraries and dynamiclinking.Both a.out and ELF binaries can coexist on a system. However, they use different shared C libraries, both ofwhich have to be installed.If you want to find out whether your system can run ELF binaries, look in /lib for a file named,libc.so.5. If it's there, you probably have ELF libraries. If you want to know whether your installation
actually is ELF you can pick a representative program, like ls, and run file on it:
-chiark:~> file /bin/ls/bin/ls: Linux/i386 impure executable (OMAGIC) - strippedvalour:~> file /bin/ls/bin/ls: ELF 32-bit LSB executable, Intel 80386, version 1, stripped
There is a patch to get 1.2.x to compile using the ELF compilers, and produce ELF core dumps, at
ftp://tsx-11.mit.edu/pub/packages/GCC/. You do not need the patch merely to run ELF binaries. 1.3.x andlater do not need the patch at all.The GNU glibc2 libraries are essentially more recent versions of ELF libraries that follow most of the same
processes for dynamic linking and loading. Upgrade information is contained in How Do I Upgrade the
Libraries without Trashing the System?.

The Linux FAQ

6. System Libraries 21.The Linux FAQ

6. System Libraries 22.

<previous Page 6 of 18 next>

 
© Copyright 2002 [Aroms LTD] Linux tutorial