public inbox for libc-help@sourceware.org
 help / color / mirror / Atom feed
* Add a new function to dlfcn.h?
@ 2020-08-16 12:52 Y.D.
  2020-08-16 12:59 ` Florian Weimer
  0 siblings, 1 reply; 4+ messages in thread
From: Y.D. @ 2020-08-16 12:52 UTC (permalink / raw)
  To: libc-help

Hi all,
I'm trying to add a new function to glibc-2.32, and I'm working on getting
the memory size allocated to a shared object.
To achieve this, I want to use the private fields(l_map_start and
l_map_end) in struct link_map, which is said to be internal to dynamic
linker, so I want to add a function to dlfcn.h, just like dlopen() and
dlclose().

The question is, when I want to imitate the way dlopen works, I find that
the dlopen first calls functions in dlfcn/dlopen.c, and then functions in
elf/dl-open.c, which makes me very confused.
If I want to add a new function in dlfcn.h, what should I do? Do I have to
write a new file under dlfcn/ called dlusage.c, and another called
dl-usage.c under elf/? If this is the case, how should I modify the
Makefile in both directories?
Or can I just append one function in a few existing c files and headers?

Any help will be highly appreciated.

Best,
Fengkai

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-08-25 12:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-16 12:52 Add a new function to dlfcn.h? Y.D.
2020-08-16 12:59 ` Florian Weimer
2020-08-17  2:15   ` Y.D.
2020-08-25 12:46     ` Florian Weimer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).