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: using BFD to load and reloc a simple file


thockin@hockin.org wrote:

I'm not sure that I am doing what I want to do most effectively.  The end
goal is a small self-contained executable with a few sections that will be
located into memory at some system-specific addresses (which can not be
known at build time).

I've succeeded in making a static binary that works for a given fixed
address.  Now I need to make it relocateable.  Linking with -r seems to
give me the binary I want (though I am not sure it would catch
unresolvable references anymore).

Would I be better off using -pie or some other method?


You could take a look at the 2.6.x Linux kernel or the insmod program for kernel 2.4.x. They both load and relocate elf objects and are GPL.

David Daney


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