Skip to main content

library deps linux

doas apt install binutils

 objdump -p  adb | grep NEEDED

  objdump -p  $(which adb) | grep NEEDED

readelf -d  adb 

 NEEDED               libbase.so.0
  NEEDED               libcrypto.so.0
  NEEDED               libcutils.so.0
  NEEDED               libpthread.so.0
  NEEDED               libusb-1.0.so.0
  NEEDED               libstdc++.so.6
  NEEDED               libm.so.6
  NEEDED               libgcc_s.so.1
  NEEDED               libc.so.6
  NEEDED               ld-linux-x86-64.so.2

 

 objdump -p  adb 

  RUNPATH              /usr/lib/x86_64-linux-gnu/android


change  RUNPATH value 


patchelf --set-rpath '$ORIGIN/../lib64' filename
 

# Clearing RPATH & RUNPATH

patchelf --remove-rpath <path-to-elf># Setting RPATH
patchelf --force-rpath --set-rpath <desired-rpath> <path-to-elf># Setting RUNPATH
patchelf --set-rpath <desired-rpath> <path-to-elf>  
patchelf --set-interpreter <path-to-interpreter> <path-to-elf># For example: 
 
>>If you specify --force-rpath, sets RPATH, otherwise sets RUNPATH 
 
patchelf  --print-interpreter adb 
/lib64/ld-linux-x86-64.so.2
  
patchelf  --print-rpath adb 
/usr/lib/x86_64-linux-gnu/android 
 
 >> dynamic loader = "ELF interpreter"=
example  patchelf  --print-interpreter $(which bash)
/lib64/ld-linux-x86-64.so.2
 
 /lib64/ld-linux-x86-64.so.2 --help
Usage: /lib64/ld-linux-x86-64.so.2 [OPTION]... EXECUTABLE-FILE [ARGS-FOR-PROGRAM...]
You have invoked 'ld.so', the program interpreter for dynamically-linked
ELF programs. Usually, the program interpreter is invoked automatically
when a dynamically-linked executable is started.

You may invoke the program interpreter program directly from the command
line to load and run an ELF executable file; this is like executing that
file itself, but always uses the program interpreter you invoked,
instead of the program interpreter specified in the executable file you
run. Invoking the program interpreter directly provides access to
additional diagnostics, and changing the dynamic linker behavior without
setting environment variables (which would be inherited by subprocesses).

--list list all dependencies and how they are resolved
--verify verify that given object really is a dynamically linked
object we can handle
--inhibit-cache Do not use /etc/ld.so.cache
--library-path PATH use given PATH instead of content of the environment
variable LD_LIBRARY_PATH
--glibc-hwcaps-prepend LIST
search glibc-hwcaps subdirectories in LIST
--glibc-hwcaps-mask LIST
only search built-in subdirectories if in LIST
--inhibit-rpath LIST ignore RUNPATH and RPATH information in object names
in LIST
--audit LIST use objects named in LIST as auditors
--preload LIST preload objects named in LIST
--argv0 STRING set argv[0] to STRING before running
--list-tunables list all tunables with minimum and maximum values
--list-diagnostics list diagnostics information
--help display this help and exit
--version output version information and exit

This program interpreter self-identifies as: /lib64/ld-linux-x86-64.so.2

Shared library search path:
(libraries located via /etc/ld.so.cache)
/lib/x86_64-linux-gnu (system search path)
/usr/lib/x86_64-linux-gnu (system search path)
/lib (system search path)
/usr/lib (system search path)

Subdirectories of glibc-hwcaps directories, in priority order:
x86-64-v4 (supported, searched)
x86-64-v3 (supported, searched)
x86-64-v2 (supported, searched)

Legacy HWCAP subdirectories under library search path directories:
haswell (AT_PLATFORM; supported, searched)
tls (supported, searched)
avx512_1 (supported, searched)
x86_64 (supported, searched)
 
 ##load library from current folder 
LD_LIBRARY_PATH=. ./adb shell
 
 
https://linux.die.net/man/8/ld.so
https://linux.die.net/man/1/ld
https://man7.org/linux/man-pages/man1/ldd.1.html 
 https://github.com/NixOS/patchelf/blob/master/README.md
https://trugman-internals.com/elf-loaders-libraries-executables/
https://www.hpc.dtu.dk/?page_id=1180 
https://stackoverflow.com/questions/13769141/can-i-change-rpath-in-an-already-compiled-binary
 http://xahlee.info/UnixResource_dir/_/ldpath.html

Comments

Popular posts from this blog

sxhkd volume andbrightness config for dwm on void

xbps-install  sxhkd ------------ mkdir .config/sxhkd cd .config/sxhkd nano/vim sxhkdrc -------------------------------- XF86AudioRaiseVolume         amixer -c 1 -- sset Master 2db+ XF86AudioLowerVolume         amixer -c 1 -- sset Master 2db- XF86AudioMute         amixer -c 1 -- sset Master toggle alt + shift + Escape         pkill -USR1 -x sxhkd XF86MonBrightnessUp          xbacklight -inc 20 XF86MonBrightnessDown          xbacklight -dec 20 ------------------------------------------------------------- amixer -c card_no -- sset Interface volume run alsamixer to find card no and interface names xbps-install -S git git clone https://git.suckless.org/dwm xbps-install -S base-devel libX11-devel libXft-devel libXinerama-devel  vim config.mk # FREETYPEINC = ${X11INC}/freetype2 #comment for non-bsd make clean install   cp config.def.h config.h vim config.h xbps-install -S font-symbola #for emoji on statusbar support     void audio config xbps-i

Hidden Wiki

Welcome to The Hidden Wiki New hidden wiki url 2015 http://zqktlwi4fecvo6ri.onion Add it to bookmarks and spread it!!! Editor's picks Bored? Pick a random page from the article index and replace one of these slots with it. The Matrix - Very nice to read. How to Exit the Matrix - Learn how to Protect yourself and your rights, online and off. Verifying PGP signatures - A short and simple how-to guide. In Praise Of Hawala - Anonymous informal value transfer system. Volunteer Here are five different things that you can help us out with. Plunder other hidden service lists for links and place them here! File the SnapBBSIndex links wherever they go. Set external links to HTTPS where available, good certificate, and same content. Care to start recording onionland's history? Check out Onionland's Museum Perform Dead Services Duties. Introduction Points Ahmia.fi - Clearnet search engine for Tor Hidden Services (allows you

fix idm integration on chrome

Chrome Browser Integration I do not see IDM extension in Chrome extensions list. How can I install it?  How to configure IDM extension for Chrome? Please note that all IDM extensions that can be found in Google Store are fake and should not be used. You need to install IDM extension manually from IDM installation folder. Read in step 2 how to do it . 1. Please update IDM to the latest version by using  "IDM Help->Check for updates..."  menu item 2.  I don't see  "IDM Integration module"  extension in the list of extensions in  Chrome . How can I install it? Press on  Chrome  menu ( arrow 1  on the image), select  "Settings"  menu item ( arrow 2  on the image) and then select  "Extensions"  tab ( arrow 3  on the image). After this open IDM installation folder ( "C:\Program Files (x86)\Internet Download Manager"  by default,  arrow 4  on the image) and drag and drop  "IDMGCExt.crx"  ( arrow 5  on the image) file int