• Stars
    star
    200
  • Rank 189,132 (Top 4 %)
  • Language
    C
  • License
    GNU General Publi...
  • Created about 7 years ago
  • Updated 5 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Utility to remove unused ELF sections causing warnings.

termux-elf-cleaner

Utility for Android ELF files to remove unused parts that the linker warns about.

Description

When loading ELF files, the Android linker warns about unsupported dynamic section entries with warnings such as:

WARNING: linker: /data/data/org.kost.nmap.android.networkmapper/bin/nmap: unused DT entry: type 0x6ffffffe arg 0x8a7d4
WARNING: linker: /data/data/org.kost.nmap.android.networkmapper/bin/nmap: unused DT entry: type 0x6fffffff arg 0x3

This utility strips away the following dynamic section entries:

  • DT_RPATH - not supported in any Android version.
  • DT_GNU_HASH - supported from Android 6.0.
  • DT_RUNPATH - supported from Android 7.0.
  • DT_VERDEF - supported from Android 6.0.
  • DT_VERDEFNUM - supported from Android 6.0.
  • DT_VERNEEDED - supported from Android 6.0.
  • DT_VERNEEDNUM - supported from Android 6.0.
  • DT_VERSYM - supported from Android 6.0.
  • DT_AARCH64_BTI_PLT - supported from Android 12.
  • DT_AARCH64_PAC_PLT - supported from Android 12.
  • DT_AARCH64_VARIANT_PCS - supported from Android 12.

It also removes the three ELF sections of type:

  • SHT_GNU_verdef
  • SHT_GNU_verneed
  • SHT_GNU_versym

And makes sure that the alignment of a TLS segment is at least 32 (for 32bit arches) or 64 (for 64bit arches), to prevent errors similar to:

error: "valgrind": executable's TLS segment is underaligned: alignment is 8, needs to be at least 64 for ARM64 Bionic

Usage

Usage: termux-elf-cleaner [OPTION-OR-FILENAME]...

Processes ELF files to remove unsupported section types and
dynamic section entries which the Android linker warns about.

Options:

--api-level NN        choose target api level, i.e. 21, 24, ..
--dry-run             print info but but do not remove entries
--quiet               do not print info about removed entries
--help                display this help and exit
--version             output version information and exit

License

SPDX-License-Identifier: GPL-3.0-or-later

See also

More Repositories

1

termux-app

Termux - a terminal emulator application for Android OS extendible by variety of packages.
Java
30,073
star
2

termux-packages

A package build system for Termux.
Shell
12,032
star
3

termux-api

Termux add-on app which exposes device functionality as API to command line programs.
Java
1,929
star
4

termux-x11

Termux X11 add-on application.
C
1,412
star
5

proot-distro

An utility for managing installations of the Linux distributions in Termux.
Shell
1,403
star
6

termux-styling

Termux add-on app for customizing the terminal font and color theme.
Kotlin
987
star
7

termux-root-packages

Termux packages that are only usable by root users.
Shell
976
star
8

termux-api-package

Termux package containing scripts to call functionality in Termux:API.
Shell
926
star
9

termux-tasker

Termux add-on app for integration with Tasker.
Java
850
star
10

termux-widget

Termux add-on app which adds shortcuts to commands on the home screen.
Java
828
star
11

termux-boot

Termux add-on app allowing programs to be run at boot.
Java
800
star
12

termux.github.io

The main termux site and help pages.
HTML
746
star
13

proot

An chroot-like implementation using ptrace.
C
696
star
14

termux-gui

A plugin for Termux to use native Android GUI components from CLI applications.
Kotlin
570
star
15

x11-packages

A set of packages using X11 Windows System.
Shell
535
star
16

termux-docker

Termux environment packaged as Docker image.
Dockerfile
435
star
17

termux-float

Termux add-on app to show the terminal in a floating terminal window.
Java
414
star
18

termux-create-package

Python script to create Termux packages easily.
Python
388
star
19

game-packages

Games for Termux
Shell
308
star
20

termux-apt-repo

Script to create Termux apt repositories.
Python
286
star
21

termux-services

Scripts to handle services in termux.
Shell
258
star
22

termux-tools

Scripts and small programs that are packaged into termux's termux-tools package
Shell
210
star
23

science-packages

Science packages for Termux
C
207
star
24

termux-exec

A execve() wrapper to fix problem with shebangs.
C
161
star
25

command-not-found

Utility for suggesting packages in case typed command was not found.
C++
157
star
26

play-audio

Command-line tool to play audio using OpenSL ES.
C++
122
star
27

termux-auth

Password authentication utilities for Termux.
C
116
star
28

libandroid-shmem

System V shared memory emulation on Android using ashmem.
C
114
star
29

termux-packaging

Termux packaging tools.
Rust
90
star
30

TermuxAm

Android Oreo-compatible am command reimplementation.
Java
85
star
31

repology-metadata

Scripts and Github Actions workflow for generating Repology metadata.
Shell
77
star
32

termux-root-packages-21-bin

termux-root-packages debs for android 5 and 6. Archived from Bintray repository.
53
star
33

wcwidth

A Unicode 15-conformant implementation of wcwidth() in C.
C
40
star
34

termux-failsafe

An app providing a way to launch failsafe sessions.
Kotlin
40
star
35

termux.com

Sync for termux.github.io/termux.dev at termux.com
39
star
36

libandroid-support

C
32
star
37

termux-am-socket

Faster termux-am implementation that connects to a receiver in termux-app using a unix socket
Shell
32
star
38

termux-language-server

🛠️ A language server for some specific bash scripts
Python
31
star
39

science-packages-21-bin

science-package debs for android 5 and 6. Archived from Bintray repository.
25
star
40

getconf

A simple standalone getconf(1) implementation.
C
25
star
41

game-packages-21-bin

game-package debs for android 5 and 6. Archived from Bintray repository.
24
star
42

whatprovides

Utility to find out packages using specific files. Deprecated in favor of apt-file.
Shell
21
star
43

shared-library-testcase

Test case for shared library symbol visibility on dlopen().
C
14
star
44

termux-am-library

Java
14
star
45

distfiles

Moved from https://dl.bintray.com/termux/upstream
11
star
46

create-conventional-changelog

Shell
7
star
47

glibc-packages

Glibc packages for termux (repository mirror)
Shell
7
star
48

termux-community

5
star
49

libandroid-utimes

Library with futimes, futimesat, lutimes from bionic
C
2
star