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: what's the intention of "bfd_elf32_bfd_get_relocated_section_contents" in bfd sources


Thanks very much.
I think I've eventually got the right image about bfd relocation operations.

In my case, the linker defined macro "elf_backend_relocation_section",
So If input and output files has same format(for me it is elf32), will
result in using backend functions "_bfd_mips_elf_relocate_section" and
"mips_elf_calculation_relocation" to do relocation while linking.

Though bfd will still call the generic function
"_bfd_generic_final_link" and "bfd_perform_relocation" when linking
into different output format, as you said, I can use special functions
to do the job without changing the confusing "bfd_perform_relocation".

Please be generous to point out if I am wrong.
Thanks again.



On Fri, Dec 26, 2008 at 2:09 PM, Ian Lance Taylor <iant@google.com> wrote:
> "Amker.Cheng" <amker.cheng@gmail.com> writes:
>
>> Since "bfd_get_relocated_section_contents" will eventually calls to
>> bfd_perform_relocation, I have to modify "bfd_perform_relocation" If I
>> want to add new relocation types into instruction set.
>
> No, you just set the howto appropriately.  If necessary, use
> howto->special_function.  You should never need to change
> bfd_perform_relocation itself.
>
> Ian
>


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