This is the mail archive of the
mailing list for the glibc project.
Re: fopen() calls __open()
> John Reiser <jreiser@BitWagon.com> writes:
>>For many particular cases, it is feasible to rewrite (patch) glibc
>>at runtime. ...
> This is an interesting option to consider. Can you point me to any
> open-source applications that actually do this?
The runtime loader itself (rtld, part of glibc) does patching when a module
is marked with DT_TEXTREL in its ElfXX_Dyn. So look in the glibc source
for TEXTREL. Of course one of the important ideas is that the relocation
entries ElfXX_Rel specify exactly _where_ do to the patching, whereas
your case might need a disassembler to find the locations. The objcopy
module of the binutils project has disassemblers; there are others.
Two other projects which use runtime patching are:
http://bitwagon.com/rtldi/rtldi.html indirect runtime loader
http://bitwagon.com/tub/tub.html address-space manager