Linux Kernel series-11. ELF format for operating system development, linuxelf
Shows the structure of the ELF file:
The ELF File consists of four parts: ELF header, Program header table, Section (Sections), and Section header table ).
In fact, a file does not necessarily contain all this content, and their locations ma
To keep it concise, this article does not describe some details, such as weak variables and got.This document assumes that the reader understands the ELF file format. The code is included in the attachment.If the Forum does not support attachments, you can send an email to me.1. Loading elf filesIn the ELF File, use the section and program structures to describe
ELF
strong sign and weak sign (this section is for others)
We often encounter a situation in programming that is called a symbol repetition definition. Multiple destination files contain definitions of the same name global symbol, then the target file link will appear when the symbol is repeatedly defined error. For example, we have defined a global reshaping variable global for both target file A and target file B, and have initialized all of them,
Document directory
1. ELF File Header
Link Program
Find and link all referenced external modules. These external modules or function libraries generally come from developers, operating systems, and C Runtime libraries.
The link program extracts these function libraries, modifies the pointer position (relocate), and cross-references the symbol parsing in the module to generate an executable module. The symbol can be global or local. Global symbols
ELF magic number parsing in Linux: in Linux, we can usually use the readelf command to view ELF File Information. For example, the www.2cto.com ELF file contains 32-bit and 64-bit versions. The structure information of the 32-bit version is as follows: The above structure basically corresponds to the elf information of
Inspired by "Csapp" P453, want to actually look at the content of the elf file, so do a simple attempt, hope worthwhile.The program that is used for demo is:Swap.cextern int Buf[];int *bufp0 = buf[0];int *bufp1;void swap () { int temp; BUFP1 = buf[1]; temp = *bufp0; *bufp0 = *BUFP1; *BUFP1 = temp;}Main.c#include The following command readelf commands to explore the elf interior. ?Can see some
ArticleDirectory
Introduction
Solution: SOF + elf> flash> hex> JIC
Reference
Introduction
After downloading the flash programmer by using the niosii flash programmer, the problem that the program cannot be started from the new source is concentrated in the following versions:
9.0sp2
9.1, 9.1sp2
11.0
Basically, there are bugs in these series FLASH leader versions. Among them, 11.0 cannot be erased when the JIC is
Many users will be 360 security guards set to open the start, so every time the boot, there will be a 360 security defender of the cartoon characters in the computer screen, the cartoon task is called: 360 security guard on Elf, in addition to the lovely appearance, Through Andy Elf can also directly call some of the 360 security guard functions, such as settings, timing shutdown. However, the recent user t
The generic Elf file consists of three index tables: Elf Header,program header table,section Header table.1 ELF Header: At the beginning of the file, a roadmap was saved, describing the organization of the file.2 Program Header table: Tells the system how to create a process image. The target file used to construct the process image must have the Program Header t
problem that I'm struggling with:Installation of arm-elf-gdb ....The installation process is as follows:Http://blog.chinaunix.net/uid-15007890-id-2377453.htmlDownload GDB installation package: ftp://ftp.gnu.org/gnu/gdb/Tar jxvf gdb-7.0.tar.bz2CD gdb-7.0mkdir Build-gdbCD Build-gdb.. /configure--target=arm-elfMakeMake installWhere you should encounter GCC compilation all warning have followed the make error of errorThis is because the current version o
debug. Want to see where in the end is not normal execution.And that raises the question that I have to struggle with:Installation of Arm-elf-gdb.。。。The installation process is this:Http://blog.chinaunix.net/uid-15007890-id-2377453.htmlDownload GDB installation package: ftp://ftp.gnu.org/gnu/gdb/Tar jxvf gdb-7.0.tar.bz2CD gdb-7.0mkdir Build-gdbCD Build-gdb.. /configure--target=arm-elfMakeMake installYou should encounter GCC compile all warning to mak
Android is built on Linux, and its underlying code is assembled by installing the Linux executable file--elf format. This article combined with the so file in Android to understand the elf format, most of the data collected online, elf format is located in Android Source: Elf.h.elf can be broadly divided into three parts: Elf
Analysis on the Relationship between GCC, arm-Linux-GCC, and arm-elf-gcc
Embedded Development Exchange Group 280352802, welcome to join!1. Introduction to GCC
The GNU Compiler Collection, usually GCC for short, is a set of compilers developed by GNU. Why is it an editor set rather than a compiler? This is because it not only supports C language compilation, but also supports many languages such as C ++, Ada, and Objective C. In addition, GCC's support
Link ProgramFind and link all referenced external modules. These external modules or function libraries generally come from developers, operating systems, and C Runtime libraries.
The link program extracts these function libraries, modifies the pointer position (relocate), and cross-references the symbol parsing in the module to generate an executable module. The symbol can be global or local. Global symbols can be defined inside a module or referenced outside another module.
Static databases ar
ELF File Format
In the Linux World of Blackfin, there are two basic file formats:
Flat: a binary flat file is usually called bflt. It is a relatively simple lightweight executable format based on the original A. Out format. Bflt file is the default file format of embedded Linux.
Fdpic elf: the executable and link formats were initially developed by the UNIX System Lab and have now become the standard fil
Introduction to Linux kernel engineering-process: How ELF files are executed
1. Process Execution
We all know that windows processes cannot be opened by double-clicking in linux, and vice versa. However, programs written in C or golang can be compiled in linux and compiled in windows. Of course, if you call an OS-specific system call, it cannot be executed. Specifically, the compilation fails. We will discuss the use of standard C-library functions fo
Recently has been learning elf-related information, a little summary, recorded here, but also convenient for later inspection.Elf is a Unix-like system and of course includes executable file formats on Android (also including. So and. O class files). Can be understood as an EXE or DLL file format on an Android system. Understanding the Elf file specification is a prerequisite for understanding process loadi
In addition to the. Text,. Data, And. BSS segments, there are other common segments, as shown below:
. Strtab: string table, used to store various strings used in elf files.
. Symtab: symbol table. Each symbol in the file can be used here.
. Shstrtab: The name table of each segment. It is actually a string array composed of the names of each segment.
. Hash: Symbol hash table.
. Line: The line number table during debugging, that is, the table correspo
Http://zhiwei.li/text/2009/04/elf%E7%9A%84got%E5%92%8Cplt%E4%BB%A5%E5%8F%8Apic/
The shared libraries in ELF format use PIC technology to make code and data references irrelevant to addresses. programs can be loaded to any location in the address space. PIC does not use absolute addresses for code redirection and branch commands. PIC creates a global offset table got that stores all global variables and poi
Constructing a drop-to-dl-resolve chain through ELF Dynamic Loading)
As we all know when you play the CTF server, PWN vulnerability issues generally provide an executable program and a libc library with dynamic links to program running. The library function offset address can be obtained through libc. so, and the address of the actual function in the process is calculated in combination with the libc function address in the leaked GOT table to bypass
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.