일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
- tcp 프로토콜
- 오류검출
- well known 포트
- 개발자취업
- 코딩테스트준비
- 항해99
- xv6
- 순서번호
- reducible
- 티스토리챌린지
- leetcode
- 데이터 전송
- tcp 세그먼트
- 프레임 구조
- 플로이드워셜
- 스레드
- 오류제어
- 서비스 프리미티브
- 비주기신호
- IEEE 802
- til
- 주기신호
- i-type
- mariadb
- 99클럽
- git merge
- 우분투db
- 오블완
- 그리디 알고리즘
- 토큰 버스
- Today
- Total
Unfazed❗️🎯
ELF 파일? ELF 헤더? 본문
이전 글 : https://9taetae9.tistory.com/2
The ELF (Executable and Linkable Format) and PE (Portable Executable) formats/ ELF 파일, PE 포맷?
The ELF (Executable and Linkable Format) and PE (Portable Executable) formats are two of the most common file formats for executables, shared libraries, and even some object files on various computer systems. They each serve to allow the OS and loader to u
9taetae9.tistory.com
ELF Header
Role: The ELF Header provides metadata about the file.
Location: Found at offset 0 of the file.
Structure:
The ELF header is defined by two types, depending on the architecture: Elf32_Ehdr for 32-bit systems and Elf64_Ehdr for 64-bit systems.
The structure contains:
1. e_ident (array): Specifies how to interpret the file, independent of the processor or the file's remaining contents. The array's indices are named using macros starting with the EI_ prefix.
2. e_type: Specifies the type of the file.
3. e_machine: Indicates the architecture required to use the file.
4. e_version: Represents the version information of the object file.
5. e_entry: Provides the virtual address where the system should transfer control when executing. If there's no entry point in the file, it holds the value 0.
6. e_phoff: Represents the file offset, in bytes, of the program header table. If there's no program header table, it holds the value 0.
7. e_shoff: Indicates the file offset, in bytes, of the section header table. If there's no section header table, it holds the value 0.
8. e_flags: Contains processor-specific flags associated with the file.
9. e_ehsize: Denotes the size, in bytes, of the ELF header.
10. e_phentsize: Holds the size, in bytes, of one entry in the file's program header table. All entries have the same size.
11. e_phnum: Represents the number of entries in the program header table. If there's no program header table, it holds the value 0.
12. e_shentsize: Specifies the size, in bytes, of one section header. All section headers in the section header table have the same size.
13. e_shnum: Indicates the number of entries in the section header table. If there's no section header table, it holds the value 0.
14. e_shstrndx: Contains the section header table index associated with the string table describing the section names. If there's no string table for section names, it holds the value SHN_UNDEF.
Alignment and Padding:
The ELF format ensures that all its data structures adhere to natural size and alignment guidelines suitable for the architecture. When necessary, data structures have explicit padding for correct alignment.
The ELF format is pivotal in Unix like operating systems and serves as the cornerstone for executables, shared libraries, and even core dumps.
'Operating System (운영체제)' 카테고리의 다른 글
멀티스레딩, 컨텍스트 스위치, 스케줄링, 프로세스 vs 스레드 (0) | 2025.02.06 |
---|---|
스레드 안전성 Thread Safety (0) | 2024.01.29 |
타이머 인터럽트(timer interrupt) 발생 주기?/ tick interrupt, timer interrupt (+ xv6 ) (0) | 2023.10.18 |
프로그램과 프로세스의 차이/(feat. 시스템 콜) (0) | 2023.10.16 |
The ELF (Executable and Linkable Format) and PE (Portable Executable) formats/ ELF 파일, PE 포맷? (0) | 2023.09.16 |