An open API service indexing awesome lists of open source software.

https://github.com/alessandro-salerno/ezld

Tiny, simple, and portable ELF linker
https://github.com/alessandro-salerno/ezld

assembler assembly c cli elf elf-parser elf32 libfuzzer linker lowlevel portable rars risc-v risc-v32 riscv-32 rv32i static-linker toolchain

Last synced: about 2 months ago
JSON representation

Tiny, simple, and portable ELF linker

Awesome Lists containing this project

README

        

# βš™οΈ ezld β€” Tiny Static ELF Linker

[![Contributors][contributors-shield]][contributors-url]
[![Forks][forks-shield]][forks-url]
[![Stargazers][stars-shield]][stars-url]
[![Issues][issues-shield]][issues-url]
[![MIT License][license-shield]][license-url]
![Lines of Code](https://tokei.rs/b1/github/Alessandro-Salerno/ezld)

> A tiny, simple, and portable static [Linker](https://en.wikipedia.org/wiki/Linker_(computing)) for the [ELF](https://en.wikipedia.org/wiki/Executable_and_Linkable_Format) format.

---

## πŸ›  Features
- πŸ”Ή Command-line interface for direct usage
- πŸ”Ή No OS-specific libc dependency (portable across platforms)
- πŸ”Ή Supports section alignment, entry point overrides, and more
- πŸ”Ή Usable as a library or standalone binary
- πŸ”Ή Designed with simplicity and clarity in mind

---

## πŸš€ Usage

```bash
ezld by Alessandro Salerno
The EZ ELF Linker

Usage: ezld [] [] []

COMMANDS:
-h, --help Show this menu
-v, --version Show version information

OPTIONS:
-e, --entry-sym Set the entry point symbol (default: '_start')
-s, --section Set base virtual address for section (e.g., -s .text=0x4000)
-a, --align Set PT_LOAD segment alignment (e.g., -a 0x1000)
-o, --output Set output file path (default: 'a.out')
```

---

## βš™οΈ Building from Source

Use the included `Makefile` to build:

```bash
make debug # Build with debug info, sanitizers, -O0
make release # Build optimized release version
```

---

## πŸ“¦ Installing via tarman

Install with [`tarman`](https://github.com/Alessandro-Salerno/tarman) from the [tarman user repository](https://github.com/Alessandro-Salerno/tarman-user-repository):

```bash
tarman install -r ezld
```

---

## 🌍 Portability

> πŸ’‘ **ezld is platform-agnostic.**

Though it links **ELF binaries**, it's designed to run on any host, including:
- 🐧 UNIX-like systems
- πŸͺŸ Windows
- πŸ§ͺ [SalernOS](https://github.com/Alessandro-Salerno/SalernOS-Kernel)

ezld avoids non-standard libc functions, improving portability and making it suitable for low-level projects, OS development, or educational purposes.

---

## πŸ‘¨β€πŸ’» Project Context

ezld was created as part of the [`rarsjs`](https://github.com/Alessandro-Salerno/rarsjs) project. It’s meant to be a **learning tool** and **experimentation ground** for understanding the inner workings of static linking and ELF formats.

---

## βš–οΈ License

This project includes code from:
- [musl libc](https://musl.libc.org/)
- [tarman](https://github.com/Alessandro-Salerno/tarman)

ezld is licensed under the [MIT License](LICENSE). Third-party code may have distinct copyright.

---

[contributors-shield]: https://img.shields.io/github/contributors/Alessandro-Salerno/ezld.svg?style=flat-square
[contributors-url]: https://github.com/Alessandro-Salerno/ezld/graphs/contributors
[forks-shield]: https://img.shields.io/github/forks/Alessandro-Salerno/ezld.svg?style=flat-square
[forks-url]: https://github.com/Alessandro-Salerno/ezld/network/members
[stars-shield]: https://img.shields.io/github/stars/Alessandro-Salerno/ezld.svg?style=flat-square
[stars-url]: https://github.com/Alessandro-Salerno/ezld/stargazers
[issues-shield]: https://img.shields.io/github/issues/Alessandro-Salerno/ezld.svg?style=flat-square
[issues-url]: https://github.com/Alessandro-Salerno/ezld/issues
[license-shield]: https://img.shields.io/github/license/Alessandro-Salerno/ezld.svg?style=flat-square
[license-url]: https://github.com/Alessandro-Salerno/ezld/blob/master/LICENSE.txt