Links and differences between hard links and soft links
We know that files have filenames and data, which are divided into two parts on Linux:metadata (metadata) is an attached property of a file, such as file size, creation time, owner, and so on.User Data is the file data block, the data block is the place to record the real content of the file;
The metadata is in Linux, the inode number in the metadata (the Inode is part of the file metadata but it does not contain the filename, and the inode
Understand the runtime address and link address from the two-statement assembly, and the Assembly link address
First, let's look at two lines of assembly code:
1: adr r0, _start
2: ldr r1, =_start
Load the address value of a label. What is the difference between adr and ldr? Note that the ldr here is not a command ldr, but a pseudo command ldr. If you want to differentiate them, please refer to
In windows, the link library is divided into two types: static Link Library. lib and dynamic link library. dll. When a dynamic link library is used, a dynamic link library is usually provided. lib is called the import database. It mainly provides the function and symbol name
In Windows, there are two types of link libraries: Static link libraries. lib and dynamic link library. dll. Where a dynamic-link library is used, it usually provides a. lib, called the introduction library, which mainly provides functions and symbolic names exported by the DLL, allowing the
Uboot Link Script (why link script required)
The linker has two main functions, one is to combine several input files (. o files) into an output file (such as an elf-formatted executable file) according to certain rules; One is to bind the symbol to the address (the loader also does this part of the work)
The program from the source code to the binary executable file needs to go through:
Preprocessing
in LearningHard Linkwith theSymbolic Linkbefore, you need to know a little bit aboutInodewith theData Block. In theLinuxfile system, a file corresponds to aInodewith a number ofData Block. Inodewith theData Blockare identified by a number, such as30333aInode, the first20334aData Block. InodeAttributes of the file, such as the owner of the file, the owning user group, the permissions on the file, and a pointer to theData Blockthe pointer. The real content of the file is stored inData Blockin the.
visually control the shared library version.The format is: lib + math +. So + major version + minor version number + production numbersuch as: libmath.so.1.1.1234.Lib is the contract prefix name of a library on a Linux system,Math is the name of the library itself,So is the suffix name of the shared library,1.1.1234 is the version number of the shared library,Format: Major version number + minor version number + make (build) number.Major version number-represents the version of the current shar
1: Static link libraryA static link library is a relatively early occurrence. The static library is actually the commercial company will own the function library source code through compiles not to connect to form. O's target file, and then use the AR tool to archive the. o File as an archive file for. A (an archive of. A is also called a static link library file
regardless of the 3 file name of any one of the access, the effect is exactly the same, but if you delete any of them, Just minus 1of the value, not delete the actual content, (any existing file itself is a hard connection) only the count value becomes 0 that is no hard link to the time will be real delete content. Hard Link Features:the file has the same inode and data block;Only files that already exist
Both static and dynamic libraries share code. Static link library (LIB ):Complete all assembly work before the program execution and generate an executable target file (exe file ). Static databases have two features:
The executable file generated after the Link contains the code of all functions to be called, so it occupies a large disk space.
If multiple (calling the same library function)
permission, the T permission is stic_bit, we use two ordinary users to verify his role:As shown, we first deleted the LV account under the Lv-one account in the test directory under the 1.txt file, then we give the test directory to add t permissions, and then use Lv-one Delete the test directory under the subdirectory test1, the hint is not allowed, said with the T permission to play a role.Four Soft linksFormat ln-s source File link fileThe most in
Program compilation link process, program compilation link Process
Let's start with HelloWorld...
#include
Follow these steps to connect the source file hello.cppto hello.exe:
Run the following command to generate an executable file from the source file:
Linux:
Gcc-lstdc ++ Hello. cpp-o Hello. out // The lstdc parameter must be included; otherwise, the undefined reference to '_ gxx_personality_v0' error w
The difference between a static link library and a dynamic link libraryOne, Static link librarycompilation, compilation, compiling, precompiled--linksLinux:To generate a target fileg++-C Source.cpp-o SOURCE.OPackage as a static link libraryAR-CRV Source.a SOURCE.OUsing the static l
At present, Shanghai Grand View Electronic Technology Co., Ltd. (Shanghai Equity Trading Center listed, enterprise name:Big Vision Technology; Stock code:201276), a operated MD100-DL4 dual link (dual-link DVI) has been introduced on the basis of the original MD100Dispenser, the dispenser as a professionalDVI DistributionThe product has the industry-leading DVI transmission bandwidth support capability, enab
1. linked fileThere are two methods for linking: Soft link and hard link.
1. Soft link file
Soft links are also called symbolic links. This file contains the path name of another file. It can be any file or directory that can be linked to files of different file systems.A linked file can even link a non-existing fi
Dynamic Link Library DLL, static Link Library Lib, and imported library lib
When compiling a project with vs, we will choose dynamic link library DLL, static Link Library lib (static library ), but why can I specify the output lib when compiling the dynamic link library? Wh
I. IntroductionFor more information, seeOn Compiling and linking gcc/g ++ in UNIX systems.
Generally, the links to the function library are completed during the compilation period (compile time. All related object files and libraries are linked to form an executable file ). When the program is running, it has nothing to do with the function library, because all the required functions have been copied to their own doors. Therefore, these function libraries are called static libaray (static libara
Inode, hard link, and soft link methods for Linux File storage, and inode for file storageFile Storage
Files are stored on hard disks,Slice(Sector) is the smallest physical storage unit in the disk. Generally, the size of each slice is 512 bytes, but to improve efficiency, when reading a hard disk, the operating system often reads multiple sectors at a time (multiple sectors constitute a block ).Block(Block
Because we often call Dynamic Link Libraries written by third-party vendors or other compilers, the source files or. lib file, which is required for calling as VC implicit link to DLL (implicitly link to the DLL. This article will mainly discuss how to reconstruct the. Lib file without a source file or a. Lib input library file or calling a function that is not p
Hard Link LN:The Unix file system provides a mechanism for linking different files to the same file, called links. It allows a single program to use different names for the same file. The benefit is that the file system only has a copy of the file. The system simply implements this link by creating a new login entry in the directory. The login entry has a new file name and the inode number of the file to be
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.