This is the mail archive of the
mailing list for the binutils project.
[bfd] RFC: support to get data from import/export tables [especially PE files]
- From: Jakub Zawadzki <darkjames at darkjames dot ath dot cx>
- To: binutils at sourceware dot org
- Date: Sat, 3 Nov 2007 20:59:39 +0100
- Subject: [bfd] RFC: support to get data from import/export tables [especially PE files]
I'm missing functionality to get data from import/export tables.
In peXXigen.c we've got two functions:
pe_print_idata() && pe_print_edata() which provide reading these data...
However only way to read this data (for now) is to open pipe/file,
call bfd_print_private_bfd_data(), and parse incoming data.
I'd like idea of making two functions for getting import data:
bfd_get_imports_dll() /* get info about shared libraries used by program */
bfd_get_imports() /* get info about symbols from given shared library */
And one to get export data:
bfd_get_exports() /* get info about exported symbols */
In bfd_get_imports_dll() we could callback to function given by user,
and in that function call bfd_get_imports() which could do callback to
Yeap, I know it's not 100% portable, in ELF files we could call
bfd_get_imports() without given library. (AFAIR ELF .dynsym don't provide such
information, maybe except versioning e.g. @GLIBC_2.2.5)
I don't know how it looks like in other targets.
First of all I like to know if this function could be implemented in
bfd, and than if yes (or no (why? except portability))
than how you see idea of passing params to that function.
I thought about creating some new types:
which would contain some info exported to user (portable as much as it
can be), and some private data used by target.