how to add a new glibc symbol ?
Net Llama!
netllama
Mon May 17 11:56:28 PDT 2004
On 12/03/03 02:27, Roger Oberholtzer wrote:
> On Wed, 3 Dec 2003 09:19:48 +0100
> Roger Oberholtzer <roger at opq.se> wrote:
>
>
>>
>>The Linux program loader will load a DSO (libxx.so) specified in an
>>environment variable when an application starts. This would allow you to
>>make a dummy library to provide the missing label. I always thought this
>>was both a neat and a dangerous feature. I believe it it the very first
>>thing loaded, so it should be available to libc.
>>
>>Let me know if you are interested and I will relocate the name of the
>>environment variable. It was something like LD_PRELOAD=libxyx.so.
>
>
> Oddly, my memory was right. Here is a simple intro:
>
> http://www.uberhip.com/people/godber/interception/html/slide_5.html
>
OK, i tried this, but either i'm not understanding it, or its not working.
I first did:
gcc -fPIC -rdynamic -g -c -Wall ctype_b.c
which gave me ctype_b.o (no errors, or warnings). Next I did:
export LD_PRELOAD=~/ctype_b.o
and then I tried to configure rpm again, but it died immediately:
/bin/sh: error while loading shared libraries: /root/ctype_b.o: ELF
file's phentsize not the expected size
I googled a bit to figure out what a phentsize is, and found this
explanation:
#####
phentsize is a field in the ELF linking header that specifies the size
in bytes of one entry in the file's program header table.
#####
The program header table is evidently optional according to the little
bit I've been able to find on it. But i don't really understand what
that all means, or why its blowing up.
Any other ideas?
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
L. Friedman netllama at linux-sxs.org
Linux Step-by-step & TyGeMo: http://netllama.ipfox.com
6:00pm up 1:11, 1 user, load average: 0.23, 0.30, 0.37
More information about the Linux-users
mailing list