On Thu, Aug 18, 2022, 04:10 Dale R. Worley <wor...@alum.mit.edu> wrote:
> Sam <s...@cmpct.info> writes: > > You probably want to edit /etc/ld.so.conf or /etc/ld.so.conf.d/* instead. > > The overall concept is that you almost certainly don't want to modify > the bash source code (and thus executable) to do this. > > In general, if you want to have a particular environment variable set > "all the time", you insert "export X=..." in one of your startup files. > If you want it visible to everybody, you insert that in one of the > system startup files. Depending on exactly what processes you want > affected and how your OS handles these things determines which file to > modify. > > However, the original question is > > > I want to automatically add LD_PRELOAD before starting bash to make > > this dynamic library work > > I see looking at the ld.so manual page: > > /etc/ld.so.preload > File containing a whitespace-separated list of ELF > shared > libraries to be loaded before the program. > > So if what you want is for all processes to preload a particular > library, add its name to this file. Or rather, check how your > particular OS provides this facility. > > Dale > i think they mean android nonroot default fyi asker termux does just change #! to its android path >