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: Reuse of reloc_howto_type depending on section


Hi Martin,

My idea: instead of returning types BFD_RELOC_X and BFD_RELOC_X_CODE
in spear32_cgen_lookup_reloc() I would stick to returning
BFD_RELOC_Xs, since this approach does not cover undefined symbols in
the assembler suitably. I would then like to implement the division by
2 in spear32_final_link_relocate() just before calling
bfd_final_link_relocate().

This makes sense.


However, I am unsure how to determine the
section of the symbol in spear32_final_link_relocate().

Have a look at how it is done for other targets. For example in bfd/elf-m10300.c:mn10300_elf_relocate_section (which calls mn10300_elf_final_link_relocate) there is code to compute the value for a variable called 'sec' which is the section containing the symbol that is referred to by the reloc. You can then test the flags field of this structure to determine if the section is a code section.


Cheers
  Nick



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