This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [bfd] RFC: support to get data from import/export tables [especially PE files]


Hi Jakub,

I've got question how to introduce new functions in bfd.
I haven't seen any doc about it.

The code is the documentation. :-) OK, so that is not the greatest situation, but it is basically true. There is a file bfd/doc/bfdint.texi which you ought to look at. Plus of course familiarity with how bfd works helps a lot.



+.#define BFD_JUMP_TABLE_IMPORT(NAME) \
+.  NAME##_imports_get_shared_objects, \
+.  NAME##_imports_get, \

maybe instead of creating new BFD_JUMP_TABLE() I've should add these function to BFD_JUMP_TABLE() which already exists?)

No, it is best to keep this new functionality separate and have a new jump table.


and than in each declared bfd_target I should do:
BFD_JUMP_TABLE_IMPORT(_bfd_noimports) when i don't implement support for it.
and BFD_JUMP_TABLE_IMPORT(mytarget) when I implement support for it?

Yes, although you can ease this somewhat by providing a default definition in elfxx-target.h, so that you do not have to handle every ELF based target separately.


[these _bfd_noimports_* function SHOULD exists or they could be macros
to bfd_true() bfd_false() or bfd_nullvoidptr() with typecast?
Where I should define them?]

In bfd.c


Am I right?

Spot on. :-)


Cheers
  Nick



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]