---
name: "elf_fill"
section: "3"
platform: "linux"
package: "libelf"
version: "0.197-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux", "freebsd"]
url: "https://new.carta.tech/elf_fill"
---

# elf\_fill(3)

Set fill byte used when constructing or editing ELF object files.

## NAME

elf\_fill - Set fill byte used when constructing or editing ELF object files.

## SYNOPSIS

```
#include <libelf.h>
void elf_fill(int fill);
```

## DESCRIPTION

The **elf\_fill** function sets the fill byte used by libelf to pad new gaps between ELF sections or data elements when an ELF object file is resized or realigned using **elf\_update**. The default fill byte used by libelf is zero.

## PARAMETERS

- *fill*

  The value used to fill gaps in future writes to ELF objects.  This value should be between 0 and 255 (inclusive).  Only the least significant 8 bits are used.

## RETURN VALUE

**elf\_fill** returns no value.

## SEE ALSO

[**elf\_update**(3)](/elf_update/3.md), [**libelf**(3)](/libelf/3.md), [**elf**(5)](/elf/5.md)

## ATTRIBUTES

For an explanation of the terms used in this section, see [**attributes**(7)](/attributes/7.md).

| | | |
| --- | --- | --- |
| **Interface** | **Attribute** | **Value** |
| **elf\_fill**() | Thread safety | MT-Unsafe race |

## REPORTING BUGS

Report bugs to \<elfutils-devel@sourceware.org\> or https://sourceware.org/bugzilla/.
