This is the mail archive of the binutils@sources.redhat.com 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]

Re: Creating an absolute BFD given a relocateable BFD.



> I purchased a copy of the Cygnus Support book "LIB BFD, The
> Binary File Descriptor Library".  I am trying to create an absolute output
> BFD from a relocateable input BFD of the same TARGET type.  I have tried to
> reset the bfd->xvec->object_flag bit for HAS_RELOC. I have tried to reset
> the bfd->xvec->section_flag bit for SEC_RELOC. I have tried to reset the
> reset the bfd->flags bit for HAS_RELOC and I have tried to reset the reset
> the section->flags bit for SEC_RELOC.
> 
> No mater what I do in end up with relocations in the output.  Can you give
> me any words of wisdom?

Those flags don't *control* the bfd, they just *indicate* what's in
the bfd.  Changing the flags doesn't change the bfd, it just makes the
flags wrong.  To get rid of the relocations you have to apply them to
the data, which is basically what the linker does.  You might want to
look at the latest ld/ldint.texinfo for the overview of how emulations
work, since they cover the basic process of linking.  There *is* a way
to tell the BFD library to relocation a section for you, but you have
to prepare for it.

You also shouldn't modify anything under "xvec" as those describe the
generic format (capabilities and features), not the specific bfd.


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