This is the mail archive of the 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: Issue with BFD and foreign ELF files

On Sat, May 13, 2017 at 12:18:42PM +0200, Alexandro Sanchez Bach wrote:
> After opening ARM/MIPS/PPC ELF files (see attachments) via open_bfd(...),
> whenever I query bfd_get_arch_info(...) I get bfd_arch_unknown (0) in the
> arch and mach fields. Only x86/amd64 works as expected.
> libbfd is a dependency (-lbfd) for my project. I installed it via `apt-get
> install libbfd-dev` on Ubuntu 16.04, and noticed that there are multiple
> "flavors" of BFD at /usr/lib/x86_64-linux-gnu/libbfd-2.26* (*.so, *,
> *, *, etc.). Is there any way to dynamically load a
> version that works with any architecture?
> I would be really happy if someone could point me in the right direction.

The binutils project makes no promise regarding the libbfd ABI.  As
you're finding, targets supported by libbfd are configurable.  These
two facts mean that you cannot really use a compiled by
someone else.  So, compile your own from source.

How you go about that depends on how often you think you'll need to
update libbfd, and how easy you want to make building libbfd for your

Alan Modra
Australia Development Lab, IBM

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