Executable and Linkable Format
ELF (Executable and Linkable Format)는 실행 파일, 목적 파일, 공유 라이브러리 그리고 코어 덤프를 위한 표준 파일 형식이다. 1999년 86open 프로젝트에 의해 x86 기반 유닉스, 유닉스 계열 시스템들의 표준 바이너리 파일 형식으로 선택되었다.
Executable image
Elf-executable_image.jpg
How to using rpath
#include <stdio.h>
#include <elf.h>
#include <link.h>
int main()
{
const ElfW(Dyn) *dyn = _DYNAMIC;
const ElfW(Dyn) *rpath = NULL;
const char *strtab = NULL;
for (; dyn->d_tag != DT_NULL; ++dyn) {
if (dyn->d_tag == DT_RPATH) {
rpath = dyn;
} else if (dyn->d_tag == DT_STRTAB) {
strtab = (const char *)dyn->d_un.d_val;
}
}
if (strtab != NULL && rpath != NULL) {
printf("RPATH: %s\n", strtab + rpath->d_un.d_val);
}
return 0;
}
Tutorials
Making our own executable packer
- [추천] Making our own executable packer 1 (archive)
- What's in a Linux executable?
- Running an executable without exec
- Position-independent code
- ELF relocations
- The simplest shared library
- Loading multiple ELF objects
- Dynamic symbol resolution
- Dynamic linker speed and correctness
- GDB scripting and Indirect functions
- Safer memory-mapped structures
- More ELF relocations
- A no_std Rust binary
- Thread-local storage
See also
Favorite site
- Wikipedia (en) ELF에 대한 설명
- Linker를 마무리 짓자 - ELF와 fromelf 까지! 2
- ELF File Format 3
- SPARC Assembler Memory Map
- ELF란 무엇일까? 4
- Executable and Linkable Format (ELF) 5