In addition to executable files in Linux, there are several files stored in ELF format, including dynamic library files (.so), relocatable files (.o). ), core dump file (the system saves some process information to this type of file when the process terminates). We can use the file command to view the file type eg:
? 1 2 3 xiang@xiang:~/workspace/linux$ file prim prim: ELF 32-bit LSB executable, Intel 80386, version 1 ( SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=0xd54ce2ecedb22482c79f597093ff8c0b8f7c7113, not stripped xiang@xiang:~/workspace/linux$ About the format of the ELF file, which contains the file header ( File header), code segment (.text), data segment (.data) uninitialized data segment (.bss), etc. The objdump command can be used to view the information of each segment.
? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 xiang@xiang:~/workspace/algorithm$ g++ -c Prim.cpp -o prim.o xiang@xiang:~/workspace/algorithm$ objdump -h prim.o prim.o: file format elf32-i386 Sections: Idx Name Size VMA LMA File off Algn 0 .text 0000031f 00000000 00000000 00000034 2**2 CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE 1 .data 00000000 00000000 00000000 00000354 2**2 CONTEN TS, ALLOC, LOAD, DATA 2 .bss 003d3c21 00000000 00000000 00000360 2**5 ALLOC 3 .rodata 00000008 00000000 00000000 00000360 2**2 CONTENTS, ALLOC, LOAD, READONLY, DATA 4 .ctors 00000004 00000000 00000000 00000368 2**2 CONTENTS, ALLOC, LOAD, RELOC, DATA 5 .comment 0000002c 00000000 00000000 0000036c 2**0 CONTENTS, READONLY 6 .note.GNU-stack 00000000 00000000 00000000 00000398 2**0 CONTENTS, READONLY 7 .eh_frame 000000dc 00000000 00000000 00000398 2* *2 CONTENTS, ALLOC, LOAD, RELOC, READONLY, DATA xiang@xiang:~/workspace/algorithm$ objdump -h prim 1, the file header contains the magic number of the file in the file header. Word length, version, running platform, file type, entry address, short message, etc., where the magic number is used to tell the type of the system file, such as the magic number of the ELF file is DEL + ELF,
ubuntu gedit Chinese garbled looks very annoying, this article provides two solutions, terminal comm
Greg Kroah-Hartman today announced the seventh release of Linux Kernel 3.15, which is small
Root directory permissions settings For security, we need to use specific users and user groups to
in Linux explains the output of the free command on Linux. The following is the result of the free r
What are the common commands for Linux?
Linux installation U disk boot
Three important times in Linux
Linux system main directory role
Network configuration commands under Linux
The difference between setting the environment variable configuration file under Linux
How to create and unzip zip, tar, tar.gz and tar.bz2 files under Linux
Sky Player officially opened to UK Windows 7 users
Where is the Win10 calculator? Three ways to open the Win10 calculator graphic introduction
Win10 system running Age of Empires 2 prompt error code 0xc0000022 reasons and solutions
How to delete the Windows.old folder that appears when win10 is updated?
Win7 gadgets that pass the time Picture Puzzle
How to solve the problem with Win7 system device manager without network adapter?
Win7 easily sets up multi-regional time
Cross-device sync Bit IE11 browser to add sync account
Let Win8 automatically log in to the system and tap a few keys
Win10's first major update automatically uninstalled a number of third-party anti-virus software