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 (mips-elf): Reading relocation entries in user program


"Marshall B. Rogers" <mbr@64.vg> writes:

> I've been sifting through documentation on the BFD library in hopes of
> finding an interface for reading the relocations of a section/file
> (since I noticed various relocation types are defined in "bfd.h").
> This doesn't seem to be possible, though - I'm guessing due to BFD's
> goal of abstraction.
>
> Still, I love BFD's programming interface, and I prefer it over
> libelf, which is quite clunky. Is there a simple - albeit possibly
> hacky - way to get at the relocation entries in an ELF file through
> BFD? Hopefully I won't have to end up using some strange combination
> of BFD and libelf...

bfd_get_reloc_upper_bound and bfd_canonicalize_reloc.  See
binutils/objdump.c for an example of usage.

BFD's documentation is truly horrible.  But, then, libelf's is not all
that great either.

Ian


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